Bug 1836657 - Port bug 1824613: Convert consumers of toolkit/mozapps/extensions/AddonManger.sys.mjs to import ES modules directly. r=freaktechnik
Differential Revision: https://phabricator.services.mozilla.com/D179955 --HG-- extra : amend_source : 4ec13163d64f2d33b4a2f5870cb4c391991cce3c
This commit is contained in:
Родитель
fcb127c61d
Коммит
aa816feba0
|
@ -15,7 +15,7 @@
|
|||
refreshEventTree, gCurrentMode, InitMessageMenu, onViewToolbarsPopupShowing,
|
||||
onCommandCustomize, CustomizeMailToolbar */
|
||||
|
||||
var { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
|
||||
var { AddonManager } = ChromeUtils.importESModule("resource://gre/modules/AddonManager.sys.mjs");
|
||||
var { AppConstants } = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs");
|
||||
var { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");
|
||||
var { calendarDeactivator } = ChromeUtils.import(
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
var EXPORTED_SYMBOLS = ["CalCalendarManager"];
|
||||
|
||||
const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
|
||||
const { AddonManager } = ChromeUtils.importESModule("resource://gre/modules/AddonManager.sys.mjs");
|
||||
const { Preferences } = ChromeUtils.importESModule("resource://gre/modules/Preferences.sys.mjs");
|
||||
const { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");
|
||||
const { calCachedCalendar } = ChromeUtils.import("resource:///components/calCachedCalendar.js");
|
||||
|
|
|
@ -24,11 +24,12 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
|
||||
BrowserToolboxLauncher:
|
||||
"resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs",
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
MailUtils: "resource:///modules/MailUtils.jsm",
|
||||
MimeParser: "resource:///modules/mimeParser.jsm",
|
||||
UIDensity: "resource:///modules/UIDensity.jsm",
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var { AddonManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
var { AddonManager } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
|
||||
var AutoHideMenubar = {
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
var { AddonManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
var { AddonManager } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
var { ExtensionParent } = ChromeUtils.import(
|
||||
"resource://gre/modules/ExtensionParent.jsm"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable mozilla/no-arbitrary-setTimeout */
|
||||
const { AddonManagerPrivate } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
const { AddonManagerPrivate } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
|
||||
var { AddonTestUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const { AddonManagerPrivate } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
const { AddonManagerPrivate } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
|
||||
var { AddonTestUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const { AddonManagerPrivate } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
const { AddonManagerPrivate } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
|
||||
var { AddonTestUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -35,6 +35,7 @@ if (AppConstants.NIGHTLY_BUILD) {
|
|||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
ActorManagerParent: "resource://gre/modules/ActorManagerParent.sys.mjs",
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
ChatCore: "resource:///modules/chatHandler.sys.mjs",
|
||||
|
||||
LightweightThemeConsumer:
|
||||
|
@ -47,7 +48,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
cal: "resource:///modules/calendar/calUtils.jsm",
|
||||
ExtensionSupport: "resource:///modules/ExtensionSupport.jsm",
|
||||
MailMigrator: "resource:///modules/MailMigrator.jsm",
|
||||
|
@ -622,8 +622,8 @@ MailGlue.prototype = {
|
|||
// updates.
|
||||
let currentVersion = Services.appinfo.version;
|
||||
if (this.previousVersion != "0" && this.previousVersion != currentVersion) {
|
||||
let { AddonManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
let { AddonManager } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
let { XPIDatabase } = ChromeUtils.import(
|
||||
"resource://gre/modules/addons/XPIDatabase.jsm"
|
||||
|
|
|
@ -15,8 +15,8 @@ ChromeUtils.defineModuleGetter(
|
|||
"resource:///modules/accountcreation/Sanitizer.jsm"
|
||||
);
|
||||
|
||||
const { AddonManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
const { AddonManager } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
const { ConsoleAPI } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Console.sys.mjs"
|
||||
|
|
|
@ -15,9 +15,12 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AccountConfig: "resource:///modules/accountcreation/AccountConfig.jsm",
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
cal: "resource:///modules/calendar/calUtils.jsm",
|
||||
CardDAVUtils: "resource:///modules/CardDAVUtils.jsm",
|
||||
ConfigVerifier: "resource:///modules/accountcreation/ConfigVerifier.jsm",
|
||||
|
|
|
@ -22,14 +22,11 @@ XPCOMUtils.defineLazyServiceGetters(lazy, {
|
|||
});
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
ProxyPolicies: "resource:///modules/policies/ProxyPolicies.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
});
|
||||
|
||||
const PREF_LOGLEVEL = "browser.policies.loglevel";
|
||||
const ABOUT_CONTRACT = "@mozilla.org/network/protocol/about;1?what=";
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ ChromeUtils.defineModuleGetter(
|
|||
"ExtensionSettingsStore",
|
||||
"resource://gre/modules/ExtensionSettingsStore.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
});
|
||||
|
||||
function enableAddon(addon) {
|
||||
return new Promise(resolve => {
|
||||
|
|
|
@ -8,8 +8,8 @@ var { getCachedAllowedSpaces, setCachedAllowedSpaces } = ChromeUtils.import(
|
|||
var { storeState, getState } = ChromeUtils.importESModule(
|
||||
"resource:///modules/CustomizationState.mjs"
|
||||
);
|
||||
const { AddonManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
const { AddonManager } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AddonManager.sys.mjs"
|
||||
);
|
||||
var { AddonTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/AddonTestUtils.sys.mjs"
|
||||
|
|
|
@ -6,12 +6,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
|
|
|
@ -5,12 +5,8 @@
|
|||
// This is exported by preferences.js but we can't import that in a subdialog.
|
||||
let { getAvailableLocales } = window.top;
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
AddonRepository: "resource://gre/modules/addons/AddonRepository.sys.mjs",
|
||||
});
|
||||
|
||||
|
|
|
@ -30,11 +30,9 @@ var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
|
|||
var paneDeck = document.getElementById("paneDeck");
|
||||
var defaultPane = "paneGeneral";
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gSubDialog", function () {
|
||||
const { SubDialogManager } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -6,11 +6,9 @@ import CUSTOMIZABLE_ITEMS from "resource:///modules/CustomizableItemsDetails.mjs
|
|||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
});
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
lazy,
|
||||
"glodaEnabled",
|
||||
|
|
|
@ -15,15 +15,16 @@ const { EventEmitter } = ChromeUtils.importESModule(
|
|||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AMTelemetry: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
AddonManagerPrivate: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.sys.mjs",
|
||||
|
||||
SITEPERMS_ADDON_TYPE:
|
||||
"resource://gre/modules/addons/siteperms-addon-utils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm",
|
||||
AMTelemetry: "resource://gre/modules/AddonManager.jsm",
|
||||
ExtensionData: "resource://gre/modules/Extension.jsm",
|
||||
ExtensionParent: "resource://gre/modules/ExtensionParent.jsm",
|
||||
});
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
||||
});
|
||||
|
||||
// List of themes built in to the browser. The themes are represented by objects
|
||||
|
|
Загрузка…
Ссылка в новой задаче