Bug 1758250 - deal with non-existing url values from session restore so they don't brick other functionality, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D142947
This commit is contained in:
@@ -2211,11 +2211,12 @@
|
||||
break;
|
||||
case "currentURI":
|
||||
getter = () => {
|
||||
let url = SessionStore.getLazyTabValue(aTab, "url");
|
||||
// Avoid recreating the same nsIURI object over and over again...
|
||||
if (browser._cachedCurrentURI) {
|
||||
return browser._cachedCurrentURI;
|
||||
}
|
||||
let url =
|
||||
SessionStore.getLazyTabValue(aTab, "url") || "about:blank";
|
||||
return (browser._cachedCurrentURI = Services.io.newURI(url));
|
||||
};
|
||||
break;
|
||||
@@ -2255,7 +2256,8 @@
|
||||
break;
|
||||
case "remoteType":
|
||||
getter = () => {
|
||||
let url = SessionStore.getLazyTabValue(aTab, "url");
|
||||
let url =
|
||||
SessionStore.getLazyTabValue(aTab, "url") || "about:blank";
|
||||
// Avoid recreating the same nsIURI object over and over again...
|
||||
let uri;
|
||||
if (browser._cachedCurrentURI) {
|
||||
|
||||
@@ -4341,7 +4341,7 @@ var SessionStoreInternal = {
|
||||
* @returns a flag indicates whether a connection has been made
|
||||
*/
|
||||
prepareConnectionToHost(tab, url) {
|
||||
if (!url.startsWith("about:")) {
|
||||
if (url && !url.startsWith("about:")) {
|
||||
let principal = Services.scriptSecurityManager.createNullPrincipal({
|
||||
userContextId: tab.userContextId,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user