Bug 1304492 - use frameloader's context to get contentPrincipal, r?mconley
MozReview-Commit-ID: DdzGwIJye14
--- a/toolkit/content/widgets/remote-browser.xml
+++ b/toolkit/content/widgets/remote-browser.xml
@@ -364,19 +364,21 @@
* the <browser> element may not be initialized yet.
*/
this._remoteWebNavigation = Components.classes["@mozilla.org/remote-web-navigation;1"]
.createInstance(Components.interfaces.nsIWebNavigation);
this._remoteWebNavigationImpl = this._remoteWebNavigation.wrappedJSObject;
this._remoteWebNavigationImpl.swapBrowser(this);
- // Initialize to the null principal
- let Services = Components.utils.import("resource://gre/modules/Services.jsm", {}).Services
- this._contentPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
+ // Initialize contentPrincipal to the about:blank principal for this loadcontext
+ let {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});
+ let aboutBlank = Services.io.newURI("about:blank", null, null);
+ let ssm = Services.scriptSecurityManager;
+ this._contentPrincipal = ssm.getLoadContextCodebasePrincipal(aboutBlank, this.loadContext);
this.messageManager.addMessageListener("Browser:Init", this);
this.messageManager.addMessageListener("DOMTitleChanged", this);
this.messageManager.addMessageListener("ImageDocumentLoaded", this);
this.messageManager.addMessageListener("FullZoomChange", this);
this.messageManager.addMessageListener("TextZoomChange", this);
this.messageManager.addMessageListener("ZoomChangeUsingMouseWheel", this);
this.messageManager.addMessageListener("DOMFullscreen:RequestExit", this);