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