зеркало из https://github.com/mozilla/pjs.git
Bug 459041 - jar: URLs break sss_serializeSessionStorage (and thus SessionStore)
This commit is contained in:
Родитель
e99145da14
Коммит
3e0581faaa
|
@ -1116,26 +1116,27 @@ SessionStoreService.prototype = {
|
|||
let hasContent = false;
|
||||
|
||||
for (let i = 0; i < aHistory.count; i++) {
|
||||
let uri = aHistory.getEntryAtIndex(i, false).URI.clone();
|
||||
let uri = aHistory.getEntryAtIndex(i, false).URI;
|
||||
// sessionStorage is saved per domain (cf. nsDocShell::GetSessionStorageForURI)
|
||||
if (uri instanceof Ci.nsIURL)
|
||||
uri.path = "";
|
||||
if (storageData[uri.spec] || !(aFullData || this._checkPrivacyLevel(uri.schemeIs("https"))))
|
||||
let domain = uri.spec;
|
||||
try {
|
||||
if (uri.host)
|
||||
domain = uri.prePath;
|
||||
}
|
||||
catch (ex) { /* this throws for host-less URIs (such as about: or jar:) */ }
|
||||
if (storageData[domain] || !(aFullData || this._checkPrivacyLevel(uri.schemeIs("https"))))
|
||||
continue;
|
||||
|
||||
let storage, storageItemCount;
|
||||
let storage, storageItemCount = 0;
|
||||
try {
|
||||
storage = aDocShell.getSessionStorageForURI(uri);
|
||||
storageItemCount = storage.length;
|
||||
if (storageItemCount == 0)
|
||||
continue;
|
||||
}
|
||||
catch (ex) {
|
||||
// sessionStorage might throw if it's turned off, see bug 458954
|
||||
catch (ex) { /* sessionStorage might throw if it's turned off, see bug 458954 */ }
|
||||
if (storageItemCount == 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
let data = storageData[uri.spec] = {};
|
||||
let data = storageData[domain] = {};
|
||||
for (let j = 0; j < storageItemCount; j++) {
|
||||
try {
|
||||
let key = storage.key(j);
|
||||
|
|
Загрузка…
Ссылка в новой задаче