diff --git a/devtools/client/responsive.html/browser/web-navigation.js b/devtools/client/responsive.html/browser/web-navigation.js
index da96eb43151b..de535540e3e8 100644
--- a/devtools/client/responsive.html/browser/web-navigation.js
+++ b/devtools/client/responsive.html/browser/web-navigation.js
@@ -79,9 +79,9 @@ BrowserElementWebNavigation.prototype = {
postData: postData ? readInputStreamToString(postData) : null,
headers: headers ? readInputStreamToString(headers) : null,
baseURI: baseURI ? baseURI.spec : null,
- triggeringPrincipal: triggeringPrincipal
- ? Utils.serializePrincipal(triggeringPrincipal)
- : Services.scriptSecurityManager.createNullPrincipal({}),
+ triggeringPrincipal: Utils.serializePrincipal(
+ triggeringPrincipal ||
+ Services.scriptSecurityManager.createNullPrincipal({})),
requestTime: telemetry.msSystemNow(),
});
},
diff --git a/toolkit/actors/WebNavigationChild.jsm b/toolkit/actors/WebNavigationChild.jsm
index d53d4163f146..2b1a54a2bdd3 100644
--- a/toolkit/actors/WebNavigationChild.jsm
+++ b/toolkit/actors/WebNavigationChild.jsm
@@ -108,7 +108,9 @@ class WebNavigationChild extends ActorChild {
if (triggeringPrincipal)
triggeringPrincipal = Utils.deserializePrincipal(triggeringPrincipal);
if (!triggeringPrincipal) {
- triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal({});
+ // If we don't have a triggering principal we won't be able to continue the load.
+ let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
+ debug.abort("WebNavigationChild.js", 112);
}
let loadURIOptions = {
triggeringPrincipal,
diff --git a/toolkit/components/remotebrowserutils/RemoteWebNavigation.js b/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
index a7b841e02ac0..9932968d69a4 100644
--- a/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
+++ b/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
@@ -100,7 +100,7 @@ RemoteWebNavigation.prototype = {
headers: aLoadURIOptions.headers ? Utils.serializeInputStream(aLoadURIOptions.headers) : null,
baseURI: aLoadURIOptions.baseURI ? aLoadURIOptions.baseURI.spec : null,
triggeringPrincipal: Utils.serializePrincipal(
- aLoadURIOptions.triggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
+ aLoadURIOptions.triggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
requestTime: Services.telemetry.msSystemNow(),
});
},
diff --git a/toolkit/modules/E10SUtils.jsm b/toolkit/modules/E10SUtils.jsm
index 8f95f84051ad..ff7045c75345 100644
--- a/toolkit/modules/E10SUtils.jsm
+++ b/toolkit/modules/E10SUtils.jsm
@@ -332,9 +332,7 @@ var E10SUtils = {
uri: aURI.spec,
flags: aFlags || Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
referrer: aReferrer ? aReferrer.spec : null,
- triggeringPrincipal: aTriggeringPrincipal
- ? Utils.serializePrincipal(aTriggeringPrincipal)
- : null,
+ triggeringPrincipal: Utils.serializePrincipal(aTriggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
reloadInFreshProcess: !!aFreshProcess,
},
historyIndex: sessionHistory.legacySHistory.requestedIndex,