diff --git a/browser/components/firefoxview/opentabs.mjs b/browser/components/firefoxview/opentabs.mjs index d1b1d8b96632..df822d31ef69 100644 --- a/browser/components/firefoxview/opentabs.mjs +++ b/browser/components/firefoxview/opentabs.mjs @@ -12,17 +12,10 @@ import { import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { ViewPage } from "./viewpage.mjs"; -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); - const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - EveryWindow: "resource:///modules/EveryWindow.jsm", -}); - ChromeUtils.defineESModuleGetters(lazy, { + EveryWindow: "resource:///modules/EveryWindow.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); diff --git a/browser/components/firefoxview/tests/browser/head.js b/browser/components/firefoxview/tests/browser/head.js index 4cf8afab358f..bbdf37db4f88 100644 --- a/browser/components/firefoxview/tests/browser/head.js +++ b/browser/components/firefoxview/tests/browser/head.js @@ -31,12 +31,12 @@ const { TelemetryTestUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", }); const MOBILE_PROMO_DISMISSED_PREF = diff --git a/browser/components/migration/MigrationWizardParent.sys.mjs b/browser/components/migration/MigrationWizardParent.sys.mjs index ec0b2e378ceb..e4381bf850d5 100644 --- a/browser/components/migration/MigrationWizardParent.sys.mjs +++ b/browser/components/migration/MigrationWizardParent.sys.mjs @@ -20,6 +20,7 @@ ChromeUtils.defineESModuleGetters(lazy, { FirefoxProfileMigrator: "resource:///modules/FirefoxProfileMigrator.sys.mjs", InternalTestingProfileMigrator: "resource:///modules/InternalTestingProfileMigrator.sys.mjs", + LoginCSVImport: "resource://gre/modules/LoginCSVImport.sys.mjs", MigrationWizardConstants: "chrome://browser/content/migration/migration-wizard-constants.mjs", PasswordFileMigrator: "resource:///modules/FileMigrators.sys.mjs", @@ -31,10 +32,6 @@ if (AppConstants.platform == "macosx") { }); } -XPCOMUtils.defineLazyModuleGetters(lazy, { - LoginCSVImport: "resource://gre/modules/LoginCSVImport.jsm", -}); - /** * Set to true once the first instance of MigrationWizardParent has received * a "GetAvailableMigrators" message. diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js index 788e5b2b3388..36af0176e411 100644 --- a/browser/components/preferences/preferences.js +++ b/browser/components/preferences/preferences.js @@ -111,12 +111,6 @@ ChromeUtils.defineESModuleGetters(this, { UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - SelectionChangedMenulist: "resource:///modules/SelectionChangedMenulist.jsm", - SiteDataManager: "resource:///modules/SiteDataManager.jsm", - TransientPrefs: "resource:///modules/TransientPrefs.jsm", -}); - XPCOMUtils.defineLazyGetter(this, "gSubDialog", function () { const { SubDialogManager } = ChromeUtils.importESModule( "resource://gre/modules/SubDialog.sys.mjs" diff --git a/browser/extensions/formautofill/content/editDialog.js b/browser/extensions/formautofill/content/editDialog.js index 77dcbb2ae051..a102af51357c 100644 --- a/browser/extensions/formautofill/content/editDialog.js +++ b/browser/extensions/formautofill/content/editDialog.js @@ -8,13 +8,9 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AutofillTelemetry: "resource://autofill/AutofillTelemetry.sys.mjs", formAutofillStorage: "resource://autofill/FormAutofillStorage.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "AutofillTelemetry", - "resource://autofill/AutofillTelemetry.jsm" -); class AutofillEditDialog { constructor(subStorageName, elements, record) { diff --git a/browser/extensions/formautofill/content/manageDialog.js b/browser/extensions/formautofill/content/manageDialog.js index 25498fbcafd9..e05383d1f743 100644 --- a/browser/extensions/formautofill/content/manageDialog.js +++ b/browser/extensions/formautofill/content/manageDialog.js @@ -19,8 +19,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const { FormAutofill } = ChromeUtils.importESModule( "resource://autofill/FormAutofill.sys.mjs" ); -const { AutofillTelemetry } = ChromeUtils.import( - "resource://autofill/AutofillTelemetry.jsm" +const { AutofillTelemetry } = ChromeUtils.importESModule( + "resource://autofill/AutofillTelemetry.sys.mjs" ); ChromeUtils.defineESModuleGetters(this, { diff --git a/browser/extensions/formautofill/test/browser/address/browser_address_telemetry.js b/browser/extensions/formautofill/test/browser/address/browser_address_telemetry.js index 66dbc2495185..432932e6d9bf 100644 --- a/browser/extensions/formautofill/test/browser/address/browser_address_telemetry.js +++ b/browser/extensions/formautofill/test/browser/address/browser_address_telemetry.js @@ -4,8 +4,8 @@ const { TelemetryTestUtils } = ChromeUtils.importESModule( "resource://testing-common/TelemetryTestUtils.sys.mjs" ); -const { AddressTelemetry } = ChromeUtils.import( - "resource://autofill/AutofillTelemetry.jsm" +const { AddressTelemetry } = ChromeUtils.importESModule( + "resource://autofill/AutofillTelemetry.sys.mjs" ); // Preference definitions diff --git a/services/sync/tests/unit/test_password_engine.js b/services/sync/tests/unit/test_password_engine.js index e71ff945ffb6..34104583451f 100644 --- a/services/sync/tests/unit/test_password_engine.js +++ b/services/sync/tests/unit/test_password_engine.js @@ -14,8 +14,8 @@ const LoginInfo = Components.Constructor( "init" ); -const { LoginCSVImport } = ChromeUtils.import( - "resource://gre/modules/LoginCSVImport.jsm" +const { LoginCSVImport } = ChromeUtils.importESModule( + "resource://gre/modules/LoginCSVImport.sys.mjs" ); const { FileTestUtils } = ChromeUtils.importESModule( diff --git a/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs b/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs index 66763e8cc014..ea478c47005b 100644 --- a/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs +++ b/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs @@ -127,11 +127,11 @@ */ import { FormAutofill } from "resource://autofill/FormAutofill.sys.mjs"; -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + AutofillTelemetry: "resource://autofill/AutofillTelemetry.sys.mjs", CreditCard: "resource://gre/modules/CreditCard.sys.mjs", CreditCardRecord: "resource://gre/modules/shared/CreditCardRecord.sys.mjs", FormAutofillNameUtils: @@ -141,10 +141,6 @@ ChromeUtils.defineESModuleGetters(lazy, { PhoneNumber: "resource://autofill/phonenumberutils/PhoneNumber.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - AutofillTelemetry: "resource://autofill/AutofillTelemetry.jsm", -}); - const CryptoHash = Components.Constructor( "@mozilla.org/security/hash;1", "nsICryptoHash", diff --git a/toolkit/components/formautofill/android/FormAutofillStorage.sys.mjs b/toolkit/components/formautofill/android/FormAutofillStorage.sys.mjs index f7a8dd109404..0d11880ff550 100644 --- a/toolkit/components/formautofill/android/FormAutofillStorage.sys.mjs +++ b/toolkit/components/formautofill/android/FormAutofillStorage.sys.mjs @@ -6,10 +6,6 @@ * Implements an interface of the storage of Form Autofill for GeckoView. */ -// We expose a singleton from this module. Some tests may import the -// constructor via a backstage pass. -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - import { FormAutofillStorageBase, CreditCardsBase, @@ -19,10 +15,10 @@ import { JSONFile } from "resource://gre/modules/JSONFile.sys.mjs"; const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - Address: "resource://gre/modules/GeckoViewAutocomplete.jsm", - CreditCard: "resource://gre/modules/GeckoViewAutocomplete.jsm", - GeckoViewAutocomplete: "resource://gre/modules/GeckoViewAutocomplete.jsm", +ChromeUtils.defineESModuleGetters(lazy, { + Address: "resource://gre/modules/GeckoViewAutocomplete.sys.mjs", + CreditCard: "resource://gre/modules/GeckoViewAutocomplete.sys.mjs", + GeckoViewAutocomplete: "resource://gre/modules/GeckoViewAutocomplete.sys.mjs", }); class GeckoViewStorage extends JSONFile { diff --git a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs index 31975cd96817..08d91d8be944 100644 --- a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs +++ b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs @@ -12,9 +12,7 @@ import { FormAutofill } from "resource://autofill/FormAutofill.sys.mjs"; import { FormAutofillUtils } from "resource://gre/modules/shared/FormAutofillUtils.sys.mjs"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; -const { AutofillTelemetry } = ChromeUtils.import( - "resource://autofill/AutofillTelemetry.jsm" -); +import { AutofillTelemetry } from "resource://autofill/AutofillTelemetry.sys.mjs"; const lazy = {}; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_recommendations.js b/toolkit/mozapps/extensions/test/xpcshell/test_recommendations.js index a650bafccc94..2cda1d9a369a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_recommendations.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_recommendations.js @@ -9,14 +9,9 @@ const { XPIInstall } = ChromeUtils.import( ChromeUtils.defineESModuleGetters(this, { ExtensionPermissions: "resource://gre/modules/ExtensionPermissions.sys.mjs", + Management: "resource://gre/modules/Extension.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "Management", - "resource://gre/modules/Extension.jsm" -); - AddonTestUtils.init(this); AddonTestUtils.overrideCertDB(); AddonTestUtils.usePrivilegedSignatures = false; diff --git a/tools/esmify/map.json b/tools/esmify/map.json index b51aaf4a5da2..08317abcb1b0 100644 --- a/tools/esmify/map.json +++ b/tools/esmify/map.json @@ -353,6 +353,7 @@ "resource://app/modules/translation/BingTranslator.jsm": "browser/components/translation/BingTranslator.jsm", "resource://app/modules/translation/GoogleTranslator.jsm": "browser/components/translation/GoogleTranslator.jsm", "resource://app/modules/translation/YandexTranslator.jsm": "browser/components/translation/YandexTranslator.jsm", + "resource://autofill/AutofillTelemetry.jsm": "toolkit/components/formautofill/AutofillTelemetry.jsm", "resource://autofill/CreditCardRuleset.jsm": "toolkit/components/formautofill/CreditCardRuleset.jsm", "resource://autofill/FormAutofill.jsm": "toolkit/components/formautofill/FormAutofill.jsm", "resource://autofill/FormAutofillChild.jsm": "toolkit/components/formautofill/FormAutofillChild.jsm",