diff --git a/browser/actors/AboutProtectionsParent.jsm b/browser/actors/AboutProtectionsParent.jsm index 105aa7278163..ee5b89a0bcfb 100644 --- a/browser/actors/AboutProtectionsParent.jsm +++ b/browser/actors/AboutProtectionsParent.jsm @@ -11,6 +11,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { BrowserUtils: "resource://gre/modules/BrowserUtils.jsm", FXA_PWDMGR_HOST: "resource://gre/modules/FxAccountsCommon.js", @@ -19,7 +23,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { LoginBreaches: "resource:///modules/LoginBreaches.jsm", LoginHelper: "resource://gre/modules/LoginHelper.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", - Region: "resource://gre/modules/Region.jsm", }); XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { diff --git a/browser/components/doh/DoHConfig.jsm b/browser/components/doh/DoHConfig.jsm index 62cde6aa57a9..27553bd29887 100644 --- a/browser/components/doh/DoHConfig.jsm +++ b/browser/components/doh/DoHConfig.jsm @@ -21,9 +21,12 @@ const { RemoteSettings } = ChromeUtils.import( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { Preferences: "resource://gre/modules/Preferences.jsm", - Region: "resource://gre/modules/Region.jsm", }); const kGlobalPrefBranch = "doh-rollout"; diff --git a/browser/components/doh/test/browser/head.js b/browser/components/doh/test/browser/head.js index 46eeca5472d2..d01ad8f237a9 100644 --- a/browser/components/doh/test/browser/head.js +++ b/browser/components/doh/test/browser/head.js @@ -1,12 +1,15 @@ "use strict"; +ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(this, { ASRouter: "resource://activity-stream/lib/ASRouter.jsm", DoHController: "resource:///modules/DoHController.jsm", DoHConfigController: "resource:///modules/DoHConfig.jsm", DoHTestUtils: "resource://testing-common/DoHTestUtils.jsm", Preferences: "resource://gre/modules/Preferences.jsm", - Region: "resource://gre/modules/Region.jsm", RegionTestUtils: "resource://testing-common/RegionTestUtils.jsm", RemoteSettings: "resource://services-settings/remote-settings.js", }); diff --git a/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm b/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm index 27ab7bbcd04f..d0bcba825aac 100644 --- a/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm +++ b/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm @@ -12,6 +12,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.jsm", BrowserUtils: "resource://gre/modules/BrowserUtils.jsm", @@ -25,7 +29,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { AboutWelcomeDefaults: "resource://activity-stream/aboutwelcome/lib/AboutWelcomeDefaults.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", - Region: "resource://gre/modules/Region.jsm", ShellService: "resource:///modules/ShellService.jsm", LangPackMatcher: "resource://gre/modules/LangPackMatcher.jsm", }); diff --git a/browser/components/newtab/lib/ASRouterTargeting.jsm b/browser/components/newtab/lib/ASRouterTargeting.jsm index e8a9f779f5dc..c7164898b9d0 100644 --- a/browser/components/newtab/lib/ASRouterTargeting.jsm +++ b/browser/components/newtab/lib/ASRouterTargeting.jsm @@ -21,6 +21,10 @@ const { ShellService } = ChromeUtils.import( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { ASRouterPreferences: "resource://activity-stream/lib/ASRouterPreferences.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm", @@ -29,7 +33,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm", AttributionCode: "resource:///modules/AttributionCode.jsm", TargetingContext: "resource://messaging-system/targeting/Targeting.jsm", - Region: "resource://gre/modules/Region.jsm", TelemetrySession: "resource://gre/modules/TelemetrySession.jsm", HomePage: "resource:///modules/HomePage.jsm", AboutNewTab: "resource:///modules/AboutNewTab.jsm", diff --git a/browser/components/newtab/lib/ActivityStream.jsm b/browser/components/newtab/lib/ActivityStream.jsm index 11be3d924c8d..9d3b02cbdb53 100644 --- a/browser/components/newtab/lib/ActivityStream.jsm +++ b/browser/components/newtab/lib/ActivityStream.jsm @@ -15,11 +15,9 @@ ChromeUtils.defineModuleGetter( "resource://activity-stream/lib/DefaultSites.jsm" ); -ChromeUtils.defineModuleGetter( - lazy, - "Region", - "resource://gre/modules/Region.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); // NB: Eagerly load modules that will be loaded/constructed/initialized in the // common case to avoid the overhead of wrapping and detecting lazy loading. diff --git a/browser/components/newtab/lib/DiscoveryStreamFeed.jsm b/browser/components/newtab/lib/DiscoveryStreamFeed.jsm index 34fbb374e431..45fa2b0938a0 100644 --- a/browser/components/newtab/lib/DiscoveryStreamFeed.jsm +++ b/browser/components/newtab/lib/DiscoveryStreamFeed.jsm @@ -25,11 +25,9 @@ const { setTimeout, clearTimeout } = ChromeUtils.import( const { actionTypes: at, actionCreators: ac } = ChromeUtils.import( "resource://activity-stream/common/Actions.jsm" ); -ChromeUtils.defineModuleGetter( - lazy, - "Region", - "resource://gre/modules/Region.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); ChromeUtils.defineModuleGetter( lazy, "PersistentCache", diff --git a/browser/components/newtab/lib/PrefsFeed.jsm b/browser/components/newtab/lib/PrefsFeed.jsm index 96bb87904d35..8b1f893cb136 100644 --- a/browser/components/newtab/lib/PrefsFeed.jsm +++ b/browser/components/newtab/lib/PrefsFeed.jsm @@ -18,10 +18,13 @@ const { AppConstants } = ChromeUtils.import( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", - Region: "resource://gre/modules/Region.jsm", }); class PrefsFeed { diff --git a/browser/components/newtab/lib/TopSitesFeed.jsm b/browser/components/newtab/lib/TopSitesFeed.jsm index bfff1c80927f..7c78dd41759d 100644 --- a/browser/components/newtab/lib/TopSitesFeed.jsm +++ b/browser/components/newtab/lib/TopSitesFeed.jsm @@ -67,11 +67,9 @@ ChromeUtils.defineModuleGetter( "RemoteSettings", "resource://services-settings/remote-settings.js" ); -ChromeUtils.defineModuleGetter( - lazy, - "Region", - "resource://gre/modules/Region.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); XPCOMUtils.defineLazyGetter(lazy, "log", () => { const { Logger } = ChromeUtils.import( diff --git a/browser/components/newtab/test/browser/browser_asrouter_targeting.js b/browser/components/newtab/test/browser/browser_asrouter_targeting.js index b8f738d42e1f..c36f64c4e09b 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_targeting.js +++ b/browser/components/newtab/test/browser/browser_asrouter_targeting.js @@ -32,6 +32,7 @@ ChromeUtils.defineModuleGetter( ); ChromeUtils.defineESModuleGetters(this, { PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", + Region: "resource://gre/modules/Region.sys.mjs", }); ChromeUtils.defineModuleGetter( this, @@ -41,11 +42,6 @@ ChromeUtils.defineModuleGetter( const { AppConstants } = ChromeUtils.import( "resource://gre/modules/AppConstants.jsm" ); -ChromeUtils.defineModuleGetter( - this, - "Region", - "resource://gre/modules/Region.jsm" -); ChromeUtils.defineModuleGetter( this, "HomePage", diff --git a/browser/components/preferences/tests/browser_moreFromMozilla_locales.js b/browser/components/preferences/tests/browser_moreFromMozilla_locales.js index 00d05125ad7d..7796295cf5d8 100644 --- a/browser/components/preferences/tests/browser_moreFromMozilla_locales.js +++ b/browser/components/preferences/tests/browser_moreFromMozilla_locales.js @@ -7,7 +7,9 @@ const { EnterprisePolicyTesting } = ChromeUtils.importESModule( "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); -let { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +let { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const initialHomeRegion = Region._home; const initialCurrentRegion = Region._current; diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_focus_promo.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_focus_promo.js index 4c1e18d75b1f..2400d1a044d1 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_focus_promo.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_focus_promo.js @@ -1,4 +1,6 @@ -const { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +const { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const { ASRouter } = ChromeUtils.import( "resource://activity-stream/lib/ASRouter.jsm" ); diff --git a/browser/components/protections/test/browser/browser_protections_proxy.js b/browser/components/protections/test/browser/browser_protections_proxy.js index ea655351b0bc..5db6c05d5c84 100644 --- a/browser/components/protections/test/browser/browser_protections_proxy.js +++ b/browser/components/protections/test/browser/browser_protections_proxy.js @@ -4,8 +4,8 @@ "use strict"; -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", +ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", }); add_setup(async function() { diff --git a/browser/components/protections/test/browser/browser_protections_vpn.js b/browser/components/protections/test/browser/browser_protections_vpn.js index 533def85bfbc..7751b5963927 100644 --- a/browser/components/protections/test/browser/browser_protections_vpn.js +++ b/browser/components/protections/test/browser/browser_protections_vpn.js @@ -8,7 +8,9 @@ const { AboutProtectionsParent } = ChromeUtils.import( "resource:///actors/AboutProtectionsParent.jsm" ); -let { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +let { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const initialHomeRegion = Region._home; const initialCurrentRegion = Region._current; diff --git a/browser/components/protections/test/browser/head.js b/browser/components/protections/test/browser/head.js index 4b3e1630b876..9815869ee5d5 100644 --- a/browser/components/protections/test/browser/head.js +++ b/browser/components/protections/test/browser/head.js @@ -12,8 +12,8 @@ const nsLoginInfo = new Components.Constructor( "init" ); -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", +ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", }); const { SearchTestUtils } = ChromeUtils.importESModule( diff --git a/browser/components/urlbar/UrlbarPrefs.sys.mjs b/browser/components/urlbar/UrlbarPrefs.sys.mjs index 0ba3eb26ca47..a697dabbf6f4 100644 --- a/browser/components/urlbar/UrlbarPrefs.sys.mjs +++ b/browser/components/urlbar/UrlbarPrefs.sys.mjs @@ -15,12 +15,12 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", - Region: "resource://gre/modules/Region.jsm", }); const PREF_URLBAR_BRANCH = "browser.urlbar."; diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_offlineDefault.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_offlineDefault.js index 9d702b55531f..a26659e14b3d 100644 --- a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_offlineDefault.js +++ b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_offlineDefault.js @@ -7,8 +7,8 @@ "use strict"; -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", +ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", }); // All the prefs that `updateFirefoxSuggestScenario` sets along with the diff --git a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js index e4229a8fbe83..555de50154de 100644 --- a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js +++ b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js @@ -4,8 +4,8 @@ const { FormAutofillUtils } = ChromeUtils.import( "resource://autofill/FormAutofillUtils.jsm" ); -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", +ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", }); requestLongerTimeout(6); diff --git a/browser/modules/HomePage.jsm b/browser/modules/HomePage.jsm index fd2a463c9e8c..f2c77a0300a2 100644 --- a/browser/modules/HomePage.jsm +++ b/browser/modules/HomePage.jsm @@ -12,12 +12,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { CustomizableUI: "resource:///modules/CustomizableUI.jsm", ExtensionParent: "resource://gre/modules/ExtensionParent.jsm", ExtensionPreferencesManager: "resource://gre/modules/ExtensionPreferencesManager.jsm", - IgnoreLists: "resource://gre/modules/IgnoreLists.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", }); diff --git a/browser/modules/PartnerLinkAttribution.jsm b/browser/modules/PartnerLinkAttribution.jsm index e3092765ad46..b2fd8a7bdb21 100644 --- a/browser/modules/PartnerLinkAttribution.jsm +++ b/browser/modules/PartnerLinkAttribution.jsm @@ -15,8 +15,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { - Region: "resource://gre/modules/Region.jsm", PingCentre: "resource:///modules/PingCentre.jsm", }); diff --git a/browser/modules/test/browser/browser_PartnerLinkAttribution.js b/browser/modules/test/browser/browser_PartnerLinkAttribution.js index 538b6b1c8c12..f84f040ab59c 100644 --- a/browser/modules/test/browser/browser_PartnerLinkAttribution.js +++ b/browser/modules/test/browser/browser_PartnerLinkAttribution.js @@ -17,6 +17,7 @@ const SUGGESTION_ENGINE_NAME = "browser_UsageTelemetry usageTelemetrySearchSuggestions.xml"; ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs", UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", }); @@ -24,7 +25,6 @@ ChromeUtils.defineESModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, { CustomizableUITestUtils: "resource://testing-common/CustomizableUITestUtils.jsm", - Region: "resource://gre/modules/Region.jsm", HttpServer: "resource://testing-common/httpd.js", }); diff --git a/toolkit/components/formautofill/FormAutofill.jsm b/toolkit/components/formautofill/FormAutofill.jsm index bf819e77238b..fab204063e73 100644 --- a/toolkit/components/formautofill/FormAutofill.jsm +++ b/toolkit/components/formautofill/FormAutofill.jsm @@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - Region: "resource://gre/modules/Region.jsm", +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", }); const ADDRESSES_FIRST_TIME_USE_PREF = "extensions.formautofill.firstTimeUse"; diff --git a/toolkit/components/search/SearchEngine.sys.mjs b/toolkit/components/search/SearchEngine.sys.mjs index bda05957afa7..dce8612c536f 100644 --- a/toolkit/components/search/SearchEngine.sys.mjs +++ b/toolkit/components/search/SearchEngine.sys.mjs @@ -13,11 +13,11 @@ const { AppConstants } = ChromeUtils.import( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - Region: "resource://gre/modules/Region.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", }); diff --git a/toolkit/components/search/SearchService.sys.mjs b/toolkit/components/search/SearchService.sys.mjs index acd3793fa9f2..2e5baa5f1431 100644 --- a/toolkit/components/search/SearchService.sys.mjs +++ b/toolkit/components/search/SearchService.sys.mjs @@ -17,8 +17,10 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddonSearchEngine: "resource://gre/modules/AddonSearchEngine.sys.mjs", + IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs", OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs", PolicySearchEngine: "resource://gre/modules/PolicySearchEngine.sys.mjs", + Region: "resource://gre/modules/Region.sys.mjs", SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs", @@ -29,8 +31,6 @@ ChromeUtils.defineESModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.jsm", - IgnoreLists: "resource://gre/modules/IgnoreLists.jsm", - Region: "resource://gre/modules/Region.jsm", RemoteSettings: "resource://services-settings/remote-settings.js", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", }); diff --git a/toolkit/components/search/tests/xpcshell/head_search.js b/toolkit/components/search/tests/xpcshell/head_search.js index e7832e842685..4e5b54e3a83b 100644 --- a/toolkit/components/search/tests/xpcshell/head_search.js +++ b/toolkit/components/search/tests/xpcshell/head_search.js @@ -6,6 +6,7 @@ const { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchService: "resource://gre/modules/SearchService.sys.mjs", SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs", @@ -17,7 +18,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { clearTimeout: "resource://gre/modules/Timer.jsm", FileUtils: "resource://gre/modules/FileUtils.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", - Region: "resource://gre/modules/Region.jsm", RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", setTimeout: "resource://gre/modules/Timer.jsm", diff --git a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js index 97254e0ccacf..889514ca1186 100644 --- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js +++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js @@ -11,6 +11,7 @@ const { AppConstants } = ChromeUtils.import( ); ChromeUtils.defineESModuleGetters(this, { + Region: "resource://gre/modules/Region.sys.mjs", SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs", @@ -21,7 +22,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { AddonManager: "resource://gre/modules/AddonManager.jsm", AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", - Region: "resource://gre/modules/Region.jsm", RemoteSettings: "resource://services-settings/remote-settings.js", sinon: "resource://testing-common/Sinon.jsm", }); diff --git a/toolkit/components/urlformatter/URLFormatter.jsm b/toolkit/components/urlformatter/URLFormatter.jsm index 0d7c3fecf81c..036a5a2ec0b2 100644 --- a/toolkit/components/urlformatter/URLFormatter.jsm +++ b/toolkit/components/urlformatter/URLFormatter.jsm @@ -31,11 +31,9 @@ ChromeUtils.defineModuleGetter( "resource://gre/modules/UpdateUtils.jsm" ); -ChromeUtils.defineModuleGetter( - lazy, - "Region", - "resource://gre/modules/Region.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); function nsURLFormatterService() { XPCOMUtils.defineLazyGetter(this, "ABI", function UFS_ABI() { diff --git a/toolkit/modules/BrowserUtils.jsm b/toolkit/modules/BrowserUtils.jsm index e532d6140b5b..7d308df2031d 100644 --- a/toolkit/modules/BrowserUtils.jsm +++ b/toolkit/modules/BrowserUtils.jsm @@ -14,11 +14,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "Region", - "resource://gre/modules/Region.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Region: "resource://gre/modules/Region.sys.mjs", +}); XPCOMUtils.defineLazyPreferenceGetter( lazy, diff --git a/toolkit/modules/IgnoreLists.jsm b/toolkit/modules/IgnoreLists.sys.mjs similarity index 93% rename from toolkit/modules/IgnoreLists.jsm rename to toolkit/modules/IgnoreLists.sys.mjs index 37a60043aebb..8c4f32ee9c71 100644 --- a/toolkit/modules/IgnoreLists.jsm +++ b/toolkit/modules/IgnoreLists.sys.mjs @@ -3,9 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; @@ -14,8 +12,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", }); -var EXPORTED_SYMBOLS = ["IgnoreLists"]; - const SETTINGS_IGNORELIST_KEY = "hijack-blocklists"; class IgnoreListsManager { @@ -95,4 +91,4 @@ class IgnoreListsManager { } } -const IgnoreLists = new IgnoreListsManager(); +export const IgnoreLists = new IgnoreListsManager(); diff --git a/toolkit/modules/Region.jsm b/toolkit/modules/Region.sys.mjs similarity index 99% rename from toolkit/modules/Region.jsm rename to toolkit/modules/Region.sys.mjs index add98d55fd09..34a1f82fed4e 100644 --- a/toolkit/modules/Region.jsm +++ b/toolkit/modules/Region.sys.mjs @@ -4,11 +4,8 @@ "use strict"; -const EXPORTED_SYMBOLS = ["Region"]; +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" ); @@ -874,7 +871,7 @@ class RegionDetector { } } -let Region = new RegionDetector(); +export let Region = new RegionDetector(); Region.init(); // A method that tries to determine if this user is in a US geography. diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index 6a2f84272402..1e3fddd22634 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -177,7 +177,7 @@ EXTRA_JS_MODULES += [ "Geometry.jsm", "HiddenFrame.jsm", "Http.jsm", - "IgnoreLists.jsm", + "IgnoreLists.sys.mjs", "IndexedDB.jsm", "InlineSpellChecker.jsm", "InlineSpellCheckerContent.jsm", @@ -199,7 +199,7 @@ EXTRA_JS_MODULES += [ "ProcessType.jsm", "ProfileAge.jsm", "PromiseUtils.jsm", - "Region.jsm", + "Region.sys.mjs", "RemotePageAccessManager.jsm", "ResetProfile.jsm", "ResponsivenessMonitor.jsm", diff --git a/toolkit/modules/tests/xpcshell/test_BrowserUtils.js b/toolkit/modules/tests/xpcshell/test_BrowserUtils.js index d58d341520c1..561e27fa10c3 100644 --- a/toolkit/modules/tests/xpcshell/test_BrowserUtils.js +++ b/toolkit/modules/tests/xpcshell/test_BrowserUtils.js @@ -13,7 +13,9 @@ const { EnterprisePolicyTesting } = ChromeUtils.importESModule( "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); -const { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +const { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const { updateAppInfo } = ChromeUtils.import( "resource://testing-common/AppInfo.jsm" diff --git a/toolkit/modules/tests/xpcshell/test_IgnoreList.js b/toolkit/modules/tests/xpcshell/test_IgnoreList.js index 15d64fc61cbb..0bb9e902233e 100644 --- a/toolkit/modules/tests/xpcshell/test_IgnoreList.js +++ b/toolkit/modules/tests/xpcshell/test_IgnoreList.js @@ -3,8 +3,11 @@ "use strict"; +ChromeUtils.defineESModuleGetters(this, { + IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(this, { - IgnoreLists: "resource://gre/modules/IgnoreLists.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", diff --git a/toolkit/modules/tests/xpcshell/test_Region.js b/toolkit/modules/tests/xpcshell/test_Region.js index 9234c6ec7332..f3bccadfa376 100644 --- a/toolkit/modules/tests/xpcshell/test_Region.js +++ b/toolkit/modules/tests/xpcshell/test_Region.js @@ -4,7 +4,9 @@ const { AppConstants } = ChromeUtils.import( "resource://gre/modules/AppConstants.jsm" ); const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js"); -const { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +const { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm"); const { TestUtils } = ChromeUtils.import( "resource://testing-common/TestUtils.jsm" diff --git a/toolkit/modules/tests/xpcshell/test_Region_geocoding.js b/toolkit/modules/tests/xpcshell/test_Region_geocoding.js index d2bdad059d4d..f44663fd74f0 100644 --- a/toolkit/modules/tests/xpcshell/test_Region_geocoding.js +++ b/toolkit/modules/tests/xpcshell/test_Region_geocoding.js @@ -1,6 +1,8 @@ "use strict"; -const { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); +const { Region } = ChromeUtils.importESModule( + "resource://gre/modules/Region.sys.mjs" +); const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm"); const { TestUtils } = ChromeUtils.import( "resource://testing-common/TestUtils.jsm"