Bug 1492154 - Allow for invalid origin in principal and fix misspelled principal uri and url in sessionstore. r=IanN a=IanN
--- a/suite/common/src/nsSessionStore.js
+++ b/suite/common/src/nsSessionStore.js
@@ -1688,28 +1688,35 @@ SessionStoreService.prototype = {
}
catch (ex) {
// Chances are that this is getEntryAtIndex throwing, as seen in bug 669196.
// We've already asserted in _collectTabData, so we won't show that again.
continue;
}
// sessionStorage is saved per principal (cf. nsGlobalWindow::GetSessionStorage)
- let origin = principal.origin;
+ let origin;
+ try {
+ origin = principal.origin;
+ }
+ catch (ex) {
+ origin = principal.URI.spec;
+ }
+
if (storageData[origin])
continue;
- let isHTTPS = principal.uri && principal.url.schemeIs("https");
+ let isHTTPS = principal.URI && principal.URI.schemeIs("https");
if (!(aFullData || this._checkPrivacyLevel(isHTTPS, aIsPinned)))
continue;
let storage, storageItemCount = 0;
let window = aDocShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindow);
+ .getInterface(Components.interfaces.nsIDOMWindow);
try {
let storageManager = aDocShell.QueryInterface(Components.interfaces.nsIDOMStorageManager);
storage = storageManager.getStorage(window, principal);
// See Bug 1232955 - storage.length can throw, catch that failure here inside the try.
if (storage)
storageItemCount = storage.length;
}