diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index 36ec6f07b5cd..9e650d38d0aa 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -926,7 +926,7 @@ nsContextMenu.prototype = { var frameURL = doc.location.href; urlSecurityCheck(frameURL, - this._unremotePrincipal(this.browser.contentPrincipal), + this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); var referrer = doc.referrer; openUILinkIn(frameURL, "current", { disallowInheritPrincipal: true, @@ -987,7 +987,7 @@ nsContextMenu.prototype = { viewImageDesc: function(e) { var doc = this.target.ownerDocument; urlSecurityCheck(this.imageDescURL, - this._unremotePrincipal(this.browser.contentPrincipal), + this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); openUILink(this.imageDescURL, e, { disallowInheritPrincipal: true, referrerURI: doc.documentURIObject }); @@ -999,7 +999,7 @@ nsContextMenu.prototype = { reloadImage: function(e) { urlSecurityCheck(this.mediaURL, - this._unremotePrincipal(this.browser.contentPrincipal), + this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); if (this.target instanceof Ci.nsIImageLoadingContent) @@ -1015,7 +1015,7 @@ nsContextMenu.prototype = { else { viewURL = this.mediaURL; urlSecurityCheck(viewURL, - this._unremotePrincipal(this.browser.contentPrincipal), + this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); } @@ -1058,7 +1058,7 @@ nsContextMenu.prototype = { // Change current window to the URL of the background image. viewBGImage: function(e) { urlSecurityCheck(this.bgImageURL, - this._unremotePrincipal(this.browser.contentPrincipal), + this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); var doc = this.target.ownerDocument; openUILink(this.bgImageURL, e, { disallowInheritPrincipal: true, diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index 39c0300897ac..e62be102d0cb 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -92,6 +92,7 @@ let WebProgressListener = { json.documentURI = content.document.documentURIObject.spec; json.charset = content.document.characterSet; json.mayEnableCharacterEncodingMenu = docShell.mayEnableCharacterEncodingMenu; + json.principal = content.document.nodePrincipal; } sendAsyncMessage("Content:LocationChange", json, objects); diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index efdaa2e64d48..2878fad347ec 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -447,7 +447,7 @@ readonly="true"/> + null + + + diff --git a/toolkit/modules/RemoteWebProgress.jsm b/toolkit/modules/RemoteWebProgress.jsm index 62cf95a0edce..847010680351 100644 --- a/toolkit/modules/RemoteWebProgress.jsm +++ b/toolkit/modules/RemoteWebProgress.jsm @@ -176,6 +176,7 @@ RemoteWebProgressManager.prototype = { this._browser._documentURI = newURI(json.documentURI); this._browser._imageDocument = null; this._browser._mayEnableCharacterEncodingMenu = json.mayEnableCharacterEncodingMenu; + this._browser._contentPrincipal = json.principal; } this._callProgressListeners("onLocationChange", webProgress, request, location, flags);