Bug 1510579 - Load scripts in global-scripts.inc the same way browser.xul does. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D13237
This commit is contained in:
@@ -18,15 +18,12 @@ xmlns="http://www.w3.org/1999/xhtml"
|
|||||||
>
|
>
|
||||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
for (let script of [
|
Services.scriptloader.loadSubScript("chrome://browser/content/browser.js", this);
|
||||||
"chrome://browser/content/browser.js",
|
Services.scriptloader.loadSubScript("chrome://browser/content/browser-places.js", this);
|
||||||
"chrome://browser/content/browser-places.js",
|
Services.scriptloader.loadSubScript("chrome://global/content/globalOverlay.js", this);
|
||||||
"chrome://global/content/globalOverlay.js",
|
Services.scriptloader.loadSubScript("chrome://browser/content/utilityOverlay.js", this);
|
||||||
"chrome://browser/content/utilityOverlay.js",
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
"chrome://global/content/macWindowMenu.js",
|
Services.scriptloader.loadSubScript("chrome://global/content/macWindowMenu.js", this);
|
||||||
#endif
|
#endif
|
||||||
]) {
|
|
||||||
Services.scriptloader.loadSubScript(script, this);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const MAPPINGS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const globalScriptsRegExp =
|
const globalScriptsRegExp =
|
||||||
/^\s*(?:Services.scriptloader.loadSubScript\(\"(.*?)\", this\);|"(.*?\.js)",)$/;
|
/^\s*Services.scriptloader.loadSubScript\(\"(.*?)\", this\);$/;
|
||||||
|
|
||||||
function getGlobalScriptIncludes(scriptPath) {
|
function getGlobalScriptIncludes(scriptPath) {
|
||||||
let fileData;
|
let fileData;
|
||||||
@@ -69,7 +69,7 @@ function getGlobalScriptIncludes(scriptPath) {
|
|||||||
for (let line of fileData) {
|
for (let line of fileData) {
|
||||||
let match = line.match(globalScriptsRegExp);
|
let match = line.match(globalScriptsRegExp);
|
||||||
if (match) {
|
if (match) {
|
||||||
let sourceFile = (match[1] || match[2])
|
let sourceFile = match[1]
|
||||||
.replace("chrome://browser/content/search/", "browser/components/search/content/")
|
.replace("chrome://browser/content/search/", "browser/components/search/content/")
|
||||||
.replace("chrome://browser/content/", "browser/base/content/")
|
.replace("chrome://browser/content/", "browser/base/content/")
|
||||||
.replace("chrome://global/content/", "toolkit/content/");
|
.replace("chrome://global/content/", "toolkit/content/");
|
||||||
|
|||||||
Reference in New Issue
Block a user