Bug 1790758 - Convert Region.jsm and IgnoreLists.jsm JSM modules to ESMs r=Standard8,preferences-reviewers,credential-management-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D157337
This commit is contained in:
Jonathan Sudiaman 2022-09-20 12:21:45 +00:00
Родитель 90bc1261e7
Коммит c27b002b63
35 изменённых файлов: 93 добавлений и 75 удалений

Просмотреть файл

@ -11,6 +11,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm", BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
FXA_PWDMGR_HOST: "resource://gre/modules/FxAccountsCommon.js", FXA_PWDMGR_HOST: "resource://gre/modules/FxAccountsCommon.js",
@ -19,7 +23,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
LoginBreaches: "resource:///modules/LoginBreaches.jsm", LoginBreaches: "resource:///modules/LoginBreaches.jsm",
LoginHelper: "resource://gre/modules/LoginHelper.jsm", LoginHelper: "resource://gre/modules/LoginHelper.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {

Просмотреть файл

@ -21,9 +21,12 @@ const { RemoteSettings } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.jsm", Preferences: "resource://gre/modules/Preferences.jsm",
Region: "resource://gre/modules/Region.jsm",
}); });
const kGlobalPrefBranch = "doh-rollout"; const kGlobalPrefBranch = "doh-rollout";

Просмотреть файл

@ -1,12 +1,15 @@
"use strict"; "use strict";
ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
ASRouter: "resource://activity-stream/lib/ASRouter.jsm", ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
DoHController: "resource:///modules/DoHController.jsm", DoHController: "resource:///modules/DoHController.jsm",
DoHConfigController: "resource:///modules/DoHConfig.jsm", DoHConfigController: "resource:///modules/DoHConfig.jsm",
DoHTestUtils: "resource://testing-common/DoHTestUtils.jsm", DoHTestUtils: "resource://testing-common/DoHTestUtils.jsm",
Preferences: "resource://gre/modules/Preferences.jsm", Preferences: "resource://gre/modules/Preferences.jsm",
Region: "resource://gre/modules/Region.jsm",
RegionTestUtils: "resource://testing-common/RegionTestUtils.jsm", RegionTestUtils: "resource://testing-common/RegionTestUtils.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettings: "resource://services-settings/remote-settings.js",
}); });

Просмотреть файл

@ -12,6 +12,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm", BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
@ -25,7 +29,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
AboutWelcomeDefaults: AboutWelcomeDefaults:
"resource://activity-stream/aboutwelcome/lib/AboutWelcomeDefaults.jsm", "resource://activity-stream/aboutwelcome/lib/AboutWelcomeDefaults.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
ShellService: "resource:///modules/ShellService.jsm", ShellService: "resource:///modules/ShellService.jsm",
LangPackMatcher: "resource://gre/modules/LangPackMatcher.jsm", LangPackMatcher: "resource://gre/modules/LangPackMatcher.jsm",
}); });

Просмотреть файл

@ -21,6 +21,10 @@ const { ShellService } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
ASRouterPreferences: "resource://activity-stream/lib/ASRouterPreferences.jsm", ASRouterPreferences: "resource://activity-stream/lib/ASRouterPreferences.jsm",
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
@ -29,7 +33,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm", TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm",
AttributionCode: "resource:///modules/AttributionCode.jsm", AttributionCode: "resource:///modules/AttributionCode.jsm",
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm", TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
Region: "resource://gre/modules/Region.jsm",
TelemetrySession: "resource://gre/modules/TelemetrySession.jsm", TelemetrySession: "resource://gre/modules/TelemetrySession.jsm",
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
AboutNewTab: "resource:///modules/AboutNewTab.jsm", AboutNewTab: "resource:///modules/AboutNewTab.jsm",

Просмотреть файл

@ -15,11 +15,9 @@ ChromeUtils.defineModuleGetter(
"resource://activity-stream/lib/DefaultSites.jsm" "resource://activity-stream/lib/DefaultSites.jsm"
); );
ChromeUtils.defineModuleGetter( ChromeUtils.defineESModuleGetters(lazy, {
lazy, Region: "resource://gre/modules/Region.sys.mjs",
"Region", });
"resource://gre/modules/Region.jsm"
);
// NB: Eagerly load modules that will be loaded/constructed/initialized in the // NB: Eagerly load modules that will be loaded/constructed/initialized in the
// common case to avoid the overhead of wrapping and detecting lazy loading. // common case to avoid the overhead of wrapping and detecting lazy loading.

