diff options
author | girst <girst@users.noreply.github.com> | 2024-02-01 21:17:50 +0100 |
---|---|---|
committer | girst <girst@users.noreply.github.com> | 2024-02-01 21:17:50 +0100 |
commit | 49c27725d7d4e98e474b6b7d0a324400255b0f34 (patch) | |
tree | d5352437ecad8d11ae2a63db048824e8177f7eeb /legacy/BootstrapLoader.jsm | |
parent | fc77a6afa82b058faf12411af45aee62d32450e6 (diff) | |
download | legacywolf-49c27725d7d4e98e474b6b7d0a324400255b0f34.tar.gz legacywolf-49c27725d7d4e98e474b6b7d0a324400255b0f34.zip |
remove use of deprecated components
console.createInstance() is available since firefox59 (Bug 1425574), so
no workaround needed. ChromeUtils.defineLazyGetter() however only is
since firefox112 (Bug 1805288) but the backwards-compatible code is tiny
see also:
https://bugzilla.mozilla.org/show_bug.cgi?id=1875216
https://bugzilla.mozilla.org/show_bug.cgi?id=1430810
https://bugzilla.mozilla.org/show_bug.cgi?id=1828156
https://groups.google.com/a/mozilla.org/g/dev-platform/c/BdyWnTjLSXg
Diffstat (limited to 'legacy/BootstrapLoader.jsm')
-rw-r--r-- | legacy/BootstrapLoader.jsm | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/legacy/BootstrapLoader.jsm b/legacy/BootstrapLoader.jsm index e2a693d..ff52e80 100644 --- a/legacy/BootstrapLoader.jsm +++ b/legacy/BootstrapLoader.jsm @@ -12,18 +12,16 @@ const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm") XPCOMUtils.defineLazyModuleGetters(this, { AddonInternal: "resource://gre/modules/addons/XPIDatabase.jsm", Blocklist: "resource://gre/modules/Blocklist.jsm", - ConsoleAPI: "resource://gre/modules/Console.jsm", InstallRDF: "resource://legacy/RDFManifestConverter.jsm", }); const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services; -XPCOMUtils.defineLazyGetter(this, "BOOTSTRAP_REASONS", () => { +(ChromeUtils.defineLazyGetter||XPCOMUtils.defineLazyGetter)(this, "BOOTSTRAP_REASONS", () => { const {XPIProvider} = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm"); return XPIProvider.BOOTSTRAP_REASONS; }); -const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm"); -var logger = Log.repository.getLogger("addons.bootstrap"); +var logger = console.createInstance({ prefix: "addons.bootstrap" }); /** * Valid IDs fit this pattern. @@ -309,8 +307,8 @@ var BootstrapLoader = { try { Object.assign(sandbox, BOOTSTRAP_REASONS); - XPCOMUtils.defineLazyGetter(sandbox, "console", () => - new ConsoleAPI({ consoleID: `addon/${addon.id}` })); + (ChromeUtils.defineLazyGetter||XPCOMUtils.defineLazyGetter)(sandbox, "console", () => + console.createInstance({ consoleID: `addon/${addon.id}` })); Services.scriptloader.loadSubScript(uri, sandbox); } catch (e) { |