Bug 494543 - Can't add items to Dell.com shopping cart (r=dietrich and others)

This commit is contained in:
honzab.moz@firemni.cz 2009-05-27 10:31:32 -07:00
Родитель d9efb6995e
Коммит 33441c2154
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1290,8 +1290,18 @@ SessionStoreService.prototype = {
let storage, storageItemCount = 0;
try {
storage = aDocShell.getSessionStorageForURI(uri);
storageItemCount = storage.length;
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 */ }
if (storageItemCount == 0)