diff --git a/browser/base/content/spotlight.js b/browser/base/content/spotlight.js index b07d54a71405..48d2968bfc91 100644 --- a/browser/base/content/spotlight.js +++ b/browser/base/content/spotlight.js @@ -5,8 +5,8 @@ const browser = window.docShell.chromeEventHandler; const { document: gDoc, XPCOMUtils } = browser.ownerGlobal; -XPCOMUtils.defineLazyModuleGetters(this, { - AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.jsm", +ChromeUtils.defineESModuleGetters(this, { + AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.sys.mjs", }); const CONFIG = window.arguments[0]; diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs index 1d34fcc86e3c..98c88da28982 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -386,10 +386,10 @@ let JSWINDOWACTORS = { AboutWelcomeShopping: { parent: { - moduleURI: "resource:///actors/AboutWelcomeParent.jsm", + esModuleURI: "resource:///actors/AboutWelcomeParent.sys.mjs", }, child: { - moduleURI: "resource:///actors/AboutWelcomeChild.jsm", + esModuleURI: "resource:///actors/AboutWelcomeChild.sys.mjs", events: { Update: {}, }, @@ -400,10 +400,10 @@ let JSWINDOWACTORS = { AboutWelcome: { parent: { - moduleURI: "resource:///actors/AboutWelcomeParent.jsm", + esModuleURI: "resource:///actors/AboutWelcomeParent.sys.mjs", }, child: { - moduleURI: "resource:///actors/AboutWelcomeChild.jsm", + esModuleURI: "resource:///actors/AboutWelcomeChild.sys.mjs", events: { // This is added so the actor instantiates immediately and makes // methods available to the page js on load. diff --git a/browser/components/firefoxview/tests/browser/head.js b/browser/components/firefoxview/tests/browser/head.js index 3b0bc8447eca..4f6e0424e611 100644 --- a/browser/components/firefoxview/tests/browser/head.js +++ b/browser/components/firefoxview/tests/browser/head.js @@ -37,15 +37,12 @@ const { SessionStoreTestUtils } = ChromeUtils.importESModule( SessionStoreTestUtils.init(this, window); ChromeUtils.defineESModuleGetters(this, { + AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.sys.mjs", BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs", TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.jsm", -}); - const MOBILE_PROMO_DISMISSED_PREF = "browser.tabs.firefox-view.mobilePromo.dismissed"; const RECENTLY_CLOSED_STATE_PREF = diff --git a/browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm b/browser/components/newtab/aboutwelcome/AboutWelcomeChild.sys.mjs similarity index 98% rename from browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm rename to browser/components/newtab/aboutwelcome/AboutWelcomeChild.sys.mjs index ddee2d4f9947..bb15da89c22d 100644 --- a/browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm +++ b/browser/components/newtab/aboutwelcome/AboutWelcomeChild.sys.mjs @@ -2,13 +2,7 @@ * 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/. */ -"use strict"; - -const EXPORTED_SYMBOLS = ["AboutWelcomeChild", "AboutWelcomeShoppingChild"]; - -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; @@ -29,7 +23,7 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => { return new Logger("AboutWelcomeChild"); }); -class AboutWelcomeChild extends JSWindowActorChild { +export class AboutWelcomeChild extends JSWindowActorChild { // Can be used to avoid accesses to the document/contentWindow after it's // destroyed, which may throw unhandled exceptions. _destroyed = false; @@ -664,7 +658,7 @@ const MIN_VISITS_TO_SHOW_SURVEY = 5; // Wait 24 hours after opt in to show survey const MIN_TIME_AFTER_OPT_IN = 24 * 60 * 60; -class AboutWelcomeShoppingChild extends AboutWelcomeChild { +export class AboutWelcomeShoppingChild extends AboutWelcomeChild { // Static state used to track session in which user opted-in static optedInSession = false; diff --git a/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm b/browser/components/newtab/aboutwelcome/AboutWelcomeParent.sys.mjs similarity index 97% rename from browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm rename to browser/components/newtab/aboutwelcome/AboutWelcomeParent.sys.mjs index 9be3267e383a..4d3e0b30c984 100644 --- a/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm +++ b/browser/components/newtab/aboutwelcome/AboutWelcomeParent.sys.mjs @@ -2,13 +2,7 @@ * 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/. */ -"use strict"; - -const EXPORTED_SYMBOLS = ["AboutWelcomeParent", "AboutWelcomeShoppingParent"]; - -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; @@ -124,7 +118,7 @@ class AboutWelcomeObserver { } } -class AboutWelcomeParent extends JSWindowActorParent { +export class AboutWelcomeParent extends JSWindowActorParent { constructor() { super(); this.startAboutWelcomeObserver(); @@ -280,7 +274,7 @@ class AboutWelcomeParent extends JSWindowActorParent { } } -class AboutWelcomeShoppingParent extends AboutWelcomeParent { +export class AboutWelcomeShoppingParent extends AboutWelcomeParent { /** * Handle messages from AboutWelcomeChild.jsm * diff --git a/browser/components/newtab/moz.build b/browser/components/newtab/moz.build index 08135a888a7c..0275b96e05cc 100644 --- a/browser/components/newtab/moz.build +++ b/browser/components/newtab/moz.build @@ -46,8 +46,8 @@ EXTRA_JS_MODULES += [ ] FINAL_TARGET_FILES.actors += [ - "aboutwelcome/AboutWelcomeChild.jsm", - "aboutwelcome/AboutWelcomeParent.jsm", + "aboutwelcome/AboutWelcomeChild.sys.mjs", + "aboutwelcome/AboutWelcomeParent.sys.mjs", "actors/ASRouterChild.sys.mjs", "actors/ASRouterParent.sys.mjs", ] diff --git a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_addonspicker.js b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_addonspicker.js index b13c536039f3..9c4b7b36cdd3 100644 --- a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_addonspicker.js +++ b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_addonspicker.js @@ -1,7 +1,7 @@ "use strict"; -const { AboutWelcomeParent } = ChromeUtils.import( - "resource:///actors/AboutWelcomeParent.jsm" +const { AboutWelcomeParent } = ChromeUtils.importESModule( + "resource:///actors/AboutWelcomeParent.sys.mjs" ); const { AboutWelcomeTelemetry } = ChromeUtils.import( diff --git a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_mr.js b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_mr.js index 95dd5025faa8..5b7d0a40c711 100644 --- a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_mr.js +++ b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_mr.js @@ -1,7 +1,7 @@ "use strict"; -const { AboutWelcomeParent } = ChromeUtils.import( - "resource:///actors/AboutWelcomeParent.jsm" +const { AboutWelcomeParent } = ChromeUtils.importESModule( + "resource:///actors/AboutWelcomeParent.sys.mjs" ); const { AboutWelcomeTelemetry } = ChromeUtils.import( diff --git a/browser/components/newtab/test/browser/browser_aboutwelcome_observer.js b/browser/components/newtab/test/browser/browser_aboutwelcome_observer.js index 1f7dc7412f2e..58f9059532a3 100644 --- a/browser/components/newtab/test/browser/browser_aboutwelcome_observer.js +++ b/browser/components/newtab/test/browser/browser_aboutwelcome_observer.js @@ -1,7 +1,7 @@ "use strict"; -const { AboutWelcomeParent } = ChromeUtils.import( - "resource:///actors/AboutWelcomeParent.jsm" +const { AboutWelcomeParent } = ChromeUtils.importESModule( + "resource:///actors/AboutWelcomeParent.sys.mjs" ); async function openAboutWelcomeTab() { diff --git a/browser/modules/FeatureCallout.sys.mjs b/browser/modules/FeatureCallout.sys.mjs index c404805b23e1..29021b0c2abb 100644 --- a/browser/modules/FeatureCallout.sys.mjs +++ b/browser/modules/FeatureCallout.sys.mjs @@ -7,12 +7,12 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", PageEventManager: "resource://activity-stream/lib/PageEventManager.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutWelcomeParent: "resource:///actors/AboutWelcomeParent.jsm", ASRouter: "resource://activity-stream/lib/ASRouter.jsm", });