diff options
Diffstat (limited to 'legacy')
-rw-r--r-- | legacy/BootstrapLoader.sys.mjs (renamed from legacy/BootstrapLoader.jsm) | 21 | ||||
-rw-r--r-- | legacy/RDFDataSource.sys.mjs (renamed from legacy/RDFDataSource.jsm) | 8 | ||||
-rw-r--r-- | legacy/RDFManifestConverter.sys.mjs (renamed from legacy/RDFManifestConverter.jsm) | 5 |
3 files changed, 10 insertions, 24 deletions
diff --git a/legacy/BootstrapLoader.jsm b/legacy/BootstrapLoader.sys.mjs index a4010b3..80fc61d 100644 --- a/legacy/BootstrapLoader.jsm +++ b/legacy/BootstrapLoader.sys.mjs @@ -6,19 +6,12 @@ var EXPORTED_SYMBOLS = ["BootstrapLoader"]; -const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm"); -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); +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"; -XPCOMUtils.defineLazyModuleGetters(this, { - AddonInternal: "resource://gre/modules/addons/XPIDatabase.jsm", - InstallRDF: "resource://legacy/RDFManifestConverter.jsm", -}); -const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services; - -(ChromeUtils.defineLazyGetter||XPCOMUtils.defineLazyGetter)(this, "BOOTSTRAP_REASONS", () => { - const {XPIProvider} = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm"); - return XPIProvider.BOOTSTRAP_REASONS; -}); +const BOOTSTRAP_REASONS = XPIProvider.BOOTSTRAP_REASONS; var logger = console.createInstance({ prefix: "addons.bootstrap" }); @@ -99,7 +92,7 @@ function buildJarURI(aJarfile, aPath) { return Services.io.newURI(uri); } -var BootstrapLoader = { +export var BootstrapLoader = { name: "bootstrap", manifestFile: "install.rdf", async loadManifest(pkg) { @@ -306,7 +299,7 @@ var BootstrapLoader = { try { Object.assign(sandbox, BOOTSTRAP_REASONS); - (ChromeUtils.defineLazyGetter||XPCOMUtils.defineLazyGetter)(sandbox, "console", () => + ChromeUtils.defineLazyGetter(sandbox, "console", () => console.createInstance({ consoleID: `addon/${addon.id}` })); Services.scriptloader.loadSubScript(uri, sandbox); diff --git a/legacy/RDFDataSource.jsm b/legacy/RDFDataSource.sys.mjs index 579d075..27687ba 100644 --- a/legacy/RDFDataSource.jsm +++ b/legacy/RDFDataSource.sys.mjs @@ -134,12 +134,6 @@ const USE_RDFNS_ATTR = false; var EXPORTED_SYMBOLS = ["RDFLiteral", "RDFIntLiteral", "RDFDateLiteral", "RDFBlankNode", "RDFResource", "RDFDataSource"]; -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); - -XPCOMUtils.defineLazyGlobalGetters(this, ["DOMParser", "Element", "XMLSerializer", "fetch"]); - -const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services; - function isAttr(obj) { return obj && typeof obj == "object" && ChromeUtils.getClassName(obj) == "Attr"; } @@ -1113,7 +1107,7 @@ class RDFBlankNode extends RDFSubject { * changed as assertions are added and removed to the RDF. Pass a null document * to start with an empty graph. */ -class RDFDataSource { +export class RDFDataSource { constructor(document) { // All known resources, indexed on URI this._resources = {}; diff --git a/legacy/RDFManifestConverter.jsm b/legacy/RDFManifestConverter.sys.mjs index cb01f6a..12abd27 100644 --- a/legacy/RDFManifestConverter.jsm +++ b/legacy/RDFManifestConverter.sys.mjs @@ -5,8 +5,7 @@ var EXPORTED_SYMBOLS = ["InstallRDF"]; -ChromeUtils.defineModuleGetter(this, "RDFDataSource", - "resource://legacy/RDFDataSource.jsm"); +import {RDFDataSource} from "resource://legacy/RDFDataSource.sys.mjs"; const RDFURI_INSTALL_MANIFEST_ROOT = "urn:mozilla:install-manifest"; @@ -40,7 +39,7 @@ class Manifest { } } -class InstallRDF extends Manifest { +export class InstallRDF extends Manifest { _readProps(source, obj, props) { for (let prop of props) { let val = getProperty(source, prop); |