mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1165277 - Use origin in SessionStorage.jsm. r=ttaubert
This commit is contained in:
parent
96a294239c
commit
a754b37e8d
@ -9,6 +9,7 @@ this.EXPORTED_SYMBOLS = ["SessionStorage"];
|
||||
const Cu = Components.utils;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://gre/modules/BrowserUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
@ -72,9 +73,9 @@ let SessionStorageInternal = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the root domain of the current history entry
|
||||
// and use that as a key for the per-host storage data.
|
||||
let origin = principal.jarPrefix + principal.originNoSuffix;
|
||||
// Get the origin of the current history entry
|
||||
// and use that as a key for the per-principal storage data.
|
||||
let origin = principal.origin;
|
||||
if (visitedOrigins.has(origin)) {
|
||||
// Don't read a host twice.
|
||||
return;
|
||||
@ -102,10 +103,9 @@ let SessionStorageInternal = {
|
||||
* {"example.com": {"key": "value", "my_number": 123}}
|
||||
*/
|
||||
restore: function (aDocShell, aStorageData) {
|
||||
for (let host of Object.keys(aStorageData)) {
|
||||
let data = aStorageData[host];
|
||||
let uri = Services.io.newURI(host, null, null);
|
||||
let principal = Services.scriptSecurityManager.getDocShellCodebasePrincipal(uri, aDocShell);
|
||||
for (let origin of Object.keys(aStorageData)) {
|
||||
let data = aStorageData[origin];
|
||||
let principal = BrowserUtils.principalFromOrigin(origin);
|
||||
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
|
||||
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user