summaryrefslogtreecommitdiffstats
path: root/toolkit
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-05-01 09:53:46 +0200
committerGitHub <noreply@github.com>2018-05-01 09:53:46 +0200
commitae45e61da06ba989fcbb856183d9578d4d4f51ed (patch)
tree5c7dea17ce684c1cce57011ef487370c22d0e677 /toolkit
parentfefce8f7ccbc476cfc46e61b01eff069346d3c73 (diff)
parentcc4036a9cd56d504667c07fe215e61b22ab0e1f4 (diff)
downloadUXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar
UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.gz
UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.lz
UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.xz
UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.zip
Merge pull request #311 from janekptacijarabaci/security_blocking_data_2
Use asyncOpen2() for docshell loads
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/components/viewsource/content/viewSource-content.js2
-rw-r--r--toolkit/content/widgets/browser.xml6
-rw-r--r--toolkit/modules/sessionstore/Utils.jsm5
3 files changed, 12 insertions, 1 deletions
diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js
index fa1dd19f1..70d23eaa4 100644
--- a/toolkit/components/viewsource/content/viewSource-content.js
+++ b/toolkit/components/viewsource/content/viewSource-content.js
@@ -330,6 +330,8 @@ var ViewSourceContent = {
.createInstance(Ci.nsISHEntry);
shEntry.setURI(BrowserUtils.makeURI(viewSrcURL, null, null));
shEntry.setTitle(viewSrcURL);
+ let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
+ shEntry.triggeringPrincipal = systemPrincipal;
shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory;
shEntry.cacheKey = shEntrySource.cacheKey;
docShell.QueryInterface(Ci.nsIWebNavigation)
diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml
index a5f37b62a..e595c847d 100644
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -135,6 +135,7 @@
aURI = "about:blank";
var aReferrerPolicy = Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT;
+ var aTriggeringPrincipal;
// Check for loadURIWithFlags(uri, { ... });
var params = arguments[1];
@@ -144,6 +145,9 @@
if ('referrerPolicy' in params) {
aReferrerPolicy = params.referrerPolicy;
}
+ if ("triggeringPrincipal" in params) {
+ aTriggeringPrincipal = params.triggeringPrincipal;
+ }
aCharset = params.charset;
aPostData = params.postData;
}
@@ -151,7 +155,7 @@
this._wrapURIChangeCall(() =>
this.webNavigation.loadURIWithOptions(
aURI, aFlags, aReferrerURI, aReferrerPolicy,
- aPostData, null, null));
+ aPostData, null, null, aTriggeringPrincipal));
]]>
</body>
</method>
diff --git a/toolkit/modules/sessionstore/Utils.jsm b/toolkit/modules/sessionstore/Utils.jsm
index 863bca6f5..25b75c71b 100644
--- a/toolkit/modules/sessionstore/Utils.jsm
+++ b/toolkit/modules/sessionstore/Utils.jsm
@@ -16,12 +16,17 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
XPCOMUtils.defineLazyServiceGetter(this, "serializationHelper",
"@mozilla.org/network/serialization-helper;1",
"nsISerializationHelper");
+XPCOMUtils.defineLazyGetter(this, "SERIALIZED_SYSTEMPRINCIPAL", function() {
+ return Utils.serializePrincipal(Services.scriptSecurityManager.getSystemPrincipal());
+});
function debug(msg) {
Services.console.logStringMessage("Utils: " + msg);
}
this.Utils = Object.freeze({
+ get SERIALIZED_SYSTEMPRINCIPAL() { return SERIALIZED_SYSTEMPRINCIPAL; },
+
makeURI: function (url) {
return Services.io.newURI(url, null, null);
},