Просмотреть файл

@ -25,11 +25,9 @@ const { setTimeout, clearTimeout } = ChromeUtils.import(
const { actionTypes: at, actionCreators: ac } = ChromeUtils.import( const { actionTypes: at, actionCreators: ac } = ChromeUtils.import(
"resource://activity-stream/common/Actions.jsm" "resource://activity-stream/common/Actions.jsm"
); );
ChromeUtils.defineModuleGetter( ChromeUtils.defineESModuleGetters(lazy, {
lazy, Region: "resource://gre/modules/Region.sys.mjs",
"Region", });
"resource://gre/modules/Region.jsm"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,
"PersistentCache", "PersistentCache",

Просмотреть файл

@ -18,10 +18,13 @@ const { AppConstants } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
}); });
class PrefsFeed { class PrefsFeed {

Просмотреть файл

@ -67,11 +67,9 @@ ChromeUtils.defineModuleGetter(
"RemoteSettings", "RemoteSettings",
"resource://services-settings/remote-settings.js" "resource://services-settings/remote-settings.js"
); );
ChromeUtils.defineModuleGetter( ChromeUtils.defineESModuleGetters(lazy, {
lazy, Region: "resource://gre/modules/Region.sys.mjs",
"Region", });
"resource://gre/modules/Region.jsm"
);
XPCOMUtils.defineLazyGetter(lazy, "log", () => { XPCOMUtils.defineLazyGetter(lazy, "log", () => {
const { Logger } = ChromeUtils.import( const { Logger } = ChromeUtils.import(

Просмотреть файл

@ -32,6 +32,7 @@ ChromeUtils.defineModuleGetter(
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
}); });
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
this, this,
@ -41,11 +42,6 @@ ChromeUtils.defineModuleGetter(
const { AppConstants } = ChromeUtils.import( const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm" "resource://gre/modules/AppConstants.jsm"
); );
ChromeUtils.defineModuleGetter(
this,
"Region",
"resource://gre/modules/Region.jsm"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
this, this,
"HomePage", "HomePage",

Просмотреть файл

@ -7,7 +7,9 @@ const { EnterprisePolicyTesting } = ChromeUtils.importESModule(
"resource://testing-common/EnterprisePolicyTesting.sys.mjs" "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 initialHomeRegion = Region._home;
const initialCurrentRegion = Region._current; const initialCurrentRegion = Region._current;

Просмотреть файл

@ -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( const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm" "resource://activity-stream/lib/ASRouter.jsm"
); );

Просмотреть файл

@ -4,8 +4,8 @@
"use strict"; "use strict";
XPCOMUtils.defineLazyModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.jsm", Region: "resource://gre/modules/Region.sys.mjs",
}); });
add_setup(async function() { add_setup(async function() {

Просмотреть файл

@ -8,7 +8,9 @@ const { AboutProtectionsParent } = ChromeUtils.import(
"resource:///actors/AboutProtectionsParent.jsm" "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 initialHomeRegion = Region._home;
const initialCurrentRegion = Region._current; const initialCurrentRegion = Region._current;

Просмотреть файл

@ -12,8 +12,8 @@ const nsLoginInfo = new Components.Constructor(
"init" "init"
); );
XPCOMUtils.defineLazyModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.jsm", Region: "resource://gre/modules/Region.sys.mjs",
}); });
const { SearchTestUtils } = ChromeUtils.importESModule( const { SearchTestUtils } = ChromeUtils.importESModule(

Просмотреть файл

@ -15,12 +15,12 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
Region: "resource://gre/modules/Region.jsm",
}); });
const PREF_URLBAR_BRANCH = "browser.urlbar."; const PREF_URLBAR_BRANCH = "browser.urlbar.";

Просмотреть файл

@ -7,8 +7,8 @@
"use strict"; "use strict";
XPCOMUtils.defineLazyModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.jsm", Region: "resource://gre/modules/Region.sys.mjs",
}); });
// All the prefs that `updateFirefoxSuggestScenario` sets along with the // All the prefs that `updateFirefoxSuggestScenario` sets along with the

Просмотреть файл

