mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Store load settings in URL fragment, not query string
This commit is contained in:
@@ -118,7 +118,7 @@ class Atom extends Model
|
||||
|
||||
# Returns the load settings hash associated with the current window.
|
||||
@getLoadSettings: ->
|
||||
@loadSettings ?= JSON.parse(decodeURIComponent(location.search.substr(14)))
|
||||
@loadSettings ?= JSON.parse(decodeURIComponent(location.hash.substr(1)))
|
||||
cloned = _.deepClone(@loadSettings)
|
||||
# The loadSettings.windowState could be large, request it only when needed.
|
||||
cloned.__defineGetter__ 'windowState', =>
|
||||
|
||||
@@ -86,7 +86,7 @@ class AtomWindow
|
||||
protocol: 'file'
|
||||
pathname: "#{@resourcePath}/static/index.html"
|
||||
slashes: true
|
||||
query: {loadSettings: JSON.stringify(loadSettings)}
|
||||
hash: encodeURIComponent(JSON.stringify(loadSettings))
|
||||
|
||||
hasProjectPath: -> @projectPaths?.length > 0
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ window.onload = function() {
|
||||
cacheDir = path.join(cacheDir, 'root');
|
||||
}
|
||||
|
||||
// Skip "?loadSettings=".
|
||||
var rawLoadSettings = decodeURIComponent(location.search.substr(14));
|
||||
var rawLoadSettings = decodeURIComponent(location.hash.substr(1));
|
||||
var loadSettings;
|
||||
try {
|
||||
loadSettings = JSON.parse(rawLoadSettings);
|
||||
|
||||
Reference in New Issue
Block a user