зеркало из https://github.com/mozilla/gecko-dev.git
Bug 494543 - Can't add items to Dell.com shopping cart (r=dietrich and others)
This commit is contained in:
Родитель
d9efb6995e
Коммит
33441c2154
|
@ -1290,7 +1290,17 @@ SessionStoreService.prototype = {
|
|||
|
||||
let storage, storageItemCount = 0;
|
||||
try {
|
||||
storage = aDocShell.getSessionStorageForURI(uri);
|
||||
var principal = Cc["@mozilla.org/scriptsecuritymanager;1"].
|
||||
getService(Ci.nsIScriptSecurityManager).
|
||||
getCodebasePrincipal(uri);
|
||||
|
||||
// Using getSessionStorageForPrincipal instead of getSessionStorageForURI
|
||||
// just to be able to pass aCreate = false, that avoids creation of the
|
||||
// sessionStorage object for the page earlier than the page really
|
||||
// requires it. It was causing problems while accessing a storage when
|
||||
// a page later changed its domain.
|
||||
storage = aDocShell.getSessionStorageForPrincipal(principal, false);
|
||||
if (storage)
|
||||
storageItemCount = storage.length;
|
||||
}
|
||||
catch (ex) { /* sessionStorage might throw if it's turned off, see bug 458954 */ }
|
||||
|
|
Загрузка…
Ссылка в новой задаче