Bug 1317101 - Part 7d: Load moz-extension: URLs remotely based on a pref. r?billm
MozReview-Commit-ID: Kxt9mDMdPQk
--- a/browser/modules/E10SUtils.jsm
+++ b/browser/modules/E10SUtils.jsm
@@ -4,16 +4,20 @@
"use strict";
this.EXPORTED_SYMBOLS = ["E10SUtils"];
const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+
+XPCOMUtils.defineLazyPreferenceGetter(this, "useRemoteWebExtensions",
+ "extensions.webextensions.outOfProcess", false);
function getAboutModule(aURL) {
// Needs to match NS_GetAboutModuleName
let moduleName = aURL.path.replace(/[#?].*/, "").toLowerCase();
let contract = "@mozilla.org/network/protocol/about;1?what=" + moduleName;
try {
return Cc[contract].getService(Ci.nsIAboutModule);
}
@@ -65,18 +69,18 @@ this.E10SUtils = {
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
getService(Ci.nsIXULChromeRegistry);
canLoadRemote = chromeReg.canLoadURLRemotely(url);
mustLoadRemote = chromeReg.mustLoadURLRemotely(url);
}
}
if (aURL.startsWith("moz-extension:")) {
- canLoadRemote = false;
- mustLoadRemote = false;
+ canLoadRemote = useRemoteWebExtensions;
+ mustLoadRemote = useRemoteWebExtensions;
}
if (aURL.startsWith("view-source:")) {
return this.canLoadURIInProcess(aURL.substr("view-source:".length), aProcess);
}
if (mustLoadRemote)
return processIsRemote;