@ -4,8 +4,8 @@ const { FormAutofillUtils } = ChromeUtils.import(
"resource://autofill/FormAutofillUtils.jsm" "resource://autofill/FormAutofillUtils.jsm"
); );
XPCOMUtils.defineLazyModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.jsm", Region: "resource://gre/modules/Region.sys.mjs",
}); });
requestLongerTimeout(6); requestLongerTimeout(6);

Просмотреть файл

@ -12,12 +12,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
CustomizableUI: "resource:///modules/CustomizableUI.jsm", CustomizableUI: "resource:///modules/CustomizableUI.jsm",
ExtensionParent: "resource://gre/modules/ExtensionParent.jsm", ExtensionParent: "resource://gre/modules/ExtensionParent.jsm",
ExtensionPreferencesManager: ExtensionPreferencesManager:
"resource://gre/modules/ExtensionPreferencesManager.jsm", "resource://gre/modules/ExtensionPreferencesManager.jsm",
IgnoreLists: "resource://gre/modules/IgnoreLists.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
}); });

Просмотреть файл

@ -15,8 +15,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Region: "resource://gre/modules/Region.jsm",
PingCentre: "resource:///modules/PingCentre.jsm", PingCentre: "resource:///modules/PingCentre.jsm",
}); });

Просмотреть файл

@ -17,6 +17,7 @@ const SUGGESTION_ENGINE_NAME =
"browser_UsageTelemetry usageTelemetrySearchSuggestions.xml"; "browser_UsageTelemetry usageTelemetrySearchSuggestions.xml";
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.sys.mjs",
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs", SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs",
}); });
@ -24,7 +25,6 @@ ChromeUtils.defineESModuleGetters(this, {
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUITestUtils: CustomizableUITestUtils:
"resource://testing-common/CustomizableUITestUtils.jsm", "resource://testing-common/CustomizableUITestUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
HttpServer: "resource://testing-common/httpd.js", HttpServer: "resource://testing-common/httpd.js",
}); });

Просмотреть файл

@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.jsm", Region: "resource://gre/modules/Region.sys.mjs",
}); });
const ADDRESSES_FIRST_TIME_USE_PREF = "extensions.formautofill.firstTimeUse"; const ADDRESSES_FIRST_TIME_USE_PREF = "extensions.formautofill.firstTimeUse";

Просмотреть файл

@ -13,11 +13,11 @@ const { AppConstants } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Region: "resource://gre/modules/Region.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs", SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Region: "resource://gre/modules/Region.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
}); });

Просмотреть файл

@ -17,8 +17,10 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
AddonSearchEngine: "resource://gre/modules/AddonSearchEngine.sys.mjs", AddonSearchEngine: "resource://gre/modules/AddonSearchEngine.sys.mjs",
IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs",
OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs", OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs",
PolicySearchEngine: "resource://gre/modules/PolicySearchEngine.sys.mjs", PolicySearchEngine: "resource://gre/modules/PolicySearchEngine.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs", SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs",
SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs",
SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs", SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs",
@ -29,8 +31,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm", 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", RemoteSettings: "resource://services-settings/remote-settings.js",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
}); });

Просмотреть файл

@ -6,6 +6,7 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.sys.mjs",
SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs",
SearchService: "resource://gre/modules/SearchService.sys.mjs", SearchService: "resource://gre/modules/SearchService.sys.mjs",
SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs", SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs",
@ -17,7 +18,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
clearTimeout: "resource://gre/modules/Timer.jsm", clearTimeout: "resource://gre/modules/Timer.jsm",
FileUtils: "resource://gre/modules/FileUtils.jsm", FileUtils: "resource://gre/modules/FileUtils.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
setTimeout: "resource://gre/modules/Timer.jsm", setTimeout: "resource://gre/modules/Timer.jsm",

Просмотреть файл

@ -11,6 +11,7 @@ const { AppConstants } = ChromeUtils.import(
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
Region: "resource://gre/modules/Region.sys.mjs",
SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs", SearchEngine: "resource://gre/modules/SearchEngine.sys.mjs",
SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs", SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.sys.mjs",
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs", SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
@ -21,7 +22,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm", AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm", sinon: "resource://testing-common/Sinon.jsm",
}); });

Просмотреть файл

