URI encode parameter values

Previously the path to open would not open properly if it contained
a '&' character since the character was not encoded and would cause
the parameter parsing to stop at the first '&'.
This commit is contained in:
Kevin Sawicki 2013-06-07 11:11:19 -07:00
parent 7f6e5e2e52
commit b89eb07c6e

View File

@ -12,8 +12,10 @@ class AtomWindow
@browserWindow = new BrowserWindow show: false, title: 'Atom'
@handleEvents()
url = "file://#{resourcePath}/static/index.html#bootstrapScript=#{bootstrapScript}&resourcePath=#{resourcePath}"
url += "&pathToOpen=#{@pathToOpen}" if @pathToOpen
url = "file://#{resourcePath}/static/index.html#"
url += "bootstrapScript=#{encodeURIComponent(bootstrapScript)}"
url += "&resourcePath=#{encodeURIComponent(resourcePath)}"
url += "&pathToOpen=#{encodeURIComponent(@pathToOpen)}" if @pathToOpen
url += '&exitWhenDone=1' if exitWhenDone
@browserWindow.loadUrl url