summaryrefslogtreecommitdiff
path: root/legacy/BootstrapLoader.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/BootstrapLoader.sys.mjs')
-rw-r--r--legacy/BootstrapLoader.sys.mjs19
1 files changed, 8 insertions, 11 deletions
diff --git a/legacy/BootstrapLoader.sys.mjs b/legacy/BootstrapLoader.sys.mjs
index 80fc61d..d28bf22 100644
--- a/legacy/BootstrapLoader.sys.mjs
+++ b/legacy/BootstrapLoader.sys.mjs
@@ -1,19 +1,18 @@
/* 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/. */
-
+var BootstrapLoader = (function() {
"use strict";
var EXPORTED_SYMBOLS = ["BootstrapLoader"];
-import {AddonManager} from "resource://gre/modules/AddonManager.sys.mjs";
-import {AddonInternal} from "resource://gre/modules/addons/XPIDatabase.sys.mjs";
-import {InstallRDF} from "resource://legacy/RDFManifestConverter.sys.mjs";
-import {XPIProvider} from "resource://gre/modules/addons/XPIProvider.sys.mjs";
+let {AddonManager} = ChromeUtils.importESModule("resource://gre/modules/AddonManager.sys.mjs");
+let {AddonInternal} = ChromeUtils.importESModule("resource://gre/modules/addons/XPIDatabase.sys.mjs");
+let {XPIProvider} = ChromeUtils.importESModule("resource://gre/modules/addons/XPIProvider.sys.mjs");
const BOOTSTRAP_REASONS = XPIProvider.BOOTSTRAP_REASONS;
-var logger = console.createInstance({ prefix: "addons.bootstrap" });
+var logger = console;
/**
* Valid IDs fit this pattern.
@@ -92,7 +91,7 @@ function buildJarURI(aJarfile, aPath) {
return Services.io.newURI(uri);
}
-export var BootstrapLoader = {
+return BootstrapLoader = {
name: "bootstrap",
manifestFile: "install.rdf",
async loadManifest(pkg) {
@@ -294,14 +293,12 @@ export var BootstrapLoader = {
addonId: addon.id,
wantGlobalProperties: ["ChromeUtils"],
metadata: { addonID: addon.id, URI: uri },
+ console,
});
try {
Object.assign(sandbox, BOOTSTRAP_REASONS);
- ChromeUtils.defineLazyGetter(sandbox, "console", () =>
- console.createInstance({ consoleID: `addon/${addon.id}` }));
-
Services.scriptloader.loadSubScript(uri, sandbox);
} catch (e) {
logger.warn(`Error loading bootstrap.js for ${addon.id}`, e);
@@ -359,4 +356,4 @@ export var BootstrapLoader = {
};
},
};
-
+})()