diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 4b8d3257036f..33c5c3acb356 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -708,7 +708,7 @@ var AddonManagerInternal = { CATEGORY_PROVIDER_MODULE )) { try { - ChromeUtils.import(url); + ChromeUtils.importESModule(url); logger.debug(`Loaded provider scope for ${url}`); } catch (e) { AddonManagerPrivate.recordException( diff --git a/toolkit/mozapps/extensions/Blocklist.jsm b/toolkit/mozapps/extensions/Blocklist.jsm index 630413162365..bab95038a346 100644 --- a/toolkit/mozapps/extensions/Blocklist.jsm +++ b/toolkit/mozapps/extensions/Blocklist.jsm @@ -89,7 +89,7 @@ const kRegExpRemovalRegExp = /^\/\^\(\(?|\\|\)\)?\$\/$/g; // providers that differ from the existing types. XPCOMUtils.defineLazyGetter(lazy, "kXPIAddonTypes", () => { // In practice, this result is equivalent to ALL_XPI_TYPES in XPIProvider.jsm. - // "plugin" (from GMPProvider.jsm) is intentionally omitted, as we decided to + // "plugin" (from GMPProvider.sys.mjs) is intentionally omitted, as we decided to // not support blocklisting of GMP plugins in bug 1086668. return lazy.AddonManagerPrivate.getAddonTypesByProvider("XPIProvider"); }); diff --git a/toolkit/mozapps/extensions/extensions.manifest b/toolkit/mozapps/extensions/extensions.manifest index 7ece67529a35..f0ec991030f3 100644 --- a/toolkit/mozapps/extensions/extensions.manifest +++ b/toolkit/mozapps/extensions/extensions.manifest @@ -3,6 +3,6 @@ category update-timer addonManager @mozilla.org/addons/integration;1,getService, #endif #ifndef MOZ_THUNDERBIRD #ifndef MOZ_WIDGET_ANDROID -category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm +category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.sys.mjs #endif #endif diff --git a/toolkit/mozapps/extensions/internal/GMPProvider.jsm b/toolkit/mozapps/extensions/internal/GMPProvider.sys.mjs similarity index 99% rename from toolkit/mozapps/extensions/internal/GMPProvider.jsm rename to toolkit/mozapps/extensions/internal/GMPProvider.sys.mjs index 56074268ea1b..ed87f38f60f2 100644 --- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm +++ b/toolkit/mozapps/extensions/internal/GMPProvider.sys.mjs @@ -4,11 +4,8 @@ "use strict"; -var EXPORTED_SYMBOLS = ["GMPTestUtils"]; +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); const { AppConstants } = ChromeUtils.import( "resource://gre/modules/AppConstants.jsm" ); @@ -880,7 +877,7 @@ var GMPProvider = { GMPProvider.addObserver(); // For test use only. -const GMPTestUtils = { +export const GMPTestUtils = { /** * Used to override the GMP service with a mock. * diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build index 6d34f51c35f8..6586d7327e3c 100644 --- a/toolkit/mozapps/extensions/internal/moz.build +++ b/toolkit/mozapps/extensions/internal/moz.build @@ -16,7 +16,7 @@ EXTRA_JS_MODULES.addons += [ if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android": EXTRA_JS_MODULES.addons += [ - "GMPProvider.jsm", + "GMPProvider.sys.mjs", ] TESTING_JS_MODULES += [ diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js b/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js index 3ee5eb216477..afd11c4f9d35 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js @@ -3,8 +3,8 @@ "use strict"; -const { GMPTestUtils } = ChromeUtils.import( - "resource://gre/modules/addons/GMPProvider.jsm" +const { GMPTestUtils } = ChromeUtils.importESModule( + "resource://gre/modules/addons/GMPProvider.sys.mjs" ); const { GMPInstallManager } = ChromeUtils.import( "resource://gre/modules/GMPInstallManager.jsm"