@ -31,11 +31,9 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/UpdateUtils.jsm" "resource://gre/modules/UpdateUtils.jsm"
); );
ChromeUtils.defineModuleGetter( ChromeUtils.defineESModuleGetters(lazy, {
lazy, Region: "resource://gre/modules/Region.sys.mjs",
"Region", });
"resource://gre/modules/Region.jsm"
);
function nsURLFormatterService() { function nsURLFormatterService() {
XPCOMUtils.defineLazyGetter(this, "ABI", function UFS_ABI() { XPCOMUtils.defineLazyGetter(this, "ABI", function UFS_ABI() {

Просмотреть файл

@ -14,11 +14,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs" "resource://gre/modules/XPCOMUtils.sys.mjs"
); );
const lazy = {}; const lazy = {};
ChromeUtils.defineModuleGetter( ChromeUtils.defineESModuleGetters(lazy, {
lazy, Region: "resource://gre/modules/Region.sys.mjs",
"Region", });
"resource://gre/modules/Region.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,

Просмотреть файл

@ -3,9 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const { XPCOMUtils } = ChromeUtils.importESModule( import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -14,8 +12,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
}); });
var EXPORTED_SYMBOLS = ["IgnoreLists"];
const SETTINGS_IGNORELIST_KEY = "hijack-blocklists"; const SETTINGS_IGNORELIST_KEY = "hijack-blocklists";
class IgnoreListsManager { class IgnoreListsManager {
@ -95,4 +91,4 @@ class IgnoreListsManager {
} }
} }
const IgnoreLists = new IgnoreListsManager(); export const IgnoreLists = new IgnoreListsManager();

Просмотреть файл

@ -4,11 +4,8 @@
"use strict"; "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( const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm" "resource://gre/modules/AppConstants.jsm"
); );
@ -874,7 +871,7 @@ class RegionDetector {
} }
} }
let Region = new RegionDetector(); export let Region = new RegionDetector();
Region.init(); Region.init();
// A method that tries to determine if this user is in a US geography. // A method that tries to determine if this user is in a US geography.

Просмотреть файл

@ -177,7 +177,7 @@ EXTRA_JS_MODULES += [
"Geometry.jsm", "Geometry.jsm",
"HiddenFrame.jsm", "HiddenFrame.jsm",
"Http.jsm", "Http.jsm",
"IgnoreLists.jsm", "IgnoreLists.sys.mjs",
"IndexedDB.jsm", "IndexedDB.jsm",
"InlineSpellChecker.jsm", "InlineSpellChecker.jsm",
"InlineSpellCheckerContent.jsm", "InlineSpellCheckerContent.jsm",
@ -199,7 +199,7 @@ EXTRA_JS_MODULES += [
"ProcessType.jsm", "ProcessType.jsm",
"ProfileAge.jsm", "ProfileAge.jsm",
"PromiseUtils.jsm", "PromiseUtils.jsm",
"Region.jsm", "Region.sys.mjs",
"RemotePageAccessManager.jsm", "RemotePageAccessManager.jsm",
"ResetProfile.jsm", "ResetProfile.jsm",
"ResponsivenessMonitor.jsm", "ResponsivenessMonitor.jsm",

Просмотреть файл

@ -13,7 +13,9 @@ const { EnterprisePolicyTesting } = ChromeUtils.importESModule(
"resource://testing-common/EnterprisePolicyTesting.sys.mjs" "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( const { updateAppInfo } = ChromeUtils.import(
"resource://testing-common/AppInfo.jsm" "resource://testing-common/AppInfo.jsm"

Просмотреть файл

@ -3,8 +3,11 @@
"use strict"; "use strict";
ChromeUtils.defineESModuleGetters(this, {
IgnoreLists: "resource://gre/modules/IgnoreLists.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
IgnoreLists: "resource://gre/modules/IgnoreLists.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm", PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js", RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm", RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",

Просмотреть файл

@ -4,7 +4,9 @@ const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm" "resource://gre/modules/AppConstants.jsm"
); );
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js"); 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 { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
const { TestUtils } = ChromeUtils.import( const { TestUtils } = ChromeUtils.import(
"resource://testing-common/TestUtils.jsm" "resource://testing-common/TestUtils.jsm"

Просмотреть файл

@ -1,6 +1,8 @@
"use strict"; "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 { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
const { TestUtils } = ChromeUtils.import( const { TestUtils } = ChromeUtils.import(
"resource://testing-common/TestUtils.jsm" "resource://testing-common/TestUtils.jsm"