Bug 1493620 - Skip forcing about:blank in windowless browsers for background pages r=rpl,kmag

Differential Revision: https://phabricator.services.mozilla.com/D62568

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tomislav Jovanovic 2020-02-13 19:20:50 +00:00
parent 362986be19
commit 9f1210036d

View File

@ -1272,15 +1272,11 @@ class HiddenXULWindow {
// The windowless browser is a thin wrapper around a docShell that keeps
// its related resources alive. It implements nsIWebNavigation and
// forwards its methods to the underlying docShell, but cannot act as a
// docShell itself. Getting .docShell gives us the
// underlying docShell, and `QueryInterface(nsIWebNavigation)` gives us
// access to the webNav methods that are already available on the
// windowless browser, but contrary to appearances, they are not the same
// object.
let chromeShell = windowlessBrowser.docShell.QueryInterface(
Ci.nsIWebNavigation
);
// forwards its methods to the underlying docShell. That .docShell
// needs `QueryInterface(nsIWebNavigation)` to give us access to the
// webNav methods that are already available on the windowless browser.
let chromeShell = windowlessBrowser.docShell;
chromeShell.QueryInterface(Ci.nsIWebNavigation);
if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
let attrs = chromeShell.getOriginAttributes();
@ -1288,16 +1284,10 @@ class HiddenXULWindow {
chromeShell.setOriginAttributes(attrs);
}
let system = Services.scriptSecurityManager.getSystemPrincipal();
chromeShell.createAboutBlankContentViewer(system, system);
chromeShell.useGlobalHistory = false;
let loadURIOptions = {
triggeringPrincipal: system,
};
chromeShell.loadURI(
"chrome://extensions/content/dummy.xhtml",
loadURIOptions
);
chromeShell.loadURI("chrome://extensions/content/dummy.xhtml", {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
});
await promiseObserved(
"chrome-document-global-created",