fune/browser/base/content/tab-content.js
Razvan Maries 10425eddfc Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00

77 lines
1.9 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* This content script contains code that requires a tab browser. */
/* eslint-env mozilla/frame-script */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(
this,
"E10SUtils",
"resource://gre/modules/E10SUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm"
);
// BrowserChildGlobal
var global = this;
var WebBrowserChrome = {
onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
return BrowserUtils.onBeforeLinkTraversal(
originalTarget,
linkURI,
linkNode,
isAppTab
);
},
// Check whether this URI should load in the current process
shouldLoadURI(
aDocShell,
aURI,
aReferrerInfo,
aHasPostData,
aTriggeringPrincipal,
aCsp
) {
if (!E10SUtils.shouldLoadURI(aDocShell, aURI, aHasPostData)) {
E10SUtils.redirectLoad(
aDocShell,
aURI,
aReferrerInfo,
aTriggeringPrincipal,
null,
aCsp
);
return false;
}
return true;
},
shouldLoadURIInThisProcess(aURI) {
let remoteSubframes = docShell.QueryInterface(Ci.nsILoadContext)
.useRemoteSubframes;
return E10SUtils.shouldLoadURIInThisProcess(aURI, remoteSubframes);
},
};
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
let tabchild = docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIBrowserChild);
tabchild.webBrowserChrome = WebBrowserChrome;
}
Services.obs.notifyObservers(this, "tab-content-frameloader-created");
// This is a temporary hack to prevent regressions (bug 1471327).
void content;