mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1845079 - Update more consumers to import ES modules directly. r=arai,settings-reviewers,credential-management-reviewers,sync-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D184371
This commit is contained in:
parent
d9a4dda484
commit
6fe765f7ca
@ -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",
|
||||
});
|
||||
|
||||
|
@ -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 =
|
||||
|
@ -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.
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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, {
|
||||
|
@ -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
|
||||
|
@ -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(
|
||||
|
@ -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",
|
||||
|
@ -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 {
|
||||
|
@ -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 = {};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user