mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1821624
- Convert toolkit/components/messaging-system to ES modules r=Standard8,fxview-reviewers,omc-reviewers,aminomancer,sclements
Differential Revision: https://phabricator.services.mozilla.com/D172406
This commit is contained in:
parent
0fbb298ba4
commit
d0b9714f92
@ -25,12 +25,9 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
|||||||
);
|
);
|
||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
|
|
||||||
});
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|
||||||
SpecialMessageActions:
|
SpecialMessageActions:
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
|
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
// We only show the private search banner once per browser session.
|
// We only show the private search banner once per browser session.
|
||||||
|
@ -56,6 +56,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||||||
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
|
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
|
||||||
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
|
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
|
||||||
ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs",
|
ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs",
|
||||||
|
SpecialMessageActions:
|
||||||
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
TRRRacer: "resource:///modules/TRRPerformance.sys.mjs",
|
TRRRacer: "resource:///modules/TRRPerformance.sys.mjs",
|
||||||
TelemetryUtils: "resource://gre/modules/TelemetryUtils.sys.mjs",
|
TelemetryUtils: "resource://gre/modules/TelemetryUtils.sys.mjs",
|
||||||
UIState: "resource://services-sync/UIState.sys.mjs",
|
UIState: "resource://services-sync/UIState.sys.mjs",
|
||||||
@ -101,10 +103,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
Sanitizer: "resource:///modules/Sanitizer.jsm",
|
Sanitizer: "resource:///modules/Sanitizer.jsm",
|
||||||
SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
|
SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
|
||||||
ShellService: "resource:///modules/ShellService.jsm",
|
ShellService: "resource:///modules/ShellService.jsm",
|
||||||
|
|
||||||
SpecialMessageActions:
|
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
|
||||||
|
|
||||||
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
||||||
TabUnloader: "resource:///modules/TabUnloader.jsm",
|
TabUnloader: "resource:///modules/TabUnloader.jsm",
|
||||||
});
|
});
|
||||||
|
@ -5,8 +5,8 @@ const { ASRouterTriggerListeners } = ChromeUtils.import(
|
|||||||
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm"
|
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
const { SpecialMessageActions } = ChromeUtils.import(
|
const { SpecialMessageActions } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm"
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
add_task(async function cfr_firefoxview_should_show() {
|
add_task(async function cfr_firefoxview_should_show() {
|
||||||
|
@ -8,11 +8,13 @@ import { JsonSchema } from "resource://gre/modules/JsonSchema.sys.mjs";
|
|||||||
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
|
|
||||||
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
SpecialMessageActions:
|
||||||
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
|
});
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
InfoBar: "resource://activity-stream/lib/InfoBar.jsm",
|
InfoBar: "resource://activity-stream/lib/InfoBar.jsm",
|
||||||
Spotlight: "resource://activity-stream/lib/Spotlight.jsm",
|
Spotlight: "resource://activity-stream/lib/Spotlight.jsm",
|
||||||
SpecialMessageActions:
|
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function dispatchCFRAction({ type, data }, browser) {
|
function dispatchCFRAction({ type, data }, browser) {
|
||||||
|
@ -20,8 +20,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("AboutWelcomeChild");
|
return new Logger("AboutWelcomeChild");
|
||||||
});
|
});
|
||||||
|
@ -16,12 +16,12 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||||||
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
|
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
|
||||||
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
|
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
|
||||||
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
|
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
|
||||||
|
SpecialMessageActions:
|
||||||
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||||
SpecialMessageActions:
|
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
|
||||||
AboutWelcomeTelemetry:
|
AboutWelcomeTelemetry:
|
||||||
"resource://activity-stream/aboutwelcome/lib/AboutWelcomeTelemetry.jsm",
|
"resource://activity-stream/aboutwelcome/lib/AboutWelcomeTelemetry.jsm",
|
||||||
AboutWelcomeDefaults:
|
AboutWelcomeDefaults:
|
||||||
@ -32,8 +32,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("AboutWelcomeParent");
|
return new Logger("AboutWelcomeParent");
|
||||||
});
|
});
|
||||||
|
@ -15,6 +15,9 @@ const lazy = {};
|
|||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
Downloader: "resource://services-settings/Attachments.sys.mjs",
|
Downloader: "resource://services-settings/Attachments.sys.mjs",
|
||||||
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
|
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
|
||||||
|
SpecialMessageActions:
|
||||||
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
|
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
@ -38,9 +41,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||||
SpecialMessageActions:
|
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
|
||||||
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
|
|
||||||
Utils: "resource://services-settings/Utils.jsm",
|
Utils: "resource://services-settings/Utils.jsm",
|
||||||
});
|
});
|
||||||
XPCOMUtils.defineLazyServiceGetters(lazy, {
|
XPCOMUtils.defineLazyServiceGetters(lazy, {
|
||||||
|
@ -16,8 +16,8 @@ const { TelemetryFeed } = ChromeUtils.import(
|
|||||||
const { ASRouterParentProcessMessageHandler } = ChromeUtils.import(
|
const { ASRouterParentProcessMessageHandler } = ChromeUtils.import(
|
||||||
"resource://activity-stream/lib/ASRouterParentProcessMessageHandler.jsm"
|
"resource://activity-stream/lib/ASRouterParentProcessMessageHandler.jsm"
|
||||||
);
|
);
|
||||||
const { SpecialMessageActions } = ChromeUtils.import(
|
const { SpecialMessageActions } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm"
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs"
|
||||||
);
|
);
|
||||||
const { ASRouterPreferences } = ChromeUtils.import(
|
const { ASRouterPreferences } = ChromeUtils.import(
|
||||||
"resource://activity-stream/lib/ASRouterPreferences.jsm"
|
"resource://activity-stream/lib/ASRouterPreferences.jsm"
|
||||||
|
@ -26,6 +26,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||||||
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
|
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
|
||||||
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
|
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
|
||||||
Region: "resource://gre/modules/Region.sys.mjs",
|
Region: "resource://gre/modules/Region.sys.mjs",
|
||||||
|
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
|
||||||
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs",
|
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs",
|
||||||
TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs",
|
TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs",
|
||||||
});
|
});
|
||||||
@ -34,7 +35,6 @@ 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",
|
||||||
ClientEnvironment: "resource://normandy/lib/ClientEnvironment.jsm",
|
ClientEnvironment: "resource://normandy/lib/ClientEnvironment.jsm",
|
||||||
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
|
|
||||||
HomePage: "resource:///modules/HomePage.jsm",
|
HomePage: "resource:///modules/HomePage.jsm",
|
||||||
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
|
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
|
||||||
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
||||||
|
@ -22,8 +22,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("ASRouterTriggerListeners");
|
return new Logger("ASRouterTriggerListeners");
|
||||||
});
|
});
|
||||||
|
@ -11,12 +11,12 @@ const lazy = {};
|
|||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
Preferences: "resource://gre/modules/Preferences.sys.mjs",
|
Preferences: "resource://gre/modules/Preferences.sys.mjs",
|
||||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||||
|
SpecialMessageActions:
|
||||||
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
EveryWindow: "resource:///modules/EveryWindow.jsm",
|
EveryWindow: "resource:///modules/EveryWindow.jsm",
|
||||||
SpecialMessageActions:
|
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm",
|
|
||||||
RemoteL10n: "resource://activity-stream/lib/RemoteL10n.jsm",
|
RemoteL10n: "resource://activity-stream/lib/RemoteL10n.jsm",
|
||||||
});
|
});
|
||||||
ChromeUtils.defineModuleGetter(
|
ChromeUtils.defineModuleGetter(
|
||||||
|
@ -67,8 +67,8 @@ ChromeUtils.defineModuleGetter(
|
|||||||
);
|
);
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("TopSitesFeed");
|
return new Logger("TopSitesFeed");
|
||||||
});
|
});
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
const { OnboardingMessageProvider } = ChromeUtils.import(
|
const { OnboardingMessageProvider } = ChromeUtils.import(
|
||||||
"resource://activity-stream/lib/OnboardingMessageProvider.jsm"
|
"resource://activity-stream/lib/OnboardingMessageProvider.jsm"
|
||||||
);
|
);
|
||||||
const { SpecialMessageActions } = ChromeUtils.import(
|
const { SpecialMessageActions } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm"
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs"
|
||||||
);
|
);
|
||||||
const {
|
const {
|
||||||
assertFirefoxViewTabSelected,
|
assertFirefoxViewTabSelected,
|
||||||
|
@ -11,7 +11,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||||
QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm",
|
QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm",
|
||||||
ShellService: "resource:///modules/ShellService.jsm",
|
ShellService: "resource:///modules/ShellService.jsm",
|
||||||
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
|
|
||||||
});
|
});
|
||||||
ChromeUtils.defineESModuleGetters(this, {
|
ChromeUtils.defineESModuleGetters(this, {
|
||||||
AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
|
AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
|
||||||
@ -22,6 +21,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||||||
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
|
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
|
||||||
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
|
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
|
||||||
Region: "resource://gre/modules/Region.sys.mjs",
|
Region: "resource://gre/modules/Region.sys.mjs",
|
||||||
|
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
|
||||||
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs",
|
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs",
|
||||||
TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs",
|
TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs",
|
||||||
});
|
});
|
||||||
|
@ -12,8 +12,8 @@ const { PanelTestProvider } = ChromeUtils.import(
|
|||||||
const { BrowserWindowTracker } = ChromeUtils.import(
|
const { BrowserWindowTracker } = ChromeUtils.import(
|
||||||
"resource:///modules/BrowserWindowTracker.jsm"
|
"resource:///modules/BrowserWindowTracker.jsm"
|
||||||
);
|
);
|
||||||
const { SpecialMessageActions } = ChromeUtils.import(
|
const { SpecialMessageActions } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm"
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
async function waitForClick(selector, win) {
|
async function waitForClick(selector, win) {
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
toolkit.jar:
|
toolkit.jar:
|
||||||
% resource messaging-system %res/messaging-system/
|
% resource messaging-system %res/messaging-system/
|
||||||
res/messaging-system/lib/ (./lib/*)
|
res/messaging-system/lib/ (./lib/*)
|
||||||
res/messaging-system/targeting/Targeting.jsm (./targeting/Targeting.jsm)
|
res/messaging-system/targeting/Targeting.sys.mjs (./targeting/Targeting.sys.mjs)
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["Logger"];
|
import { ConsoleAPI } from "resource://gre/modules/Console.sys.mjs";
|
||||||
|
|
||||||
const { ConsoleAPI } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/Console.sys.mjs"
|
|
||||||
);
|
|
||||||
|
|
||||||
const LOGGING_PREF = "messaging-system.log";
|
const LOGGING_PREF = "messaging-system.log";
|
||||||
|
|
||||||
class Logger extends ConsoleAPI {
|
export class Logger extends ConsoleAPI {
|
||||||
constructor(name) {
|
constructor(name) {
|
||||||
let consoleOptions = {
|
let consoleOptions = {
|
||||||
prefix: name,
|
prefix: name,
|
@ -1,13 +1,9 @@
|
|||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["SpecialMessageActions"];
|
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||||
|
|
||||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
|
||||||
);
|
|
||||||
const DOH_DOORHANGER_DECISION_PREF = "doh-rollout.doorhanger-decision";
|
const DOH_DOORHANGER_DECISION_PREF = "doh-rollout.doorhanger-decision";
|
||||||
const NETWORK_TRR_MODE_PREF = "network.trr.mode";
|
const NETWORK_TRR_MODE_PREF = "network.trr.mode";
|
||||||
|
|
||||||
@ -25,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
ColorwayClosetOpener: "resource:///modules/ColorwayClosetOpener.jsm",
|
ColorwayClosetOpener: "resource:///modules/ColorwayClosetOpener.jsm",
|
||||||
});
|
});
|
||||||
|
|
||||||
const SpecialMessageActions = {
|
export const SpecialMessageActions = {
|
||||||
// This is overridden by ASRouter.init
|
// This is overridden by ASRouter.init
|
||||||
blockMessageById() {
|
blockMessageById() {
|
||||||
throw new Error("ASRouter not intialized yet");
|
throw new Error("ASRouter not intialized yet");
|
@ -8,11 +8,10 @@ const { JsonSchema } = ChromeUtils.importESModule(
|
|||||||
"resource://gre/modules/JsonSchema.sys.mjs"
|
"resource://gre/modules/JsonSchema.sys.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
ChromeUtils.defineModuleGetter(
|
ChromeUtils.defineESModuleGetters(this, {
|
||||||
this,
|
SpecialMessageActions:
|
||||||
"SpecialMessageActions",
|
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||||
"resource://messaging-system/lib/SpecialMessageActions.jsm"
|
});
|
||||||
);
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, "fetchSMASchema", async () => {
|
XPCOMUtils.defineLazyGetter(this, "fetchSMASchema", async () => {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
|
@ -2,14 +2,9 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||||
|
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
||||||
|
|
||||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
|
||||||
);
|
|
||||||
const { AppConstants } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/AppConstants.sys.mjs"
|
|
||||||
);
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
@ -27,8 +22,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
"resource://gre/modules/components-utils/ClientEnvironment.jsm",
|
"resource://gre/modules/components-utils/ClientEnvironment.jsm",
|
||||||
});
|
});
|
||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["TargetingContext"];
|
|
||||||
|
|
||||||
const TARGETING_EVENT_CATEGORY = "messaging_experiments";
|
const TARGETING_EVENT_CATEGORY = "messaging_experiments";
|
||||||
const TARGETING_EVENT_METHOD = "targeting";
|
const TARGETING_EVENT_METHOD = "targeting";
|
||||||
const DEFAULT_TIMEOUT = 5000;
|
const DEFAULT_TIMEOUT = 5000;
|
||||||
@ -72,7 +65,7 @@ const TargetingEnvironment = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
class TargetingContext {
|
export class TargetingContext {
|
||||||
#telemetrySource = null;
|
#telemetrySource = null;
|
||||||
|
|
||||||
constructor(customContext, options = { source: null }) {
|
constructor(customContext, options = { source: null }) {
|
@ -1,8 +1,8 @@
|
|||||||
const { ClientEnvironment } = ChromeUtils.import(
|
const { ClientEnvironment } = ChromeUtils.import(
|
||||||
"resource://normandy/lib/ClientEnvironment.jsm"
|
"resource://normandy/lib/ClientEnvironment.jsm"
|
||||||
);
|
);
|
||||||
const { TargetingContext } = ChromeUtils.import(
|
const { TargetingContext } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/targeting/Targeting.jsm"
|
"resource://messaging-system/targeting/Targeting.sys.mjs"
|
||||||
);
|
);
|
||||||
const { TelemetryTestUtils } = ChromeUtils.importESModule(
|
const { TelemetryTestUtils } = ChromeUtils.importESModule(
|
||||||
"resource://testing-common/TelemetryTestUtils.sys.mjs"
|
"resource://testing-common/TelemetryTestUtils.sys.mjs"
|
||||||
|
@ -28,8 +28,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("ExperimentManager");
|
return new Logger("ExperimentManager");
|
||||||
});
|
});
|
||||||
|
@ -19,19 +19,19 @@ const lazy = {};
|
|||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
JsonSchema: "resource://gre/modules/JsonSchema.sys.mjs",
|
JsonSchema: "resource://gre/modules/JsonSchema.sys.mjs",
|
||||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||||
|
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
ASRouterTargeting: "resource://activity-stream/lib/ASRouterTargeting.jsm",
|
ASRouterTargeting: "resource://activity-stream/lib/ASRouterTargeting.jsm",
|
||||||
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
|
|
||||||
ExperimentManager: "resource://nimbus/lib/ExperimentManager.jsm",
|
ExperimentManager: "resource://nimbus/lib/ExperimentManager.jsm",
|
||||||
CleanupManager: "resource://normandy/lib/CleanupManager.jsm",
|
CleanupManager: "resource://normandy/lib/CleanupManager.jsm",
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
const { Logger } = ChromeUtils.import(
|
const { Logger } = ChromeUtils.importESModule(
|
||||||
"resource://messaging-system/lib/Logger.jsm"
|
"resource://messaging-system/lib/Logger.sys.mjs"
|
||||||
);
|
);
|
||||||
return new Logger("RSLoader");
|
return new Logger("RSLoader");
|
||||||
});
|
});
|
||||||
|
@ -24,19 +24,19 @@ XPCOMUtils.defineLazyServiceGetter(
|
|||||||
);
|
);
|
||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
LegacyHeartbeat: "resource://normandy/lib/LegacyHeartbeat.sys.mjs",
|
||||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||||
RemoteSettingsClient:
|
RemoteSettingsClient:
|
||||||
"resource://services-settings/RemoteSettingsClient.sys.mjs",
|
"resource://services-settings/RemoteSettingsClient.sys.mjs",
|
||||||
|
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
|
||||||
clearTimeout: "resource://gre/modules/Timer.sys.mjs",
|
clearTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||||
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||||
LegacyHeartbeat: "resource://normandy/lib/LegacyHeartbeat.sys.mjs",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
Storage: "resource://normandy/lib/Storage.jsm",
|
Storage: "resource://normandy/lib/Storage.jsm",
|
||||||
FilterExpressions:
|
FilterExpressions:
|
||||||
"resource://gre/modules/components-utils/FilterExpressions.jsm",
|
"resource://gre/modules/components-utils/FilterExpressions.jsm",
|
||||||
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
|
|
||||||
Normandy: "resource://normandy/Normandy.jsm",
|
Normandy: "resource://normandy/Normandy.jsm",
|
||||||
NormandyApi: "resource://normandy/lib/NormandyApi.jsm",
|
NormandyApi: "resource://normandy/lib/NormandyApi.jsm",
|
||||||
ClientEnvironment: "resource://normandy/lib/ClientEnvironment.jsm",
|
ClientEnvironment: "resource://normandy/lib/ClientEnvironment.jsm",
|
||||||
|
Loading…
Reference in New Issue
Block a user