зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1485305 - layout/ Ensure loadURI always passes a triggeringPrincipal() r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D4558 --HG-- extra : source : ae576c76ca3b7d8d552808eb334184a35c8ffcfc
This commit is contained in:
Родитель
c9dd3d1bdb
Коммит
0abfdc788e
|
@ -146,7 +146,9 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
whenDelayedStartupFinished(win, function() {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
win.gBrowser.loadURI(contentPage, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
|
||||
|
@ -155,7 +157,11 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
win.setTimeout(function() { aCallback(win); }, 0);
|
||||
}, true);
|
||||
SimpleTest.info("load's window: " + win.location + " vs. " + window.location);
|
||||
win.setTimeout(function() { win.gBrowser.loadURI(contentPage); }, 0);
|
||||
win.setTimeout(function() {
|
||||
win.gBrowser.loadURI(contentPage, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -110,10 +110,15 @@ function OnLDBLoad()
|
|||
gDebugger = Cc[NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID].
|
||||
createInstance(nsILayoutDebuggingTools);
|
||||
|
||||
if (window.arguments && window.arguments[0])
|
||||
gBrowser.loadURI(window.arguments[0]);
|
||||
else
|
||||
gBrowser.loadURI("about:blank");
|
||||
if (window.arguments && window.arguments[0]) {
|
||||
gBrowser.loadURI(window.arguments[0], {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
} else {
|
||||
gBrowser.loadURI("about:blank", {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
}
|
||||
|
||||
gDebugger.init(gBrowser.contentWindow);
|
||||
|
||||
|
@ -161,7 +166,9 @@ function openFile()
|
|||
fp.open(rv => {
|
||||
if (rv == nsIFilePicker.returnOK && fp.fileURL.spec &&
|
||||
fp.fileURL.spec.length > 0) {
|
||||
gBrowser.loadURI(fp.fileURL.spec);
|
||||
gBrowser.loadURI(fp.fileURL.spec, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -110,7 +110,9 @@
|
|||
|
||||
<textbox id="urlbar" flex="1"
|
||||
onkeypress="if (event.keyCode == 13)
|
||||
gBrowser.loadURI(this.value);" />
|
||||
gBrowser.loadURI(this.value, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});" />
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
|
|
|
@ -40,5 +40,7 @@ this.OnRecordingLoad = function OnRecordingLoad(win) {
|
|||
|
||||
var args = window.arguments[0].wrappedJSObject;
|
||||
|
||||
gBrowser.loadURI(args.uri);
|
||||
gBrowser.loadURI(args.uri, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче