From a73f6ec769b22583fdd8d7f0bf702c42db133ce3 Mon Sep 17 00:00:00 2001 From: Katherine Patenio Date: Mon, 19 Jun 2023 16:46:18 +0000 Subject: [PATCH] Bug 1834831 - update imports of browser/modules JSMs r=webdriver-reviewers,perftest-reviewers,zeid,extension-reviewers,settings-reviewers,pip-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,sessionstore-reviewers,tabbrowser-reviewers,whimboo,mhowell,sgalich,robwu,sparky,Standard8,mconley,dao,sclements Differential Revision: https://phabricator.services.mozilla.com/D179169 --- browser/actors/AboutNewTabParent.sys.mjs | 5 ++- browser/actors/AboutTabCrashedParent.sys.mjs | 7 +--- browser/actors/FormValidationParent.sys.mjs | 8 ++--- browser/actors/LinkHandlerChild.sys.mjs | 8 ++--- browser/actors/WebRTCChild.sys.mjs | 2 +- browser/actors/WebRTCParent.sys.mjs | 6 +--- browser/base/content/browser-allTabsMenu.js | 8 ++--- browser/base/content/browser-places.js | 6 ++-- browser/base/content/browser.js | 32 +++++++++---------- browser/base/content/pageinfo/security.js | 4 +-- browser/base/content/tabbrowser.js | 16 +++------- browser/base/content/test/general/head.js | 12 ++----- browser/base/content/test/performance/head.js | 5 +-- browser/base/content/test/webrtc/head.js | 4 ++- browser/base/content/utilityOverlay.js | 7 ++-- browser/base/content/webrtcIndicator.js | 19 ++++------- browser/base/content/webrtcLegacyIndicator.js | 4 ++- .../components/BrowserContentHandler.sys.mjs | 8 ++--- browser/components/BrowserGlue.sys.mjs | 30 ++++++++--------- .../customizableui/CustomizableUI.sys.mjs | 7 ++-- .../customizableui/CustomizeMode.sys.mjs | 6 +--- .../SearchWidgetTracker.sys.mjs | 8 ++--- ...wser_proton_toolbar_hide_toolbarbuttons.js | 8 ++--- .../downloads/DownloadSpamProtection.sys.mjs | 7 +--- .../downloads/DownloadsCommon.sys.mjs | 5 +-- .../downloads/DownloadsTaskbar.sys.mjs | 5 +-- .../downloads/DownloadsViewUI.sys.mjs | 5 +-- .../downloads/content/allDownloadsView.js | 5 +-- .../browser_download_spam_protection.js | 5 +-- .../enterprisepolicies/tests/browser/head.js | 8 ++--- .../ExtensionControlledPopup.sys.mjs | 6 +--- .../extensions/parent/ext-browser.js | 6 +--- .../extensions/parent/ext-browserAction.js | 6 +--- .../parent/ext-chrome-settings-overrides.js | 7 +--- .../extensions/parent/ext-pageAction.js | 12 ++----- .../components/extensions/parent/ext-tabs.js | 6 +--- .../extensions/parent/ext-topSites.js | 2 +- .../extensions/parent/ext-url-overrides.js | 6 +--- .../extensions/parent/ext-windows.js | 6 +--- ...wser_ext_chrome_settings_overrides_home.js | 5 +-- .../browser_ext_url_overrides_newtab.js | 6 +--- ...test_ext_chrome_settings_overrides_home.js | 5 +-- ...st_ext_chrome_settings_overrides_update.js | 5 +-- .../test_ext_homepage_overrides_private.js | 4 ++- .../xpcshell/test_ext_pageAction_shutdown.js | 8 ++--- .../xpcshell/test_ext_settings_validate.js | 8 +++-- .../xpcshell/test_ext_url_overrides_newtab.js | 4 +-- .../test_ext_url_overrides_newtab_update.js | 4 +-- .../firefox-view-notification-manager.sys.mjs | 5 +-- .../lib/AboutWelcomeTelemetry.jsm | 4 +-- .../content-src/components/Search/Search.jsx | 2 +- .../data/content/activity-stream.bundle.js | 4 +-- .../newtab/lib/ASRouterTargeting.jsm | 6 ++-- .../newtab/lib/ASRouterTriggerListeners.jsm | 5 +-- browser/components/newtab/lib/PlacesFeed.jsm | 4 +-- .../components/newtab/lib/TelemetryFeed.jsm | 18 ++--------- .../components/newtab/lib/ToolbarBadgeHub.jsm | 2 +- .../components/newtab/lib/ToolbarPanelHub.jsm | 4 +-- .../test/browser/browser_asrouter_infobar.js | 4 +-- .../browser/browser_asrouter_targeting.js | 6 ++-- .../browser/browser_multistage_spotlight.js | 4 +-- .../browser_multistage_spotlight_telemetry.js | 4 +-- .../test/browser/browser_newtab_overrides.js | 4 +-- .../test/browser/browser_newtab_ping.js | 4 +-- .../test_AboutHomeStartupCacheWorker.js | 4 +-- .../newtab/test/xpcshell/test_AboutNewTab.js | 4 +-- .../pagedata/PageDataService.sys.mjs | 5 +-- .../components/places/Interactions.sys.mjs | 5 +-- .../components/places/PlacesUIUtils.sys.mjs | 7 ++-- .../pocket/content/pktTelemetry.sys.mjs | 8 ++--- .../preferences/dialogs/browserLanguages.js | 7 ++-- .../preferences/dialogs/clearSiteData.js | 4 +-- .../preferences/dialogs/siteDataSettings.js | 6 +--- browser/components/preferences/preferences.js | 6 +++- .../tests/browser_extension_controlled.js | 7 +--- .../sessionstore/SessionStore.sys.mjs | 9 ++---- .../syncedtabs/TabListComponent.sys.mjs | 6 ++-- .../tabunloader/content/aboutUnloads.js | 4 +-- .../components/touchbar/MacTouchBar.sys.mjs | 5 +-- .../translation/TranslationParent.jsm | 4 +-- browser/components/uitour/UITour.sys.mjs | 5 +-- .../urlbar/QuickActionsLoaderDefault.sys.mjs | 5 +-- .../components/urlbar/QuickSuggest.sys.mjs | 7 +--- browser/components/urlbar/UrlbarInput.sys.mjs | 2 +- .../UrlbarProviderContextualSearch.sys.mjs | 7 +--- .../UrlbarProviderInterventions.sys.mjs | 5 +-- .../urlbar/UrlbarProviderTopSites.sys.mjs | 5 +-- .../components/urlbar/UrlbarResult.sys.mjs | 7 +--- .../urlbar/UrlbarValueFormatter.sys.mjs | 7 +--- browser/components/urlbar/UrlbarView.sys.mjs | 4 +-- .../urlbar/tests/UrlbarTestUtils.sys.mjs | 9 ++---- .../tests/browser/browser_quickactions.js | 4 +-- .../urlbar/tests/browser/browser_top_sites.js | 5 +-- .../browser/browser_top_sites_private.js | 5 +-- .../browser_urlbar_telemetry_topsite.js | 5 +-- .../components/urlbar/tests/browser/head.js | 2 +- browser/components/urlbar/tests/ext/api.js | 5 +-- browser/modules/BrowserUsageTelemetry.sys.mjs | 5 +-- browser/modules/ContentCrashHandlers.sys.mjs | 6 +--- browser/modules/NewTabPagePreloading.sys.mjs | 7 ++-- .../modules/PartnerLinkAttribution.sys.mjs | 5 +-- browser/modules/TabUnloader.sys.mjs | 6 +--- browser/modules/URILoadingHelper.sys.mjs | 6 ++-- .../test/browser/browser_EveryWindow.js | 4 +-- .../browser/browser_HomePage_add_button.js | 8 ++--- .../test/browser/browser_PageActions.js | 2 +- .../browser_PageActions_contextMenus.js | 2 +- .../browser/browser_PageActions_newWindow.js | 2 +- .../test/browser/browser_TabUnloader.js | 4 +-- .../browser_UnsubmittedCrashHandler.js | 4 +-- .../test/browser/browser_UsageTelemetry.js | 9 +++--- ...eTelemetry_content_aboutRestartRequired.js | 4 +-- ...metry_uniqueOriginsVisitedInPast24Hours.js | 8 ++--- .../test/browser/browser_taskbar_preview.js | 4 +-- browser/modules/test/unit/test_HomePage.js | 9 +----- .../modules/test/unit/test_HomePage_ignore.js | 9 +----- .../test/unit/test_InstallationTelemetry.js | 4 +-- browser/modules/test/unit/test_LaterRun.js | 4 ++- browser/modules/test/unit/test_PingCentre.js | 4 +-- .../modules/test/unit/test_ProfileCounter.js | 4 +-- .../modules/test/unit/test_SiteDataManager.js | 4 +-- .../unit/test_SiteDataManagerContainers.js | 4 +-- browser/modules/test/unit/test_TabUnloader.js | 4 +-- browser/modules/test/unit/test_discovery.js | 4 ++- browser/modules/webrtcUI.sys.mjs | 6 +--- .../netmonitor/test/browser_net_initiator.js | 4 +-- dom/base/Document.cpp | 4 +-- .../video_engine/desktop_device_info.cc | 6 ++-- .../test/https-first/browser_slow_download.js | 4 +-- mots.yaml | 16 +++++----- .../browser/browser_add_exception_dialog.js | 4 +-- .../tests/unit/test_navigation.py | 4 +-- .../tests/unit/test_switch_window_content.py | 4 +-- .../tests/unit/test_window_close_content.py | 4 +-- .../BrowserTestUtils/BrowserTestUtils.sys.mjs | 5 +-- .../startup_test/sessionrestore/addon/api.js | 5 +-- .../startup_about_home_paint/addon/api.js | 5 +-- testing/talos/talos/talos-powers/api.js | 7 ++-- testing/talos/talos/tests/tabpaint/api.js | 6 +--- testing/talos/talos/tests/tabswitch/api.js | 8 ++--- .../talos/tests/tart/addon/content/tart.js | 8 ++--- .../actors/AboutHttpsOnlyErrorParent.sys.mjs | 2 +- toolkit/actors/NetErrorParent.sys.mjs | 7 +--- .../downloads/DownloadUIHelper.sys.mjs | 5 +-- .../extensions/WebNavigation.sys.mjs | 6 +--- .../extensions/parent/ext-browserSettings.js | 8 ++--- .../xpcshell/test_ext_eventpage_settings.js | 7 +--- .../formautofill/FormAutofillParent.sys.mjs | 5 +-- .../actions/ShowHeartbeatAction.sys.mjs | 5 +-- .../pictureinpicture/PictureInPicture.sys.mjs | 2 +- toolkit/components/places/History.cpp | 4 +-- .../app/TelemetryReportingPolicy.sys.mjs | 4 +-- .../content/widgets/browser-custom-element.js | 6 ++-- toolkit/modules/NewTabUtils.sys.mjs | 4 +-- .../mozapps/extensions/content/aboutaddons.js | 2 +- .../browser_html_discover_view_clientid.js | 2 +- .../mozapps/extensions/test/browser/head.js | 4 +-- 157 files changed, 318 insertions(+), 617 deletions(-) diff --git a/browser/actors/AboutNewTabParent.sys.mjs b/browser/actors/AboutNewTabParent.sys.mjs index 27d5f82c0c50..bb1a0b6f7141 100644 --- a/browser/actors/AboutNewTabParent.sys.mjs +++ b/browser/actors/AboutNewTabParent.sys.mjs @@ -6,8 +6,11 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", ASRouter: "resource://activity-stream/lib/ASRouter.jsm", }); diff --git a/browser/actors/AboutTabCrashedParent.sys.mjs b/browser/actors/AboutTabCrashedParent.sys.mjs index 4c11c3430d79..d24b838a23af 100644 --- a/browser/actors/AboutTabCrashedParent.sys.mjs +++ b/browser/actors/AboutTabCrashedParent.sys.mjs @@ -2,16 +2,11 @@ * 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 = {}; ChromeUtils.defineESModuleGetters(lazy, { SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", -}); - -XPCOMUtils.defineLazyModuleGetters(lazy, { - TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm", + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", }); // A list of all of the open about:tabcrashed pages. diff --git a/browser/actors/FormValidationParent.sys.mjs b/browser/actors/FormValidationParent.sys.mjs index 6c23a28097a8..e95a8e86fb7f 100644 --- a/browser/actors/FormValidationParent.sys.mjs +++ b/browser/actors/FormValidationParent.sys.mjs @@ -8,11 +8,9 @@ const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", +}); class PopupShownObserver { _weakContext = null; diff --git a/browser/actors/LinkHandlerChild.sys.mjs b/browser/actors/LinkHandlerChild.sys.mjs index b65758f5d784..95c86b2d0f12 100644 --- a/browser/actors/LinkHandlerChild.sys.mjs +++ b/browser/actors/LinkHandlerChild.sys.mjs @@ -4,11 +4,9 @@ const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "FaviconLoader", - "resource:///modules/FaviconLoader.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + FaviconLoader: "resource:///modules/FaviconLoader.sys.mjs", +}); export class LinkHandlerChild extends JSWindowActorChild { constructor() { diff --git a/browser/actors/WebRTCChild.sys.mjs b/browser/actors/WebRTCChild.sys.mjs index 5fd372c705fb..2d966e0a1aea 100644 --- a/browser/actors/WebRTCChild.sys.mjs +++ b/browser/actors/WebRTCChild.sys.mjs @@ -381,7 +381,7 @@ function prompt( // then chose to just build their own prompting mechanism instead. // // So, what you are looking at here is not a real nsIContentPermissionRequest, but - // something that looks really similar and will be transmitted to webrtcUI.jsm + // something that looks really similar and will be transmitted to webrtcUI.sys.mjs // for showing the prompt. // Note that we basically do the permission delegate check in // nsIContentPermissionRequest, but because webrtc uses their own prompting diff --git a/browser/actors/WebRTCParent.sys.mjs b/browser/actors/WebRTCParent.sys.mjs index 7283378f3265..bcee0e8b11c2 100644 --- a/browser/actors/WebRTCParent.sys.mjs +++ b/browser/actors/WebRTCParent.sys.mjs @@ -9,12 +9,8 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", SitePermissions: "resource:///modules/SitePermissions.sys.mjs", + webrtcUI: "resource:///modules/webrtcUI.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "webrtcUI", - "resource:///modules/webrtcUI.jsm" -); XPCOMUtils.defineLazyServiceGetter( lazy, diff --git a/browser/base/content/browser-allTabsMenu.js b/browser/base/content/browser-allTabsMenu.js index 324c5d95ab64..b8a8e3a75981 100644 --- a/browser/base/content/browser-allTabsMenu.js +++ b/browser/base/content/browser-allTabsMenu.js @@ -5,11 +5,9 @@ // This file is loaded into the browser window scope. /* eslint-env mozilla/browser-window */ -ChromeUtils.defineModuleGetter( - this, - "TabsPanel", - "resource:///modules/TabsList.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + TabsPanel: "resource:///modules/TabsList.sys.mjs", +}); var gTabsPanel = { kElements: { diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 0179246f1f8e..afdc718b67ef 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -1394,9 +1394,11 @@ var BookmarkingUI = { }, isOnNewTabPage({ currentURI }) { - // Prevent loading AboutNewTab.jsm during startup path if it + // Prevent loading AboutNewTab.sys.mjs during startup path if it // is only the newTabURL getter we are interested in. - let newTabURL = Cu.isModuleLoaded("resource:///modules/AboutNewTab.jsm") + let newTabURL = Cu.isESModuleLoaded( + "resource:///modules/AboutNewTab.sys.mjs" + ) ? AboutNewTab.newTabURL : "about:newtab"; // Don't treat a custom "about:blank" new tab URL as the "New Tab Page" diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 5fabca98dc33..9c5d94fef293 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -15,10 +15,14 @@ ChromeUtils.importESModule("resource://gre/modules/NotificationDB.sys.mjs"); ChromeUtils.defineESModuleGetters(this, { AMTelemetry: "resource://gre/modules/AddonManager.sys.mjs", + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs", AddonManager: "resource://gre/modules/AddonManager.sys.mjs", BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", BrowserTelemetryUtils: "resource://gre/modules/BrowserTelemetryUtils.sys.mjs", + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", Color: "resource://gre/modules/Color.sys.mjs", ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.sys.mjs", @@ -29,8 +33,10 @@ ChromeUtils.defineESModuleGetters(this, { DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", + ExtensionsUI: "resource:///modules/ExtensionsUI.sys.mjs", FirefoxViewNotificationManager: "resource:///modules/firefox-view-notification-manager.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", LightweightThemeConsumer: "resource://gre/modules/LightweightThemeConsumer.sys.mjs", Log: "resource://gre/modules/Log.sys.mjs", @@ -38,8 +44,11 @@ ChromeUtils.defineESModuleGetters(this, { LoginManagerParent: "resource://gre/modules/LoginManagerParent.sys.mjs", MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs", NetUtil: "resource://gre/modules/NetUtil.sys.mjs", + NewTabPagePreloading: "resource:///modules/NewTabPagePreloading.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", + OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.sys.mjs", + PageActions: "resource:///modules/PageActions.sys.mjs", PageThumbs: "resource://gre/modules/PageThumbs.sys.mjs", PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs", PanelView: "resource:///modules/PanelMultiView.sys.mjs", @@ -50,6 +59,7 @@ ChromeUtils.defineESModuleGetters(this, { PluralForm: "resource://gre/modules/PluralForm.sys.mjs", Pocket: "chrome://pocket/content/Pocket.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", + ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", PromptUtils: "resource://gre/modules/PromptUtils.sys.mjs", ReaderMode: "resource://gre/modules/ReaderMode.sys.mjs", @@ -61,9 +71,11 @@ ChromeUtils.defineESModuleGetters(this, { SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", + SiteDataManager: "resource:///modules/SiteDataManager.sys.mjs", SitePermissions: "resource:///modules/SitePermissions.sys.mjs", SubDialog: "resource://gre/modules/SubDialog.sys.mjs", SubDialogManager: "resource://gre/modules/SubDialog.sys.mjs", + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", TabModalPrompt: "chrome://global/content/tabprompts.sys.mjs", TabsSetupFlowManager: "resource:///modules/firefox-view-tabs-setup-manager.sys.mjs", @@ -80,26 +92,14 @@ ChromeUtils.defineESModuleGetters(this, { UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.sys.mjs", Weave: "resource://services-sync/main.sys.mjs", WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.sys.mjs", + webrtcUI: "resource:///modules/webrtcUI.sys.mjs", WebsiteFilter: "resource:///modules/policies/WebsiteFilter.sys.mjs", + ZoomUI: "resource:///modules/ZoomUI.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - NewTabPagePreloading: "resource:///modules/NewTabPagePreloading.jsm", - BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", - BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", CFRPageActions: "resource://activity-stream/lib/CFRPageActions.jsm", - ExtensionsUI: "resource:///modules/ExtensionsUI.jsm", - HomePage: "resource:///modules/HomePage.jsm", - OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm", - PageActions: "resource:///modules/PageActions.jsm", - ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm", - SiteDataManager: "resource:///modules/SiteDataManager.jsm", - TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm", Translation: "resource:///modules/translation/TranslationParent.jsm", - webrtcUI: "resource:///modules/webrtcUI.jsm", - ZoomUI: "resource:///modules/ZoomUI.jsm", }); XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => { @@ -479,8 +479,8 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", () => { WINTASKBAR_CONTRACTID in Cc && Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available ) { - let { AeroPeek } = ChromeUtils.import( - "resource:///modules/WindowsPreviewPerTab.jsm" + let { AeroPeek } = ChromeUtils.importESModule( + "resource:///modules/WindowsPreviewPerTab.sys.mjs" ); return { onOpenWindow() { diff --git a/browser/base/content/pageinfo/security.js b/browser/base/content/pageinfo/security.js index e4d52f889fac..3c19c7f7650e 100644 --- a/browser/base/content/pageinfo/security.js +++ b/browser/base/content/pageinfo/security.js @@ -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/. */ -const { SiteDataManager } = ChromeUtils.import( - "resource:///modules/SiteDataManager.jsm" +const { SiteDataManager } = ChromeUtils.importESModule( + "resource:///modules/SiteDataManager.sys.mjs" ); const { DownloadUtils } = ChromeUtils.importESModule( "resource://gre/modules/DownloadUtils.sys.mjs" diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index 6944ce69edf2..06d31ea7e7ef 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -80,15 +80,11 @@ window._gBrowser = { init() { - ChromeUtils.defineModuleGetter( - this, - "AsyncTabSwitcher", - "resource:///modules/AsyncTabSwitcher.jsm" - ); ChromeUtils.defineESModuleGetters(this, { + AsyncTabSwitcher: "resource:///modules/AsyncTabSwitcher.sys.mjs", + PictureInPicture: "resource://gre/modules/PictureInPicture.sys.mjs", UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.sys.mjs", - PictureInPicture: "resource://gre/modules/PictureInPicture.sys.mjs", }); XPCOMUtils.defineLazyServiceGetters(this, { MacSharingService: [ @@ -104,11 +100,9 @@ }); if (AppConstants.MOZ_CRASHREPORTER) { - ChromeUtils.defineModuleGetter( - this, - "TabCrashHandler", - "resource:///modules/ContentCrashHandlers.jsm" - ); + ChromeUtils.defineESModuleGetters(this, { + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", + }); } Services.obs.addObserver(this, "contextual-identity-updated"); diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js index fc3d2be19fbe..f44d74b96092 100644 --- a/browser/base/content/test/general/head.js +++ b/browser/base/content/test/general/head.js @@ -1,17 +1,9 @@ -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "TabCrashHandler", - "resource:///modules/ContentCrashHandlers.jsm" -); /** * Wait for a to be closed then call the specified callback. diff --git a/browser/base/content/test/performance/head.js b/browser/base/content/test/performance/head.js index bcfe4ba9be94..90499ae1599b 100644 --- a/browser/base/content/test/performance/head.js +++ b/browser/base/content/test/performance/head.js @@ -1,16 +1,13 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", PerfTestHelpers: "resource://testing-common/PerfTestHelpers.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", -}); - /** * This function can be called if the test needs to trigger frame dirtying * outside of the normal mechanism. diff --git a/browser/base/content/test/webrtc/head.js b/browser/base/content/test/webrtc/head.js index 13526e91b6e3..22cc6f27e1c1 100644 --- a/browser/base/content/test/webrtc/head.js +++ b/browser/base/content/test/webrtc/head.js @@ -94,7 +94,9 @@ function promiseIndicatorWindow() { } async function assertWebRTCIndicatorStatus(expected) { - let ui = ChromeUtils.import("resource:///modules/webrtcUI.jsm").webrtcUI; + let ui = ChromeUtils.importESModule( + "resource:///modules/webrtcUI.sys.mjs" + ).webrtcUI; let expectedState = expected ? "visible" : "hidden"; let msg = "WebRTC indicator " + expectedState; if (!expected && ui.showGlobalIndicator) { diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index fb9b1672c8fe..71c683b0e2fe 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -12,7 +12,9 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.sys.mjs", ExtensionSettingsStore: @@ -22,11 +24,6 @@ ChromeUtils.defineESModuleGetters(this, { URILoadingHelper: "resource:///modules/URILoadingHelper.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () => Components.Constructor( "@mozilla.org/referrer-info;1", diff --git a/browser/base/content/webrtcIndicator.js b/browser/base/content/webrtcIndicator.js index ba817f5561fc..90c16de9b352 100644 --- a/browser/base/content/webrtcIndicator.js +++ b/browser/base/content/webrtcIndicator.js @@ -8,21 +8,14 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs" ); -const { showStreamSharingMenu, webrtcUI } = ChromeUtils.import( - "resource:///modules/webrtcUI.jsm" +const { showStreamSharingMenu, webrtcUI } = ChromeUtils.importESModule( + "resource:///modules/webrtcUI.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "MacOSWebRTCStatusbarIndicator", - "resource:///modules/webrtcUI.jsm" -); - -ChromeUtils.defineModuleGetter( - this, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", + MacOSWebRTCStatusbarIndicator: "resource:///modules/webrtcUI.sys.mjs", +}); XPCOMUtils.defineLazyServiceGetter( this, diff --git a/browser/base/content/webrtcLegacyIndicator.js b/browser/base/content/webrtcLegacyIndicator.js index e75b4f3dab6f..76914d272033 100644 --- a/browser/base/content/webrtcLegacyIndicator.js +++ b/browser/base/content/webrtcLegacyIndicator.js @@ -2,7 +2,9 @@ * 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/. */ -const { webrtcUI } = ChromeUtils.import("resource:///modules/webrtcUI.jsm"); +const { webrtcUI } = ChromeUtils.importESModule( + "resource:///modules/webrtcUI.sys.mjs" +); function init(event) { for (let id of ["audioVideoButton", "screenSharePopup"]) { diff --git a/browser/components/BrowserContentHandler.sys.mjs b/browser/components/BrowserContentHandler.sys.mjs index 340f36014b00..37c66beb015c 100644 --- a/browser/components/BrowserContentHandler.sys.mjs +++ b/browser/components/BrowserContentHandler.sys.mjs @@ -8,8 +8,11 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", FirstStartup: "resource://gre/modules/FirstStartup.sys.mjs", HeadlessShell: "resource:///modules/HeadlessShell.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", + LaterRun: "resource:///modules/LaterRun.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", @@ -17,11 +20,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UpdatePing: "resource://gre/modules/UpdatePing.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - HomePage: "resource:///modules/HomePage.jsm", - LaterRun: "resource:///modules/LaterRun.jsm", -}); XPCOMUtils.defineLazyServiceGetters(lazy, { UpdateManager: ["@mozilla.org/updates/update-manager;1", "nsIUpdateManager"], WinTaskbar: ["@mozilla.org/windows-taskbar;1", "nsIWinTaskbar"], diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs index 215418f23a7d..4b1104d4ad49 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -10,6 +10,7 @@ const lazy = {}; // Ignore unused lazy property for PluginManager. // eslint-disable-next-line mozilla/valid-lazy ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ASRouterNewTabHook: "resource://activity-stream/lib/ASRouterNewTabHook.sys.mjs", ActorManagerParent: "resource://gre/modules/ActorManagerParent.sys.mjs", @@ -20,18 +21,24 @@ ChromeUtils.defineESModuleGetters(lazy, { BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.sys.mjs", BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.sys.mjs", BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.sys.mjs", Corroborate: "resource://gre/modules/Corroborate.sys.mjs", DAPTelemetrySender: "resource://gre/modules/DAPTelemetrySender.sys.mjs", DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", + Discovery: "resource:///modules/Discovery.sys.mjs", DoHController: "resource:///modules/DoHController.sys.mjs", DownloadsViewableInternally: "resource:///modules/DownloadsViewableInternally.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", + ExtensionsUI: "resource:///modules/ExtensionsUI.sys.mjs", FeatureGate: "resource://featuregates/FeatureGate.sys.mjs", FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", Integration: "resource://gre/modules/Integration.sys.mjs", Interactions: "resource:///modules/Interactions.sys.mjs", Log: "resource://gre/modules/Log.sys.mjs", @@ -42,6 +49,7 @@ ChromeUtils.defineESModuleGetters(lazy, { NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", Normandy: "resource://normandy/Normandy.sys.mjs", OsEnvironment: "resource://gre/modules/OsEnvironment.sys.mjs", + PageActions: "resource:///modules/PageActions.sys.mjs", PageDataService: "resource:///modules/pagedata/PageDataService.sys.mjs", PageThumbs: "resource://gre/modules/PageThumbs.sys.mjs", PdfJs: "resource://pdf.js/PdfJs.sys.mjs", @@ -52,6 +60,7 @@ ChromeUtils.defineESModuleGetters(lazy, { PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", PluginManager: "resource:///actors/PluginParent.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", + ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.sys.mjs", ProvenanceData: "resource:///modules/ProvenanceData.sys.mjs", PublicSuffixList: "resource://gre/modules/netwerk-dns/PublicSuffixList.sys.mjs", @@ -72,6 +81,8 @@ ChromeUtils.defineESModuleGetters(lazy, { SpecialMessageActions: "resource://messaging-system/lib/SpecialMessageActions.sys.mjs", TRRRacer: "resource:///modules/TRRPerformance.sys.mjs", + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", + TabUnloader: "resource:///modules/TabUnloader.sys.mjs", TelemetryUtils: "resource://gre/modules/TelemetryUtils.sys.mjs", UIState: "resource://services-sync/UIState.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", @@ -82,22 +93,11 @@ ChromeUtils.defineESModuleGetters(lazy, { }); XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", ASRouterDefaultConfig: "resource://activity-stream/lib/ASRouterDefaultConfig.jsm", ASRouter: "resource://activity-stream/lib/ASRouter.jsm", - BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", - BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - Discovery: "resource:///modules/Discovery.jsm", - ExtensionsUI: "resource:///modules/ExtensionsUI.jsm", - HomePage: "resource:///modules/HomePage.jsm", OnboardingMessageProvider: "resource://activity-stream/lib/OnboardingMessageProvider.jsm", - PageActions: "resource:///modules/PageActions.jsm", - ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm", - TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm", - TabUnloader: "resource:///modules/TabUnloader.jsm", }); if (AppConstants.MOZ_UPDATER) { @@ -820,8 +820,8 @@ XPCOMUtils.defineLazyGetter( ); if (AppConstants.MOZ_CRASHREPORTER) { - XPCOMUtils.defineLazyModuleGetters(lazy, { - UnsubmittedCrashHandler: "resource:///modules/ContentCrashHandlers.jsm", + ChromeUtils.defineESModuleGetters(lazy, { + UnsubmittedCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", }); } @@ -2563,8 +2563,8 @@ BrowserGlue.prototype = { WINTASKBAR_CONTRACTID in Cc && Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available ) { - const { WinTaskbarJumpList } = ChromeUtils.import( - "resource:///modules/WindowsJumpLists.jsm" + const { WinTaskbarJumpList } = ChromeUtils.importESModule( + "resource:///modules/WindowsJumpLists.sys.mjs" ); WinTaskbarJumpList.startup(); } diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs index 557bca4be60e..e7ce84c0d6b0 100644 --- a/browser/components/customizableui/CustomizableUI.sys.mjs +++ b/browser/components/customizableui/CustomizableUI.sys.mjs @@ -11,17 +11,14 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", AddonManagerPrivate: "resource://gre/modules/AddonManager.sys.mjs", + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", CustomizableWidgets: "resource:///modules/CustomizableWidgets.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", - HomePage: "resource:///modules/HomePage.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "gWidgetsBundle", function () { const kUrl = "chrome://browser/locale/customizableui/customizableWidgets.properties"; diff --git a/browser/components/customizableui/CustomizeMode.sys.mjs b/browser/components/customizableui/CustomizeMode.sys.mjs index 86c5e1b786b1..22ba750f71e3 100644 --- a/browser/components/customizableui/CustomizeMode.sys.mjs +++ b/browser/components/customizableui/CustomizeMode.sys.mjs @@ -26,15 +26,11 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", DragPositionManager: "resource:///modules/DragPositionManager.sys.mjs", SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", URILoadingHelper: "resource:///modules/URILoadingHelper.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "BrowserUsageTelemetry", - "resource:///modules/BrowserUsageTelemetry.jsm" -); XPCOMUtils.defineLazyGetter(lazy, "gWidgetsBundle", function () { const kUrl = "chrome://browser/locale/customizableui/customizableWidgets.properties"; diff --git a/browser/components/customizableui/SearchWidgetTracker.sys.mjs b/browser/components/customizableui/SearchWidgetTracker.sys.mjs index 64d7720349fa..00deb3870f95 100644 --- a/browser/components/customizableui/SearchWidgetTracker.sys.mjs +++ b/browser/components/customizableui/SearchWidgetTracker.sys.mjs @@ -12,11 +12,9 @@ import { CustomizableUI } from "resource:///modules/CustomizableUI.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "BrowserUsageTelemetry", - "resource:///modules/BrowserUsageTelemetry.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", +}); const WIDGET_ID = "search-container"; const PREF_NAME = "browser.search.widget.inNavBar"; diff --git a/browser/components/customizableui/test/browser_proton_toolbar_hide_toolbarbuttons.js b/browser/components/customizableui/test/browser_proton_toolbar_hide_toolbarbuttons.js index ef0a44d6b1fd..ac46fd12ae59 100644 --- a/browser/components/customizableui/test/browser_proton_toolbar_hide_toolbarbuttons.js +++ b/browser/components/customizableui/test/browser_proton_toolbar_hide_toolbarbuttons.js @@ -4,11 +4,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "HomePage", - "resource:///modules/HomePage.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", +}); const kPrefProtonToolbarVersion = "browser.proton.toolbar.version"; const kPrefHomeButtonUsed = "browser.engagement.home-button.has-used"; diff --git a/browser/components/downloads/DownloadSpamProtection.sys.mjs b/browser/components/downloads/DownloadSpamProtection.sys.mjs index fa0cb974769a..a05c508e628f 100644 --- a/browser/components/downloads/DownloadSpamProtection.sys.mjs +++ b/browser/components/downloads/DownloadSpamProtection.sys.mjs @@ -11,20 +11,15 @@ import { DownloadError, } from "resource://gre/modules/DownloadCore.sys.mjs"; -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", DownloadList: "resource://gre/modules/DownloadList.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - /** * Each window tracks download spam independently, so one of these objects is * constructed for each window. This is responsible for tracking the spam and diff --git a/browser/components/downloads/DownloadsCommon.sys.mjs b/browser/components/downloads/DownloadsCommon.sys.mjs index 9597fbc71acf..0b9aa711fe62 100644 --- a/browser/components/downloads/DownloadsCommon.sys.mjs +++ b/browser/components/downloads/DownloadsCommon.sys.mjs @@ -31,6 +31,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs", DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", @@ -39,10 +40,6 @@ ChromeUtils.defineESModuleGetters(lazy, { PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyServiceGetters(lazy, { gClipboardHelper: [ "@mozilla.org/widget/clipboardhelper;1", diff --git a/browser/components/downloads/DownloadsTaskbar.sys.mjs b/browser/components/downloads/DownloadsTaskbar.sys.mjs index 64029ae5435e..1db4c70efd6a 100644 --- a/browser/components/downloads/DownloadsTaskbar.sys.mjs +++ b/browser/components/downloads/DownloadsTaskbar.sys.mjs @@ -15,13 +15,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "gWinTaskbar", function () { if (!("@mozilla.org/windows-taskbar;1" in Cc)) { return null; diff --git a/browser/components/downloads/DownloadsViewUI.sys.mjs b/browser/components/downloads/DownloadsViewUI.sys.mjs index 0e0f5a7af3cb..9c6bd17d63a4 100644 --- a/browser/components/downloads/DownloadsViewUI.sys.mjs +++ b/browser/components/downloads/DownloadsViewUI.sys.mjs @@ -12,6 +12,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", @@ -19,10 +20,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyServiceGetter( lazy, "handlerSvc", diff --git a/browser/components/downloads/content/allDownloadsView.js b/browser/components/downloads/content/allDownloadsView.js index 451250c64f8f..b42e4ec1187e 100644 --- a/browser/components/downloads/content/allDownloadsView.js +++ b/browser/components/downloads/content/allDownloadsView.js @@ -8,6 +8,7 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", @@ -16,10 +17,6 @@ ChromeUtils.defineESModuleGetters(this, { PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - /** * A download element shell is responsible for handling the commands and the * displayed data for a single download view element. diff --git a/browser/components/downloads/test/browser/browser_download_spam_protection.js b/browser/components/downloads/test/browser/browser_download_spam_protection.js index 8095fff18e3f..ce2c64a799a7 100644 --- a/browser/components/downloads/test/browser/browser_download_spam_protection.js +++ b/browser/components/downloads/test/browser/browser_download_spam_protection.js @@ -5,14 +5,11 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", DownloadSpamProtection: "resource:///modules/DownloadSpamProtection.sys.mjs", PermissionTestUtils: "resource://testing-common/PermissionTestUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - const TEST_URI = "https://example.com"; const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/browser/components/enterprisepolicies/tests/browser/head.js b/browser/components/enterprisepolicies/tests/browser/head.js index b1b5207f1d78..751ad8146114 100644 --- a/browser/components/enterprisepolicies/tests/browser/head.js +++ b/browser/components/enterprisepolicies/tests/browser/head.js @@ -9,11 +9,9 @@ const { EnterprisePolicyTesting, PoliciesPrefTracker } = "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "HomePage", - "resource:///modules/HomePage.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", +}); PoliciesPrefTracker.start(); diff --git a/browser/components/extensions/ExtensionControlledPopup.sys.mjs b/browser/components/extensions/ExtensionControlledPopup.sys.mjs index 35eefc4c1bf8..d697c42eb552 100644 --- a/browser/components/extensions/ExtensionControlledPopup.sys.mjs +++ b/browser/components/extensions/ExtensionControlledPopup.sys.mjs @@ -19,13 +19,9 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "BrowserUIUtils", - "resource:///modules/BrowserUIUtils.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", diff --git a/browser/components/extensions/parent/ext-browser.js b/browser/components/extensions/parent/ext-browser.js index c7fc36b5bbaf..6f377471b00a 100644 --- a/browser/components/extensions/parent/ext-browser.js +++ b/browser/components/extensions/parent/ext-browser.js @@ -12,14 +12,10 @@ ChromeUtils.defineESModuleGetters(this, { AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); var { ExtensionError } = ExtensionUtils; diff --git a/browser/components/extensions/parent/ext-browserAction.js b/browser/components/extensions/parent/ext-browserAction.js index d18168ea1671..6ecfd8cbbe04 100644 --- a/browser/components/extensions/parent/ext-browserAction.js +++ b/browser/components/extensions/parent/ext-browserAction.js @@ -7,6 +7,7 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", ExtensionTelemetry: "resource://gre/modules/ExtensionTelemetry.sys.mjs", OriginControls: "resource://gre/modules/ExtensionPermissions.sys.mjs", @@ -14,11 +15,6 @@ ChromeUtils.defineESModuleGetters(this, { clearTimeout: "resource://gre/modules/Timer.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "BrowserUsageTelemetry", - "resource:///modules/BrowserUsageTelemetry.jsm" -); var { DefaultWeakMap, ExtensionError } = ExtensionUtils; diff --git a/browser/components/extensions/parent/ext-chrome-settings-overrides.js b/browser/components/extensions/parent/ext-chrome-settings-overrides.js index f5bbd8131012..3cfca2c98b79 100644 --- a/browser/components/extensions/parent/ext-chrome-settings-overrides.js +++ b/browser/components/extensions/parent/ext-chrome-settings-overrides.js @@ -17,14 +17,9 @@ ChromeUtils.defineESModuleGetters(this, { ExtensionPermissions: "resource://gre/modules/ExtensionPermissions.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "HomePage", - "resource:///modules/HomePage.jsm" -); - const DEFAULT_SEARCH_STORE_TYPE = "default_search"; const DEFAULT_SEARCH_SETTING_NAME = "defaultSearch"; diff --git a/browser/components/extensions/parent/ext-pageAction.js b/browser/components/extensions/parent/ext-pageAction.js index bfd8d14fd233..aa45be825631 100644 --- a/browser/components/extensions/parent/ext-pageAction.js +++ b/browser/components/extensions/parent/ext-pageAction.js @@ -7,19 +7,11 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", ExtensionTelemetry: "resource://gre/modules/ExtensionTelemetry.sys.mjs", + PageActions: "resource:///modules/PageActions.sys.mjs", PanelPopup: "resource:///modules/ExtensionPopups.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "PageActions", - "resource:///modules/PageActions.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "BrowserUsageTelemetry", - "resource:///modules/BrowserUsageTelemetry.jsm" -); var { DefaultWeakMap } = ExtensionUtils; diff --git a/browser/components/extensions/parent/ext-tabs.js b/browser/components/extensions/parent/ext-tabs.js index 33aec14bc143..09507b6060f9 100644 --- a/browser/components/extensions/parent/ext-tabs.js +++ b/browser/components/extensions/parent/ext-tabs.js @@ -6,12 +6,8 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "BrowserUIUtils", - "resource:///modules/BrowserUIUtils.jsm" -); ChromeUtils.defineESModuleGetters(this, { + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", ExtensionControlledPopup: "resource:///modules/ExtensionControlledPopup.sys.mjs", diff --git a/browser/components/extensions/parent/ext-topSites.js b/browser/components/extensions/parent/ext-topSites.js index 76a815f1ef12..5c127e7b2999 100644 --- a/browser/components/extensions/parent/ext-topSites.js +++ b/browser/components/extensions/parent/ext-topSites.js @@ -7,12 +7,12 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", getSearchProvider: "resource://activity-stream/lib/SearchShortcuts.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", shortURL: "resource://activity-stream/lib/ShortURL.jsm", }); diff --git a/browser/components/extensions/parent/ext-url-overrides.js b/browser/components/extensions/parent/ext-url-overrides.js index 9e9380bb49ef..fec1fdf4f2ee 100644 --- a/browser/components/extensions/parent/ext-url-overrides.js +++ b/browser/components/extensions/parent/ext-url-overrides.js @@ -9,16 +9,12 @@ var { ExtensionParent } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ExtensionControlledPopup: "resource:///modules/ExtensionControlledPopup.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); const STORE_TYPE = "url_overrides"; const NEW_TAB_SETTING_NAME = "newTabURL"; diff --git a/browser/components/extensions/parent/ext-windows.js b/browser/components/extensions/parent/ext-windows.js index 3237c9b92424..e310e0777b73 100644 --- a/browser/components/extensions/parent/ext-windows.js +++ b/browser/components/extensions/parent/ext-windows.js @@ -6,12 +6,8 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "HomePage", - "resource:///modules/HomePage.jsm" -); ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); diff --git a/browser/components/extensions/test/browser/browser_ext_chrome_settings_overrides_home.js b/browser/components/extensions/test/browser/browser_ext_chrome_settings_overrides_home.js index ff195d495a43..b67952c03c90 100644 --- a/browser/components/extensions/test/browser/browser_ext_chrome_settings_overrides_home.js +++ b/browser/components/extensions/test/browser/browser_ext_chrome_settings_overrides_home.js @@ -11,10 +11,7 @@ ChromeUtils.defineESModuleGetters(this, { "resource:///modules/ExtensionControlledPopup.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", -}); - -XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", + HomePage: "resource:///modules/HomePage.sys.mjs", }); // Named this way so they correspond to the extensions diff --git a/browser/components/extensions/test/browser/browser_ext_url_overrides_newtab.js b/browser/components/extensions/test/browser/browser_ext_url_overrides_newtab.js index 7d3342044b6e..92de1338417a 100644 --- a/browser/components/extensions/test/browser/browser_ext_url_overrides_newtab.js +++ b/browser/components/extensions/test/browser/browser_ext_url_overrides_newtab.js @@ -6,16 +6,12 @@ requestLongerTimeout(4); ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ExtensionControlledPopup: "resource:///modules/ExtensionControlledPopup.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); function getNotificationSetting(extensionId) { return ExtensionSettingsStore.getSetting("newTabNotification", extensionId); diff --git a/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_home.js b/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_home.js index 24ee403cb6db..d61e5b6b5ea3 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_home.js +++ b/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_home.js @@ -7,15 +7,12 @@ const { AddonTestUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs", sinon: "resource://testing-common/Sinon.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", -}); - function promisePrefChanged(expectedValue) { return TestUtils.waitForPrefChange("browser.startup.homepage", value => value.endsWith(expectedValue) diff --git a/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_update.js b/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_update.js index aed61f17ef70..8ad339896b7f 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_update.js +++ b/browser/components/extensions/test/xpcshell/test_ext_chrome_settings_overrides_update.js @@ -8,15 +8,12 @@ const { AddonTestUtils } = ChromeUtils.importESModule( ChromeUtils.defineESModuleGetters(this, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", sinon: "resource://testing-common/Sinon.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", -}); - AddonTestUtils.init(this); AddonTestUtils.overrideCertDB(); diff --git a/browser/components/extensions/test/xpcshell/test_ext_homepage_overrides_private.js b/browser/components/extensions/test/xpcshell/test_ext_homepage_overrides_private.js index edf039271282..2d2bccc1e204 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_homepage_overrides_private.js +++ b/browser/components/extensions/test/xpcshell/test_ext_homepage_overrides_private.js @@ -5,7 +5,9 @@ const { AddonTestUtils } = ChromeUtils.importESModule( "resource://testing-common/AddonTestUtils.sys.mjs" ); -const { HomePage } = ChromeUtils.import("resource:///modules/HomePage.jsm"); +const { HomePage } = ChromeUtils.importESModule( + "resource:///modules/HomePage.sys.mjs" +); const { ExtensionPermissions } = ChromeUtils.importESModule( "resource://gre/modules/ExtensionPermissions.sys.mjs" ); diff --git a/browser/components/extensions/test/xpcshell/test_ext_pageAction_shutdown.js b/browser/components/extensions/test/xpcshell/test_ext_pageAction_shutdown.js index 7326d19b554f..bd462ec9b662 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_pageAction_shutdown.js +++ b/browser/components/extensions/test/xpcshell/test_ext_pageAction_shutdown.js @@ -3,11 +3,9 @@ "use strict"; // Load lazy so we create the app info first. -ChromeUtils.defineModuleGetter( - this, - "PageActions", - "resource:///modules/PageActions.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + PageActions: "resource:///modules/PageActions.sys.mjs", +}); const { AddonTestUtils } = ChromeUtils.importESModule( "resource://testing-common/AddonTestUtils.sys.mjs" diff --git a/browser/components/extensions/test/xpcshell/test_ext_settings_validate.js b/browser/components/extensions/test/xpcshell/test_ext_settings_validate.js index edccc7d80c49..2f0d36f6e86b 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_settings_validate.js +++ b/browser/components/extensions/test/xpcshell/test_ext_settings_validate.js @@ -10,8 +10,8 @@ const { AddonManager } = ChromeUtils.importESModule( "resource://gre/modules/AddonManager.sys.mjs" ); -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); // Lazy load to avoid having Services.appinfo cached first. @@ -19,7 +19,9 @@ ChromeUtils.defineESModuleGetters(this, { ExtensionParent: "resource://gre/modules/ExtensionParent.sys.mjs", }); -const { HomePage } = ChromeUtils.import("resource:///modules/HomePage.jsm"); +const { HomePage } = ChromeUtils.importESModule( + "resource:///modules/HomePage.sys.mjs" +); AddonTestUtils.init(this); diff --git a/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab.js b/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab.js index 7abdec053168..9ea6c4eea68d 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab.js +++ b/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab.js @@ -7,8 +7,8 @@ ChromeUtils.defineESModuleGetters(this, { Management: "resource://gre/modules/Extension.sys.mjs", }); -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); const { AddonTestUtils } = ChromeUtils.importESModule( diff --git a/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab_update.js b/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab_update.js index 61d09655697e..17ee81e5efff 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab_update.js +++ b/browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab_update.js @@ -2,8 +2,8 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); const { AddonTestUtils } = ChromeUtils.importESModule( diff --git a/browser/components/firefoxview/firefox-view-notification-manager.sys.mjs b/browser/components/firefoxview/firefox-view-notification-manager.sys.mjs index 0d0d1375efe3..3f9056a7cd8c 100644 --- a/browser/components/firefoxview/firefox-view-notification-manager.sys.mjs +++ b/browser/components/firefoxview/firefox-view-notification-manager.sys.mjs @@ -14,13 +14,10 @@ const lazy = {}; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - export const FirefoxViewNotificationManager = new (class { #currentlyShowing; constructor() { diff --git a/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm b/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm index e597247e6d6f..86f96370c14c 100644 --- a/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm +++ b/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm @@ -13,12 +13,10 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AttributionCode: "resource:///modules/AttributionCode.sys.mjs", ClientID: "resource://gre/modules/ClientID.sys.mjs", + PingCentre: "resource:///modules/PingCentre.sys.mjs", TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - PingCentre: "resource:///modules/PingCentre.jsm", -}); XPCOMUtils.defineLazyPreferenceGetter( lazy, "structuredIngestionEndpointBase", diff --git a/browser/components/newtab/content-src/components/Search/Search.jsx b/browser/components/newtab/content-src/components/Search/Search.jsx index b131c884c133..693f380d7aa8 100644 --- a/browser/components/newtab/content-src/components/Search/Search.jsx +++ b/browser/components/newtab/content-src/components/Search/Search.jsx @@ -77,7 +77,7 @@ export class _Search extends React.PureComponent { onInputMount(input) { if (input) { // The "healthReportKey" and needs to be "newtab" or "abouthome" so that - // BrowserUsageTelemetry.jsm knows to handle events with this name, and + // BrowserUsageTelemetry.sys.mjs knows to handle events with this name, and // can add the appropriate telemetry probes for search. Without the correct // name, certain tests like browser_UsageTelemetry_content.js will fail // (See github ticket #2348 for more details) diff --git a/browser/components/newtab/data/content/activity-stream.bundle.js b/browser/components/newtab/data/content/activity-stream.bundle.js index e064ee4f20c8..6900fa8a2dc2 100644 --- a/browser/components/newtab/data/content/activity-stream.bundle.js +++ b/browser/components/newtab/data/content/activity-stream.bundle.js @@ -14628,7 +14628,7 @@ class _Search extends (external_React_default()).PureComponent { onInputMount(input) { if (input) { // The "healthReportKey" and needs to be "newtab" or "abouthome" so that - // BrowserUsageTelemetry.jsm knows to handle events with this name, and + // BrowserUsageTelemetry.sys.mjs knows to handle events with this name, and // can add the appropriate telemetry probes for search. Without the correct // name, certain tests like browser_UsageTelemetry_content.js will fail // (See github ticket #2348 for more details) @@ -15287,4 +15287,4 @@ function renderCache(initialState) { } NewtabRenderUtils = __webpack_exports__; /******/ })() -; \ No newline at end of file +; diff --git a/browser/components/newtab/lib/ASRouterTargeting.jsm b/browser/components/newtab/lib/ASRouterTargeting.jsm index afb121162812..dbe45598b51e 100644 --- a/browser/components/newtab/lib/ASRouterTargeting.jsm +++ b/browser/components/newtab/lib/ASRouterTargeting.jsm @@ -23,9 +23,12 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", AttributionCode: "resource:///modules/AttributionCode.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs", @@ -36,9 +39,6 @@ ChromeUtils.defineESModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, { ASRouterPreferences: "resource://activity-stream/lib/ASRouterPreferences.jsm", - HomePage: "resource:///modules/HomePage.jsm", - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", }); XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { diff --git a/browser/components/newtab/lib/ASRouterTriggerListeners.jsm b/browser/components/newtab/lib/ASRouterTriggerListeners.jsm index 6f3ddd32ca1e..87245068c013 100644 --- a/browser/components/newtab/lib/ASRouterTriggerListeners.jsm +++ b/browser/components/newtab/lib/ASRouterTriggerListeners.jsm @@ -12,15 +12,12 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs", BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", + EveryWindow: "resource:///modules/EveryWindow.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", clearTimeout: "resource://gre/modules/Timer.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - EveryWindow: "resource:///modules/EveryWindow.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "log", () => { const { Logger } = ChromeUtils.importESModule( "resource://messaging-system/lib/Logger.sys.mjs" diff --git a/browser/components/newtab/lib/PlacesFeed.jsm b/browser/components/newtab/lib/PlacesFeed.jsm index 19dcfbdfde51..a446e8111881 100644 --- a/browser/components/newtab/lib/PlacesFeed.jsm +++ b/browser/components/newtab/lib/PlacesFeed.jsm @@ -13,8 +13,8 @@ const { const { shortURL } = ChromeUtils.import( "resource://activity-stream/lib/ShortURL.jsm" ); -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); const lazy = {}; diff --git a/browser/components/newtab/lib/TelemetryFeed.jsm b/browser/components/newtab/lib/TelemetryFeed.jsm index 653603d80912..8aebe9acbdda 100644 --- a/browser/components/newtab/lib/TelemetryFeed.jsm +++ b/browser/components/newtab/lib/TelemetryFeed.jsm @@ -23,22 +23,15 @@ const { classifySite } = ChromeUtils.import( const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); -ChromeUtils.defineModuleGetter( - lazy, - "PingCentre", - "resource:///modules/PingCentre.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ClientID: "resource://gre/modules/ClientID.sys.mjs", ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", + PingCentre: "resource:///modules/PingCentre.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs", TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs", @@ -46,11 +39,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UpdateUtils: "resource://gre/modules/UpdateUtils.sys.mjs", pktApi: "chrome://pocket/content/pktApi.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "HomePage", - "resource:///modules/HomePage.jsm" -); XPCOMUtils.defineLazyModuleGetters(lazy, { AboutWelcomeTelemetry: "resource://activity-stream/aboutwelcome/lib/AboutWelcomeTelemetry.jsm", diff --git a/browser/components/newtab/lib/ToolbarBadgeHub.jsm b/browser/components/newtab/lib/ToolbarBadgeHub.jsm index f403ca918687..ed5c9100db3c 100644 --- a/browser/components/newtab/lib/ToolbarBadgeHub.jsm +++ b/browser/components/newtab/lib/ToolbarBadgeHub.jsm @@ -10,6 +10,7 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + EveryWindow: "resource:///modules/EveryWindow.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", clearTimeout: "resource://gre/modules/Timer.sys.mjs", requestIdleCallback: "resource://gre/modules/Timer.sys.mjs", @@ -17,7 +18,6 @@ ChromeUtils.defineESModuleGetters(lazy, { }); XPCOMUtils.defineLazyModuleGetters(lazy, { - EveryWindow: "resource:///modules/EveryWindow.jsm", ToolbarPanelHub: "resource://activity-stream/lib/ToolbarPanelHub.jsm", }); diff --git a/browser/components/newtab/lib/ToolbarPanelHub.jsm b/browser/components/newtab/lib/ToolbarPanelHub.jsm index 69add79a7ea2..7a6638f9f399 100644 --- a/browser/components/newtab/lib/ToolbarPanelHub.jsm +++ b/browser/components/newtab/lib/ToolbarPanelHub.jsm @@ -9,6 +9,7 @@ const { XPCOMUtils } = ChromeUtils.importESModule( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + EveryWindow: "resource:///modules/EveryWindow.sys.mjs", PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", RemoteL10n: "resource://activity-stream/lib/RemoteL10n.sys.mjs", @@ -17,9 +18,6 @@ ChromeUtils.defineESModuleGetters(lazy, { "resource://messaging-system/lib/SpecialMessageActions.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - EveryWindow: "resource:///modules/EveryWindow.jsm", -}); XPCOMUtils.defineLazyServiceGetter( lazy, "TrackingDBService", diff --git a/browser/components/newtab/test/browser/browser_asrouter_infobar.js b/browser/components/newtab/test/browser/browser_asrouter_infobar.js index dbbc86bb3ad7..f72ffe520c40 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_infobar.js +++ b/browser/components/newtab/test/browser/browser_asrouter_infobar.js @@ -12,8 +12,8 @@ const { CFRMessageProvider } = ChromeUtils.importESModule( const { ASRouter } = ChromeUtils.import( "resource://activity-stream/lib/ASRouter.jsm" ); -const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" +const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); add_task(async function show_and_send_telemetry() { diff --git a/browser/components/newtab/test/browser/browser_asrouter_targeting.js b/browser/components/newtab/test/browser/browser_asrouter_targeting.js index 21429f5bd32e..c7bd797b624a 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_targeting.js +++ b/browser/components/newtab/test/browser/browser_asrouter_targeting.js @@ -1,21 +1,21 @@ XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", ASRouterTargeting: "resource://activity-stream/lib/ASRouterTargeting.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - HomePage: "resource:///modules/HomePage.jsm", QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm", }); ChromeUtils.defineESModuleGetters(this, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", AddonTestUtils: "resource://testing-common/AddonTestUtils.sys.mjs", + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", AppConstants: "resource://gre/modules/AppConstants.sys.mjs", AttributionCode: "resource:///modules/AttributionCode.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", CFRMessageProvider: "resource://activity-stream/lib/CFRMessageProvider.sys.mjs", ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs", ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs", FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", diff --git a/browser/components/newtab/test/browser/browser_multistage_spotlight.js b/browser/components/newtab/test/browser/browser_multistage_spotlight.js index bbaf64a9e330..139c53bbbad7 100644 --- a/browser/components/newtab/test/browser/browser_multistage_spotlight.js +++ b/browser/components/newtab/test/browser/browser_multistage_spotlight.js @@ -9,8 +9,8 @@ const { Spotlight } = ChromeUtils.import( const { PanelTestProvider } = ChromeUtils.importESModule( "resource://activity-stream/lib/PanelTestProvider.sys.mjs" ); -const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" +const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); const { SpecialMessageActions } = ChromeUtils.importESModule( "resource://messaging-system/lib/SpecialMessageActions.sys.mjs" diff --git a/browser/components/newtab/test/browser/browser_multistage_spotlight_telemetry.js b/browser/components/newtab/test/browser/browser_multistage_spotlight_telemetry.js index 0726d58d36ab..7c948759851b 100644 --- a/browser/components/newtab/test/browser/browser_multistage_spotlight_telemetry.js +++ b/browser/components/newtab/test/browser/browser_multistage_spotlight_telemetry.js @@ -6,8 +6,8 @@ const { Spotlight } = ChromeUtils.import( const { PanelTestProvider } = ChromeUtils.importESModule( "resource://activity-stream/lib/PanelTestProvider.sys.mjs" ); -const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" +const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); const { AboutWelcomeTelemetry } = ChromeUtils.import( diff --git a/browser/components/newtab/test/browser/browser_newtab_overrides.js b/browser/components/newtab/test/browser/browser_newtab_overrides.js index ce7d82881ff3..b71ddf085c52 100644 --- a/browser/components/newtab/test/browser/browser_newtab_overrides.js +++ b/browser/components/newtab/test/browser/browser_newtab_overrides.js @@ -1,7 +1,7 @@ "use strict"; -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); registerCleanupFunction(() => { diff --git a/browser/components/newtab/test/browser/browser_newtab_ping.js b/browser/components/newtab/test/browser/browser_newtab_ping.js index 42ff22a57d47..d0cf57c852c9 100644 --- a/browser/components/newtab/test/browser/browser_newtab_ping.js +++ b/browser/components/newtab/test/browser/browser_newtab_ping.js @@ -3,8 +3,8 @@ "use strict"; -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); const { ASRouter } = ChromeUtils.import( "resource://activity-stream/lib/ASRouter.jsm" diff --git a/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js b/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js index 0cbb81351bbd..6ef002ebf64e 100644 --- a/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js +++ b/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js @@ -28,8 +28,8 @@ AddonTestUtils.createAppInfo( "42" ); -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); const { PREFS_CONFIG } = ChromeUtils.import( "resource://activity-stream/lib/ActivityStream.jsm" diff --git a/browser/components/newtab/test/xpcshell/test_AboutNewTab.js b/browser/components/newtab/test/xpcshell/test_AboutNewTab.js index 9b31a2add155..479314bdfadd 100644 --- a/browser/components/newtab/test/xpcshell/test_AboutNewTab.js +++ b/browser/components/newtab/test/xpcshell/test_AboutNewTab.js @@ -13,8 +13,8 @@ const { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs" ); -const { AboutNewTab } = ChromeUtils.import( - "resource:///modules/AboutNewTab.jsm" +const { AboutNewTab } = ChromeUtils.importESModule( + "resource:///modules/AboutNewTab.sys.mjs" ); XPCOMUtils.defineLazyServiceGetter( diff --git a/browser/components/pagedata/PageDataService.sys.mjs b/browser/components/pagedata/PageDataService.sys.mjs index 5a3c67ee0bb2..4335c31d683f 100644 --- a/browser/components/pagedata/PageDataService.sys.mjs +++ b/browser/components/pagedata/PageDataService.sys.mjs @@ -9,15 +9,12 @@ import { EventEmitter } from "resource://gre/modules/EventEmitter.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", HiddenFrame: "resource://gre/modules/HiddenFrame.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "logConsole", function () { return console.createInstance({ prefix: "PageData", diff --git a/browser/components/places/Interactions.sys.mjs b/browser/components/places/Interactions.sys.mjs index f7128c3efd64..575437372c34 100644 --- a/browser/components/places/Interactions.sys.mjs +++ b/browser/components/places/Interactions.sys.mjs @@ -7,6 +7,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", InteractionsBlocklist: "resource:///modules/InteractionsBlocklist.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", @@ -14,10 +15,6 @@ ChromeUtils.defineESModuleGetters(lazy, { setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "logConsole", function () { return console.createInstance({ prefix: "InteractionsManager", diff --git a/browser/components/places/PlacesUIUtils.sys.mjs b/browser/components/places/PlacesUIUtils.sys.mjs index b16ca9437bc1..bb4442125fa5 100644 --- a/browser/components/places/PlacesUIUtils.sys.mjs +++ b/browser/components/places/PlacesUIUtils.sys.mjs @@ -11,8 +11,10 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs", + OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.sys.mjs", PlacesTransactions: "resource://gre/modules/PlacesTransactions.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", @@ -20,11 +22,6 @@ ChromeUtils.defineESModuleGetters(lazy, { Weave: "resource://services-sync/main.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm", -}); - const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT; const FAVICON_REQUEST_TIMEOUT = 60 * 1000; diff --git a/browser/components/pocket/content/pktTelemetry.sys.mjs b/browser/components/pocket/content/pktTelemetry.sys.mjs index 602d3bda251d..93592af7616f 100644 --- a/browser/components/pocket/content/pktTelemetry.sys.mjs +++ b/browser/components/pocket/content/pktTelemetry.sys.mjs @@ -5,14 +5,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "PingCentre", - "resource:///modules/PingCentre.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { - pktApi: "chrome://pocket/content/pktApi.sys.mjs", + PingCentre: "resource:///modules/PingCentre.sys.mjs", TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs", + pktApi: "chrome://pocket/content/pktApi.sys.mjs", }); // List of namespaces for the structured ingestion system. diff --git a/browser/components/preferences/dialogs/browserLanguages.js b/browser/components/preferences/dialogs/browserLanguages.js index af84515e0ed1..a54d9f299b61 100644 --- a/browser/components/preferences/dialogs/browserLanguages.js +++ b/browser/components/preferences/dialogs/browserLanguages.js @@ -11,12 +11,9 @@ ChromeUtils.defineESModuleGetters(this, { AddonManager: "resource://gre/modules/AddonManager.sys.mjs", AddonRepository: "resource://gre/modules/addons/AddonRepository.sys.mjs", RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", + SelectionChangedMenulist: + "resource:///modules/SelectionChangedMenulist.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "SelectionChangedMenulist", - "resource:///modules/SelectionChangedMenulist.jsm" -); document .getElementById("BrowserLanguagesDialog") diff --git a/browser/components/preferences/dialogs/clearSiteData.js b/browser/components/preferences/dialogs/clearSiteData.js index eae2d5f772f8..061534b52a0c 100644 --- a/browser/components/preferences/dialogs/clearSiteData.js +++ b/browser/components/preferences/dialogs/clearSiteData.js @@ -2,8 +2,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/. */ -const { SiteDataManager } = ChromeUtils.import( - "resource:///modules/SiteDataManager.jsm" +const { SiteDataManager } = ChromeUtils.importESModule( + "resource:///modules/SiteDataManager.sys.mjs" ); ChromeUtils.defineESModuleGetters(this, { diff --git a/browser/components/preferences/dialogs/siteDataSettings.js b/browser/components/preferences/dialogs/siteDataSettings.js index 7c0c490e5d54..5323a3cf3bea 100644 --- a/browser/components/preferences/dialogs/siteDataSettings.js +++ b/browser/components/preferences/dialogs/siteDataSettings.js @@ -9,13 +9,9 @@ var { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "SiteDataManager", - "resource:///modules/SiteDataManager.jsm" -); ChromeUtils.defineESModuleGetters(this, { DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", + SiteDataManager: "resource:///modules/SiteDataManager.sys.mjs", }); let gSiteDataSettings = { diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js index 2326a4c4f5f3..788e5b2b3388 100644 --- a/browser/components/preferences/preferences.js +++ b/browser/components/preferences/preferences.js @@ -91,13 +91,18 @@ ChromeUtils.defineESModuleGetters(this, { FeatureGate: "resource://featuregates/FeatureGate.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", FirefoxRelay: "resource://gre/modules/FirefoxRelay.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", LangPackMatcher: "resource://gre/modules/LangPackMatcher.sys.mjs", LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", OSKeyStore: "resource://gre/modules/OSKeyStore.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs", + SelectionChangedMenulist: + "resource:///modules/SelectionChangedMenulist.sys.mjs", ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", + SiteDataManager: "resource:///modules/SiteDataManager.sys.mjs", + TransientPrefs: "resource:///modules/TransientPrefs.sys.mjs", UIState: "resource://services-sync/UIState.sys.mjs", UpdateUtils: "resource://gre/modules/UpdateUtils.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", @@ -107,7 +112,6 @@ ChromeUtils.defineESModuleGetters(this, { }); XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", SelectionChangedMenulist: "resource:///modules/SelectionChangedMenulist.jsm", SiteDataManager: "resource:///modules/SiteDataManager.jsm", TransientPrefs: "resource:///modules/TransientPrefs.jsm", diff --git a/browser/components/preferences/tests/browser_extension_controlled.js b/browser/components/preferences/tests/browser_extension_controlled.js index 6cec9ba93a2c..cb282d57e683 100644 --- a/browser/components/preferences/tests/browser_extension_controlled.js +++ b/browser/components/preferences/tests/browser_extension_controlled.js @@ -8,16 +8,11 @@ const NEW_TAB_KEY = "newTabURL"; const PREF_SETTING_TYPE = "prefs"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ExtensionSettingsStore: "resource://gre/modules/ExtensionSettingsStore.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); - XPCOMUtils.defineLazyPreferenceGetter(this, "proxyType", PROXY_PREF); const { AddonTestUtils } = ChromeUtils.importESModule( diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs index 15c55e87c152..916824738bd0 100644 --- a/browser/components/sessionstore/SessionStore.sys.mjs +++ b/browser/components/sessionstore/SessionStore.sys.mjs @@ -228,8 +228,10 @@ XPCOMUtils.defineLazyServiceGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, { AsyncShutdown: "resource://gre/modules/AsyncShutdown.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", DevToolsShim: "chrome://devtools-startup/content/DevToolsShim.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", PrivacyFilter: "resource://gre/modules/sessionstore/PrivacyFilter.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", RunState: "resource:///modules/sessionstore/RunState.sys.mjs", @@ -239,18 +241,13 @@ ChromeUtils.defineESModuleGetters(lazy, { SessionSaver: "resource:///modules/sessionstore/SessionSaver.sys.mjs", SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", TabAttributes: "resource:///modules/sessionstore/TabAttributes.sys.mjs", + TabCrashHandler: "resource:///modules/ContentCrashHandlers.sys.mjs", TabState: "resource:///modules/sessionstore/TabState.sys.mjs", TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs", TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - HomePage: "resource:///modules/HomePage.jsm", - TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "blankURI", () => { return Services.io.newURI("about:blank"); }); diff --git a/browser/components/syncedtabs/TabListComponent.sys.mjs b/browser/components/syncedtabs/TabListComponent.sys.mjs index 60b473675bc1..cda3376dc2a7 100644 --- a/browser/components/syncedtabs/TabListComponent.sys.mjs +++ b/browser/components/syncedtabs/TabListComponent.sys.mjs @@ -2,16 +2,14 @@ * 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"; - let log = ChromeUtils.importESModule( "resource://gre/modules/Log.sys.mjs" ).Log.repository.getLogger("Sync.RemoteTabs"); const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm", +ChromeUtils.defineESModuleGetters(lazy, { + OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.sys.mjs", }); /** diff --git a/browser/components/tabunloader/content/aboutUnloads.js b/browser/components/tabunloader/content/aboutUnloads.js index b58cd836095c..635f1243d332 100644 --- a/browser/components/tabunloader/content/aboutUnloads.js +++ b/browser/components/tabunloader/content/aboutUnloads.js @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; -const { TabUnloader } = ChromeUtils.import( - "resource:///modules/TabUnloader.jsm" +const { TabUnloader } = ChromeUtils.importESModule( + "resource:///modules/TabUnloader.sys.mjs" ); async function refreshData() { diff --git a/browser/components/touchbar/MacTouchBar.sys.mjs b/browser/components/touchbar/MacTouchBar.sys.mjs index 315de69b8c1c..5b598efc0088 100644 --- a/browser/components/touchbar/MacTouchBar.sys.mjs +++ b/browser/components/touchbar/MacTouchBar.sys.mjs @@ -7,13 +7,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyServiceGetter( lazy, "touchBarUpdater", diff --git a/browser/components/translation/TranslationParent.jsm b/browser/components/translation/TranslationParent.jsm index 8baf3b2779b8..a762543a7a15 100644 --- a/browser/components/translation/TranslationParent.jsm +++ b/browser/components/translation/TranslationParent.jsm @@ -76,8 +76,8 @@ var Translation = { openProviderAttribution() { let attribution = this.supportedEngines[this.translationEngine]; - const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); BrowserWindowTracker.getTopWindow().openWebLinkIn(attribution, "tab"); }, diff --git a/browser/components/uitour/UITour.sys.mjs b/browser/components/uitour/UITour.sys.mjs index 048ad86432a7..a72d4eab6f4e 100644 --- a/browser/components/uitour/UITour.sys.mjs +++ b/browser/components/uitour/UITour.sys.mjs @@ -11,6 +11,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs", AddonManager: "resource://gre/modules/AddonManager.sys.mjs", + BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs", @@ -22,10 +23,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UpdateUtils: "resource://gre/modules/UpdateUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { return ChromeUtils.importESModule( "resource://gre/modules/FxAccounts.sys.mjs" diff --git a/browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs b/browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs index 9752c878e545..79f6ad6fa0c9 100644 --- a/browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs +++ b/browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs @@ -7,6 +7,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs", DevToolsShim: "chrome://devtools-startup/content/DevToolsShim.sys.mjs", ResetProfile: "resource://gre/modules/ResetProfile.sys.mjs", @@ -17,10 +18,6 @@ ChromeUtils.defineESModuleGetters(lazy, { import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - if (AppConstants.MOZ_UPDATER) { XPCOMUtils.defineLazyServiceGetter( lazy, diff --git a/browser/components/urlbar/QuickSuggest.sys.mjs b/browser/components/urlbar/QuickSuggest.sys.mjs index 2a8fcc2fcdc5..45ee5bd5df33 100644 --- a/browser/components/urlbar/QuickSuggest.sys.mjs +++ b/browser/components/urlbar/QuickSuggest.sys.mjs @@ -2,20 +2,15 @@ * 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 = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - // Quick suggest features. On init, QuickSuggest creates an instance of each and // keeps it in the `#features` map. See `BaseFeature`. const FEATURES = { diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs index c50e2674b2fe..09fec86fe5bc 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -10,6 +10,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", CONTEXTUAL_SERVICES_PING_TYPES: "resource:///modules/PartnerLinkAttribution.sys.mjs", ExtensionSearchHandler: @@ -32,7 +33,6 @@ ChromeUtils.defineESModuleGetters(lazy, { }); XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", }); diff --git a/browser/components/urlbar/UrlbarProviderContextualSearch.sys.mjs b/browser/components/urlbar/UrlbarProviderContextualSearch.sys.mjs index 0b4ecd943d7a..bde6b5fb8785 100644 --- a/browser/components/urlbar/UrlbarProviderContextualSearch.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderContextualSearch.sys.mjs @@ -2,8 +2,6 @@ * 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"; - import { UrlbarProvider, UrlbarUtils, @@ -12,6 +10,7 @@ import { const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarResult: "resource:///modules/UrlbarResult.sys.mjs", @@ -19,10 +18,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UrlbarView: "resource:///modules/UrlbarView.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - const DYNAMIC_RESULT_TYPE = "contextualSearch"; const ENABLED_PREF = "contextualSearch.enabled"; diff --git a/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs b/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs index 0df761e9703a..06d6a6727398 100644 --- a/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs @@ -13,6 +13,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AppUpdater: "resource://gre/modules/AppUpdater.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", NLP: "resource://gre/modules/NLP.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", ResetProfile: "resource://gre/modules/ResetProfile.sys.mjs", @@ -22,10 +23,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "appUpdater", () => new lazy.AppUpdater()); // The possible tips to show. These names (except NONE) are used in the names diff --git a/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs b/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs index 50b323369558..74a2629b0bd6 100644 --- a/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs @@ -16,6 +16,7 @@ import { const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", CONTEXTUAL_SERVICES_PING_TYPES: "resource:///modules/PartnerLinkAttribution.sys.mjs", PartnerLinkAttribution: "resource:///modules/PartnerLinkAttribution.sys.mjs", @@ -29,10 +30,6 @@ ChromeUtils.defineESModuleGetters(lazy, { UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", -}); - // The scalar category of TopSites impression for Contextual Services const SCALAR_CATEGORY_TOPSITES = "contextual.services.topsites.impression"; diff --git a/browser/components/urlbar/UrlbarResult.sys.mjs b/browser/components/urlbar/UrlbarResult.sys.mjs index 81f9aa118d06..61fe7feea686 100644 --- a/browser/components/urlbar/UrlbarResult.sys.mjs +++ b/browser/components/urlbar/UrlbarResult.sys.mjs @@ -10,21 +10,16 @@ * the result types. */ -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", JsonSchemaValidator: "resource://gre/modules/components-utils/JsonSchemaValidator.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm", -}); - /** * Class used to create a single result. */ diff --git a/browser/components/urlbar/UrlbarValueFormatter.sys.mjs b/browser/components/urlbar/UrlbarValueFormatter.sys.mjs index 84099c96e5c9..12eda23a1606 100644 --- a/browser/components/urlbar/UrlbarValueFormatter.sys.mjs +++ b/browser/components/urlbar/UrlbarValueFormatter.sys.mjs @@ -5,17 +5,12 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "BrowserUIUtils", - "resource:///modules/BrowserUIUtils.jsm" -); - /** * Applies URL highlighting and other styling to the text in the urlbar input, * depending on the text. diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs index a6a230e0dff6..fab7c76f9bc9 100644 --- a/browser/components/urlbar/UrlbarView.sys.mjs +++ b/browser/components/urlbar/UrlbarView.sys.mjs @@ -8,13 +8,14 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", L10nCache: "resource:///modules/UrlbarUtils.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarProviderQuickSuggest: "resource:///modules/UrlbarProviderQuickSuggest.sys.mjs", UrlbarProviderTopSites: "resource:///modules/UrlbarProviderTopSites.sys.mjs", - UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.sys.mjs", UrlbarProviderWeather: "resource:///modules/UrlbarProviderWeather.sys.mjs", + UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.sys.mjs", UrlbarResult: "resource:///modules/UrlbarResult.sys.mjs", UrlbarSearchOneOffs: "resource:///modules/UrlbarSearchOneOffs.sys.mjs", UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs", @@ -22,7 +23,6 @@ ChromeUtils.defineESModuleGetters(lazy, { }); XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", }); diff --git a/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs b/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs index 03502acafafe..1d68dab845fd 100644 --- a/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs +++ b/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs @@ -1,8 +1,6 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; import { @@ -15,6 +13,8 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddonTestUtils: "resource://testing-common/AddonTestUtils.sys.mjs", BrowserTestUtils: "resource://testing-common/BrowserTestUtils.sys.mjs", + BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs", ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs", ExperimentManager: "resource://nimbus/lib/ExperimentManager.sys.mjs", @@ -31,11 +31,6 @@ ChromeUtils.defineESModuleGetters(lazy, { setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - export var UrlbarTestUtils = { /** * This maps the categories used by the FX_URLBAR_SELECTED_RESULT_METHOD and diff --git a/browser/components/urlbar/tests/browser/browser_quickactions.js b/browser/components/urlbar/tests/browser/browser_quickactions.js index 9722dba18fd9..ae474df2ecc7 100644 --- a/browser/components/urlbar/tests/browser/browser_quickactions.js +++ b/browser/components/urlbar/tests/browser/browser_quickactions.js @@ -11,14 +11,12 @@ requestLongerTimeout(3); ChromeUtils.defineESModuleGetters(this, { AppConstants: "resource://gre/modules/AppConstants.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", UpdateService: "resource://gre/modules/UpdateService.sys.mjs", UrlbarProviderQuickActions: "resource:///modules/UrlbarProviderQuickActions.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); const DUMMY_PAGE = "http://example.com/browser/browser/base/content/test/general/dummy_page.html"; diff --git a/browser/components/urlbar/tests/browser/browser_top_sites.js b/browser/components/urlbar/tests/browser/browser_top_sites.js index cb6502d2b2c4..a473216ab1c4 100644 --- a/browser/components/urlbar/tests/browser/browser_top_sites.js +++ b/browser/components/urlbar/tests/browser/browser_top_sites.js @@ -4,13 +4,10 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", -}); - const EN_US_TOPSITES = "https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/"; diff --git a/browser/components/urlbar/tests/browser/browser_top_sites_private.js b/browser/components/urlbar/tests/browser/browser_top_sites_private.js index bcc6a70d8824..c52239a800f3 100644 --- a/browser/components/urlbar/tests/browser/browser_top_sites_private.js +++ b/browser/components/urlbar/tests/browser/browser_top_sites_private.js @@ -4,13 +4,10 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", -}); - const EN_US_TOPSITES = "https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/"; diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js index 12adb27caf3f..c4e44bf77884 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js @@ -9,13 +9,10 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", -}); - const EN_US_TOPSITES = "https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/"; diff --git a/browser/components/urlbar/tests/browser/head.js b/browser/components/urlbar/tests/browser/head.js index 4d381320c9e1..4ee26e7f032e 100644 --- a/browser/components/urlbar/tests/browser/head.js +++ b/browser/components/urlbar/tests/browser/head.js @@ -8,6 +8,7 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs", ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", @@ -25,7 +26,6 @@ ChromeUtils.defineESModuleGetters(this, { }); XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", }); diff --git a/browser/components/urlbar/tests/ext/api.js b/browser/components/urlbar/tests/ext/api.js index 77da790190c8..1bbdf9112c89 100644 --- a/browser/components/urlbar/tests/ext/api.js +++ b/browser/components/urlbar/tests/ext/api.js @@ -11,6 +11,7 @@ const { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", Preferences: "resource://gre/modules/Preferences.sys.mjs", UrlbarProviderExtension: "resource:///modules/UrlbarProviderExtension.sys.mjs", @@ -18,10 +19,6 @@ ChromeUtils.defineESModuleGetters(this, { UrlbarView: "resource:///modules/UrlbarView.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter( this, "defaultPreferences", diff --git a/browser/modules/BrowserUsageTelemetry.sys.mjs b/browser/modules/BrowserUsageTelemetry.sys.mjs index f674a16d4c00..93615635309c 100644 --- a/browser/modules/BrowserUsageTelemetry.sys.mjs +++ b/browser/modules/BrowserUsageTelemetry.sys.mjs @@ -12,6 +12,7 @@ ChromeUtils.defineESModuleGetters(lazy, { ClientID: "resource://gre/modules/ClientID.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", + PageActions: "resource:///modules/PageActions.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", ProvenanceData: "resource:///modules/ProvenanceData.sys.mjs", SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs", @@ -24,10 +25,6 @@ ChromeUtils.defineESModuleGetters(lazy, { setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - PageActions: "resource:///modules/PageActions.jsm", -}); - // This pref is in seconds! XPCOMUtils.defineLazyPreferenceGetter( lazy, diff --git a/browser/modules/ContentCrashHandlers.sys.mjs b/browser/modules/ContentCrashHandlers.sys.mjs index f2cbd0dd0f9a..e501f9082e9d 100644 --- a/browser/modules/ContentCrashHandlers.sys.mjs +++ b/browser/modules/ContentCrashHandlers.sys.mjs @@ -2,12 +2,12 @@ * 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"; import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", CrashSubmit: "resource://gre/modules/CrashSubmit.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", @@ -15,10 +15,6 @@ ChromeUtils.defineESModuleGetters(lazy, { setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - // We don't process crash reports older than 28 days, so don't bother // submitting them const PENDING_CRASH_REPORT_DAYS = 28; diff --git a/browser/modules/NewTabPagePreloading.sys.mjs b/browser/modules/NewTabPagePreloading.sys.mjs index e78325920b2c..bf6b0501954c 100644 --- a/browser/modules/NewTabPagePreloading.sys.mjs +++ b/browser/modules/NewTabPagePreloading.sys.mjs @@ -12,15 +12,12 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - export let NewTabPagePreloading = { // Maximum number of instances of a given page we'll preload at any time. // Because we preload about:newtab for normal windows, and about:privatebrowsing diff --git a/browser/modules/PartnerLinkAttribution.sys.mjs b/browser/modules/PartnerLinkAttribution.sys.mjs index aea221512ec3..04d0e98a98a8 100644 --- a/browser/modules/PartnerLinkAttribution.sys.mjs +++ b/browser/modules/PartnerLinkAttribution.sys.mjs @@ -7,13 +7,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + PingCentre: "resource:///modules/PingCentre.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - PingCentre: "resource:///modules/PingCentre.jsm", -}); - // Endpoint base URL for Structured Ingestion XPCOMUtils.defineLazyPreferenceGetter( lazy, diff --git a/browser/modules/TabUnloader.sys.mjs b/browser/modules/TabUnloader.sys.mjs index 7201906c306b..16ef56ee2837 100644 --- a/browser/modules/TabUnloader.sys.mjs +++ b/browser/modules/TabUnloader.sys.mjs @@ -11,13 +11,9 @@ */ const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "webrtcUI", - "resource:///modules/webrtcUI.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", + webrtcUI: "resource:///modules/webrtcUI.sys.mjs", }); // If there are only this many or fewer tabs open, just sort by weight, and close diff --git a/browser/modules/URILoadingHelper.sys.mjs b/browser/modules/URILoadingHelper.sys.mjs index d08bc68ce80b..90aea911d86b 100644 --- a/browser/modules/URILoadingHelper.sys.mjs +++ b/browser/modules/URILoadingHelper.sys.mjs @@ -9,9 +9,9 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", +ChromeUtils.defineESModuleGetters(lazy, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", }); XPCOMUtils.defineLazyGetter(lazy, "ReferrerInfo", () => diff --git a/browser/modules/test/browser/browser_EveryWindow.js b/browser/modules/test/browser/browser_EveryWindow.js index 7cadfaadad63..de1a7bbf9ac6 100644 --- a/browser/modules/test/browser/browser_EveryWindow.js +++ b/browser/modules/test/browser/browser_EveryWindow.js @@ -6,8 +6,8 @@ /* eslint-disable mozilla/no-arbitrary-setTimeout */ -const { EveryWindow } = ChromeUtils.import( - "resource:///modules/EveryWindow.jsm" +const { EveryWindow } = ChromeUtils.importESModule( + "resource:///modules/EveryWindow.sys.mjs" ); async function windowInited(aId, aWin) { diff --git a/browser/modules/test/browser/browser_HomePage_add_button.js b/browser/modules/test/browser/browser_HomePage_add_button.js index 045fed870efe..c185b45a6b6a 100644 --- a/browser/modules/test/browser/browser_HomePage_add_button.js +++ b/browser/modules/test/browser/browser_HomePage_add_button.js @@ -3,11 +3,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "HomePage", - "resource:///modules/HomePage.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", +}); const kPrefHomePage = "browser.startup.homepage"; const kPrefExtensionControlled = diff --git a/browser/modules/test/browser/browser_PageActions.js b/browser/modules/test/browser/browser_PageActions.js index a0b6e72211c8..4f86962a0178 100644 --- a/browser/modules/test/browser/browser_PageActions.js +++ b/browser/modules/test/browser/browser_PageActions.js @@ -1,6 +1,6 @@ "use strict"; -// This is a test for PageActions.jsm, specifically the generalized parts that +// This is a test for PageActions.sys.mjs, specifically the generalized parts that // add and remove page actions and toggle them in the urlbar. This does not // test the built-in page actions; browser_page_action_menu.js does that. diff --git a/browser/modules/test/browser/browser_PageActions_contextMenus.js b/browser/modules/test/browser/browser_PageActions_contextMenus.js index a76a5bcb16cb..378c55c70640 100644 --- a/browser/modules/test/browser/browser_PageActions_contextMenus.js +++ b/browser/modules/test/browser/browser_PageActions_contextMenus.js @@ -1,6 +1,6 @@ "use strict"; -// This is a test for PageActions.jsm, specifically the context menus. +// This is a test for PageActions.sys.mjs, specifically the context menus. ChromeUtils.defineESModuleGetters(this, { ExtensionCommon: "resource://gre/modules/ExtensionCommon.sys.mjs", diff --git a/browser/modules/test/browser/browser_PageActions_newWindow.js b/browser/modules/test/browser/browser_PageActions_newWindow.js index e351727bff80..ade50c6b2c2f 100644 --- a/browser/modules/test/browser/browser_PageActions_newWindow.js +++ b/browser/modules/test/browser/browser_PageActions_newWindow.js @@ -1,6 +1,6 @@ "use strict"; -// This is a test for PageActions.jsm, specifically the generalized parts that +// This is a test for PageActions.sys.mjs, specifically the generalized parts that // add and remove page actions and toggle them in the urlbar. This does not // test the built-in page actions; browser_page_action_menu.js does that. diff --git a/browser/modules/test/browser/browser_TabUnloader.js b/browser/modules/test/browser/browser_TabUnloader.js index a4af0dbdc8a2..d564abb6205a 100644 --- a/browser/modules/test/browser/browser_TabUnloader.js +++ b/browser/modules/test/browser/browser_TabUnloader.js @@ -1,8 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -const { TabUnloader } = ChromeUtils.import( - "resource:///modules/TabUnloader.jsm" +const { TabUnloader } = ChromeUtils.importESModule( + "resource:///modules/TabUnloader.sys.mjs" ); const BASE_URL = "https://example.com/browser/browser/modules/test/browser/"; diff --git a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js index 47c678b91aea..e805f1c8ed42 100644 --- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js +++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js @@ -5,8 +5,8 @@ * that is seen when we detect pending crash reports on startup. */ -const { UnsubmittedCrashHandler } = ChromeUtils.import( - "resource:///modules/ContentCrashHandlers.jsm" +const { UnsubmittedCrashHandler } = ChromeUtils.importESModule( + "resource:///modules/ContentCrashHandlers.sys.mjs" ); const { makeFakeAppDir } = ChromeUtils.importESModule( diff --git a/browser/modules/test/browser/browser_UsageTelemetry.js b/browser/modules/test/browser/browser_UsageTelemetry.js index aa752f5b7bdf..402d9e4fe019 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry.js +++ b/browser/modules/test/browser/browser_UsageTelemetry.js @@ -18,11 +18,10 @@ const TELEMETRY_SUBSESSION_TOPIC = "internal-telemetry-after-subsession-split"; const RESTORE_ON_DEMAND_PREF = "browser.sessionstore.restore_on-demand"; -ChromeUtils.defineModuleGetter( - this, - "MINIMUM_TAB_COUNT_INTERVAL_MS", - "resource:///modules/BrowserUsageTelemetry.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + MINIMUM_TAB_COUNT_INTERVAL_MS: + "resource:///modules/BrowserUsageTelemetry.sys.mjs", +}); const { ObjectUtils } = ChromeUtils.import( "resource://gre/modules/ObjectUtils.jsm" diff --git a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutRestartRequired.js b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutRestartRequired.js index 359bfa9c69a5..3baa336d798c 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutRestartRequired.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutRestartRequired.js @@ -3,8 +3,8 @@ const SCALAR_BUILDID_MISMATCH = "dom.contentprocess.buildID_mismatch"; add_task(async function test_aboutRestartRequired() { - const { TabCrashHandler } = ChromeUtils.import( - "resource:///modules/ContentCrashHandlers.jsm" + const { TabCrashHandler } = ChromeUtils.importESModule( + "resource:///modules/ContentCrashHandlers.sys.mjs" ); // Let's reset the counts. diff --git a/browser/modules/test/browser/browser_UsageTelemetry_uniqueOriginsVisitedInPast24Hours.js b/browser/modules/test/browser/browser_UsageTelemetry_uniqueOriginsVisitedInPast24Hours.js index ec5da648822d..11986f8e3109 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_uniqueOriginsVisitedInPast24Hours.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_uniqueOriginsVisitedInPast24Hours.js @@ -5,11 +5,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "URICountListener", - "resource:///modules/BrowserUsageTelemetry.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + URICountListener: "resource:///modules/BrowserUsageTelemetry.sys.mjs", +}); add_task(async function test_uniqueDomainsVisitedInPast24Hours() { // By default, proxies don't apply to 127.0.0.1. We need them to for this test, though: diff --git a/browser/modules/test/browser/browser_taskbar_preview.js b/browser/modules/test/browser/browser_taskbar_preview.js index 89892e38dd27..635a1a914237 100644 --- a/browser/modules/test/browser/browser_taskbar_preview.js +++ b/browser/modules/test/browser/browser_taskbar_preview.js @@ -16,8 +16,8 @@ function test() { const ENABLE_PREF_NAME = "browser.taskbar.previews.enable"; - let { AeroPeek } = ChromeUtils.import( - "resource:///modules/WindowsPreviewPerTab.jsm" + let { AeroPeek } = ChromeUtils.importESModule( + "resource:///modules/WindowsPreviewPerTab.sys.mjs" ); waitForExplicitFinish(); diff --git a/browser/modules/test/unit/test_HomePage.js b/browser/modules/test/unit/test_HomePage.js index 0fb1030f1d58..f2f4588329e2 100644 --- a/browser/modules/test/unit/test_HomePage.js +++ b/browser/modules/test/unit/test_HomePage.js @@ -4,19 +4,12 @@ "use strict"; -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); - ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", sinon: "resource://testing-common/Sinon.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", -}); - const HOMEPAGE_IGNORELIST = "homepage-urls"; /** diff --git a/browser/modules/test/unit/test_HomePage_ignore.js b/browser/modules/test/unit/test_HomePage_ignore.js index 26d384bea7c1..1369b661b6d3 100644 --- a/browser/modules/test/unit/test_HomePage_ignore.js +++ b/browser/modules/test/unit/test_HomePage_ignore.js @@ -4,20 +4,13 @@ "use strict"; -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); - ChromeUtils.defineESModuleGetters(this, { + HomePage: "resource:///modules/HomePage.sys.mjs", RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs", sinon: "resource://testing-common/Sinon.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - HomePage: "resource:///modules/HomePage.jsm", -}); - const HOMEPAGE_IGNORELIST = "homepage-urls"; /** diff --git a/browser/modules/test/unit/test_InstallationTelemetry.js b/browser/modules/test/unit/test_InstallationTelemetry.js index 64d9964cbe6a..40280267102f 100644 --- a/browser/modules/test/unit/test_InstallationTelemetry.js +++ b/browser/modules/test/unit/test_InstallationTelemetry.js @@ -9,8 +9,8 @@ const { AppConstants } = ChromeUtils.importESModule( const { AttributionIOUtils } = ChromeUtils.importESModule( "resource:///modules/AttributionCode.sys.mjs" ); -const { BrowserUsageTelemetry } = ChromeUtils.import( - "resource:///modules/BrowserUsageTelemetry.jsm" +const { BrowserUsageTelemetry } = ChromeUtils.importESModule( + "resource:///modules/BrowserUsageTelemetry.sys.mjs" ); const { TelemetryTestUtils } = ChromeUtils.importESModule( "resource://testing-common/TelemetryTestUtils.sys.mjs" diff --git a/browser/modules/test/unit/test_LaterRun.js b/browser/modules/test/unit/test_LaterRun.js index d78fde241415..6de572b86805 100644 --- a/browser/modules/test/unit/test_LaterRun.js +++ b/browser/modules/test/unit/test_LaterRun.js @@ -5,7 +5,9 @@ const kPagePrefRoot = "browser.laterrun.pages."; const kSessionCountPref = "browser.laterrun.bookkeeping.sessionCount"; const kProfileCreationTime = "browser.laterrun.bookkeeping.profileCreationTime"; -const { LaterRun } = ChromeUtils.import("resource:///modules/LaterRun.jsm"); +const { LaterRun } = ChromeUtils.importESModule( + "resource:///modules/LaterRun.sys.mjs" +); Services.prefs.setBoolPref(kEnabledPref, true); const { updateAppInfo } = ChromeUtils.importESModule( diff --git a/browser/modules/test/unit/test_PingCentre.js b/browser/modules/test/unit/test_PingCentre.js index b0220301964a..6c38397e5fc2 100644 --- a/browser/modules/test/unit/test_PingCentre.js +++ b/browser/modules/test/unit/test_PingCentre.js @@ -4,8 +4,8 @@ "use strict"; -const { PingCentre, PingCentreConstants } = ChromeUtils.import( - "resource:///modules/PingCentre.jsm" +const { PingCentre, PingCentreConstants } = ChromeUtils.importESModule( + "resource:///modules/PingCentre.sys.mjs" ); const { TelemetryEnvironment } = ChromeUtils.importESModule( "resource://gre/modules/TelemetryEnvironment.sys.mjs" diff --git a/browser/modules/test/unit/test_ProfileCounter.js b/browser/modules/test/unit/test_ProfileCounter.js index e8b3179f3414..2a22d849fffb 100644 --- a/browser/modules/test/unit/test_ProfileCounter.js +++ b/browser/modules/test/unit/test_ProfileCounter.js @@ -3,8 +3,8 @@ */ "use strict"; -const { BrowserUsageTelemetry } = ChromeUtils.import( - "resource:///modules/BrowserUsageTelemetry.jsm" +const { BrowserUsageTelemetry } = ChromeUtils.importESModule( + "resource:///modules/BrowserUsageTelemetry.sys.mjs" ); const { TelemetryTestUtils } = ChromeUtils.importESModule( "resource://testing-common/TelemetryTestUtils.sys.mjs" diff --git a/browser/modules/test/unit/test_SiteDataManager.js b/browser/modules/test/unit/test_SiteDataManager.js index adceb64ca4e9..3ddb28c7ff5d 100644 --- a/browser/modules/test/unit/test_SiteDataManager.js +++ b/browser/modules/test/unit/test_SiteDataManager.js @@ -3,8 +3,8 @@ */ "use strict"; -const { SiteDataManager } = ChromeUtils.import( - "resource:///modules/SiteDataManager.jsm" +const { SiteDataManager } = ChromeUtils.importESModule( + "resource:///modules/SiteDataManager.sys.mjs" ); const { SiteDataTestUtils } = ChromeUtils.importESModule( "resource://testing-common/SiteDataTestUtils.sys.mjs" diff --git a/browser/modules/test/unit/test_SiteDataManagerContainers.js b/browser/modules/test/unit/test_SiteDataManagerContainers.js index d083c4141408..18bbb23262a9 100644 --- a/browser/modules/test/unit/test_SiteDataManagerContainers.js +++ b/browser/modules/test/unit/test_SiteDataManagerContainers.js @@ -3,8 +3,8 @@ */ "use strict"; -const { SiteDataManager } = ChromeUtils.import( - "resource:///modules/SiteDataManager.jsm" +const { SiteDataManager } = ChromeUtils.importESModule( + "resource:///modules/SiteDataManager.sys.mjs" ); const { SiteDataTestUtils } = ChromeUtils.importESModule( "resource://testing-common/SiteDataTestUtils.sys.mjs" diff --git a/browser/modules/test/unit/test_TabUnloader.js b/browser/modules/test/unit/test_TabUnloader.js index 2177fe14e249..3d125828bb29 100644 --- a/browser/modules/test/unit/test_TabUnloader.js +++ b/browser/modules/test/unit/test_TabUnloader.js @@ -3,8 +3,8 @@ */ "use strict"; -const { TabUnloader } = ChromeUtils.import( - "resource:///modules/TabUnloader.jsm" +const { TabUnloader } = ChromeUtils.importESModule( + "resource:///modules/TabUnloader.sys.mjs" ); let TestTabUnloaderMethods = { diff --git a/browser/modules/test/unit/test_discovery.js b/browser/modules/test/unit/test_discovery.js index 7237b78c204c..edc78a33ce56 100644 --- a/browser/modules/test/unit/test_discovery.js +++ b/browser/modules/test/unit/test_discovery.js @@ -13,7 +13,9 @@ const { TestUtils } = ChromeUtils.importESModule( const { ClientID } = ChromeUtils.importESModule( "resource://gre/modules/ClientID.sys.mjs" ); -const { Discovery } = ChromeUtils.import("resource:///modules/Discovery.jsm"); +const { Discovery } = ChromeUtils.importESModule( + "resource:///modules/Discovery.sys.mjs" +); const { ContextualIdentityService } = ChromeUtils.importESModule( "resource://gre/modules/ContextualIdentityService.sys.mjs" ); diff --git a/browser/modules/webrtcUI.sys.mjs b/browser/modules/webrtcUI.sys.mjs index 4da6d1137066..d9efb3d481f6 100644 --- a/browser/modules/webrtcUI.sys.mjs +++ b/browser/modules/webrtcUI.sys.mjs @@ -7,12 +7,8 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", SitePermissions: "resource:///modules/SitePermissions.sys.mjs", }); XPCOMUtils.defineLazyGetter( diff --git a/devtools/client/netmonitor/test/browser_net_initiator.js b/devtools/client/netmonitor/test/browser_net_initiator.js index 4082db6fa290..d58e88f5e9a8 100644 --- a/devtools/client/netmonitor/test/browser_net_initiator.js +++ b/devtools/client/netmonitor/test/browser_net_initiator.js @@ -98,13 +98,13 @@ const EXPECTED_REQUESTS = [ url: HTTPS_EXAMPLE_URL + "favicon_request", causeType: "img", causeUri: INITIATOR_URL, - // the favicon request is triggered in FaviconLoader.jsm module, it should + // the favicon request is triggered in FaviconLoader.sys.mjs module, it should // NOT be shown in the stack (bug 1280266). For now we intentionally // specify the file and the line number to be properly sorted. // NOTE: The line number can be an arbitrary number greater than 0. stack: [ { - file: "resource:///modules/FaviconLoader.jsm", + file: "resource:///modules/FaviconLoader.sys.mjs", line: Number.MAX_SAFE_INTEGER, }, ], diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 145bdb8a5032..c34f3fc6add2 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -17949,8 +17949,8 @@ bool Document::AutomaticStorageAccessPermissionCanBeGranted( return false; } - nsCOMPtr bu = do_ImportModule( - "resource:///modules/BrowserUsageTelemetry.jsm", fallible); + nsCOMPtr bu = do_ImportESModule( + "resource:///modules/BrowserUsageTelemetry.sys.mjs", fallible); if (NS_WARN_IF(!bu)) { return false; } diff --git a/dom/media/systemservices/video_engine/desktop_device_info.cc b/dom/media/systemservices/video_engine/desktop_device_info.cc index b3632a509fdf..185bfe6254fd 100644 --- a/dom/media/systemservices/video_engine/desktop_device_info.cc +++ b/dom/media/systemservices/video_engine/desktop_device_info.cc @@ -26,7 +26,7 @@ static inline void SetStringMember(char** aMember, const char* aValue) { } if (*aMember) { - delete[] * aMember; + delete[] *aMember; *aMember = nullptr; } @@ -347,8 +347,8 @@ void webrtc::DesktopDeviceInfoImpl::InitializeTabList() { nsCOMPtr runnable = NS_NewRunnableFunction(__func__, [&] { nsresult rv; nsCOMPtr bwt = - do_ImportModule("resource:///modules/BrowserWindowTracker.jsm", - "BrowserWindowTracker", &rv); + do_ImportESModule("resource:///modules/BrowserWindowTracker.sys.mjs", + "BrowserWindowTracker", &rv); if (NS_FAILED(rv)) { return; } diff --git a/dom/security/test/https-first/browser_slow_download.js b/dom/security/test/https-first/browser_slow_download.js index 82d7a99b07e1..dc0fcc23db3c 100644 --- a/dom/security/test/https-first/browser_slow_download.js +++ b/dom/security/test/https-first/browser_slow_download.js @@ -1,7 +1,7 @@ "use strict"; -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", +ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", }); // Create a uri for an https site const testPath = getRootDirectory(gTestPath).replace( diff --git a/mots.yaml b/mots.yaml index c715f933184b..b326ffebf231 100644 --- a/mots.yaml +++ b/mots.yaml @@ -8,7 +8,7 @@ # documentation and how to modify this file. repo: mozilla-central created_at: '2021-10-14T12:50:40.073465' -updated_at: '2023-06-09T10:15:24.617281' +updated_at: '2023-06-19T09:07:40.159871' export: path: ./docs/mots/index.rst format: rst @@ -3537,11 +3537,11 @@ modules: - browser/base/content/browser-allTabsMenu.js - browser/base/content/browser-ctrlTab.js - browser/base/content/browser-fullZoom.js - - browser/modules/AsyncTabSwitcher.jsm - - browser/modules/NewTabPagePreloading.jsm - - browser/modules/OpenInTabsUtils.jsm - - browser/modules/TabsList.jsm - - browser/modules/TabUnloader.jsm + - browser/modules/AsyncTabSwitcher.sys.mjs + - browser/modules/NewTabPagePreloading.sys.mjs + - browser/modules/OpenInTabsUtils.sys.mjs + - browser/modules/TabsList.sys.mjs + - browser/modules/TabUnloader.sys.mjs meta: components: - Firefox::Tabbed Browser @@ -4117,5 +4117,5 @@ modules: - Ryan Tilder group: dev-platform hashes: - config: d220ff5dcf799396f98ef05325e1ce8344b67350 - export: f0c50155c0767448866f6242caa6ff78308ec562 + config: 0f55f5e8b59c13c353b90041bc3385976b25767c + export: 9523d238f1810a9bd317c3768a7726f013164c38 diff --git a/security/manager/ssl/tests/mochitest/browser/browser_add_exception_dialog.js b/security/manager/ssl/tests/mochitest/browser/browser_add_exception_dialog.js index d04af6103632..08ee426500ec 100644 --- a/security/manager/ssl/tests/mochitest/browser/browser_add_exception_dialog.js +++ b/security/manager/ssl/tests/mochitest/browser/browser_add_exception_dialog.js @@ -7,8 +7,8 @@ // This test makes sure that adding certificate exceptions behaves correctly // when done from the prefs window -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", +ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", }); function test() { diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py index 168bc1feca5a..086374cc867d 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py @@ -85,8 +85,8 @@ class BaseNavigationTestCase(WindowManagerMixin, MarionetteTestCase): if (AppConstants.MOZ_APP_NAME == "fennec") { win = Services.wm.getMostRecentWindow("navigator:browser"); } else { - const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); win = BrowserWindowTracker.getTopWindow(); } diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py index 5673a1cf201d..8cd7c8ed1e1a 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py @@ -49,8 +49,8 @@ class TestSwitchToWindowContent(WindowManagerMixin, MarionetteTestCase): if (AppConstants.MOZ_APP_NAME == "fennec") { win = Services.wm.getMostRecentWindow("navigator:browser"); } else { - const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); win = BrowserWindowTracker.getTopWindow(); } diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py b/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py index 9d18b2e7776c..b38246f63bfc 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py @@ -109,8 +109,8 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase): with self.marionette.using_context("chrome"): self.marionette.execute_async_script( """ - const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); let win = BrowserWindowTracker.getTopWindow(); diff --git a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs index fcf65012cf34..8e7d7e7d8425 100644 --- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs +++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs @@ -20,13 +20,10 @@ import { TestUtils } from "resource://testing-common/TestUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ContentTask: "resource://testing-common/ContentTask.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyServiceGetters(lazy, { ProtocolProxyService: [ "@mozilla.org/network/protocol-proxy-service;1", diff --git a/testing/talos/talos/startup_test/sessionrestore/addon/api.js b/testing/talos/talos/startup_test/sessionrestore/addon/api.js index 6cb47990f593..3e8aee9cb91a 100644 --- a/testing/talos/talos/startup_test/sessionrestore/addon/api.js +++ b/testing/talos/talos/startup_test/sessionrestore/addon/api.js @@ -9,6 +9,7 @@ /* globals Services, XPCOMUtils */ ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", StartupPerformance: @@ -16,10 +17,6 @@ ChromeUtils.defineESModuleGetters(this, { setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - /* globals ExtensionAPI */ this.sessionrestore = class extends ExtensionAPI { diff --git a/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js b/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js index 0ae7b709fb14..14887aa11230 100644 --- a/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js +++ b/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js @@ -5,14 +5,11 @@ /* globals ExtensionAPI, Services, XPCOMUtils */ ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", TalosParentProfiler: "resource://talos-powers/TalosParentProfiler.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - const SCALAR_KEY = "timestamps.about_home_topsites_first_paint"; const MAX_ATTEMPTS = 10; diff --git a/testing/talos/talos/talos-powers/api.js b/testing/talos/talos/talos-powers/api.js index 7b1cc6ad4f84..1430ac2e40a8 100644 --- a/testing/talos/talos/talos-powers/api.js +++ b/testing/talos/talos/talos-powers/api.js @@ -10,17 +10,14 @@ const { ComponentUtils } = ChromeUtils.importESModule( ChromeUtils.defineESModuleGetters(this, { AboutHomeStartupCache: "resource:///modules/BrowserGlue.sys.mjs", + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", PerTestCoverageUtils: "resource://testing-common/PerTestCoverageUtils.sys.mjs", SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyServiceGetter( this, "resProto", diff --git a/testing/talos/talos/tests/tabpaint/api.js b/testing/talos/talos/tests/tabpaint/api.js index 6c184636ac5a..5608141d7ce0 100644 --- a/testing/talos/talos/tests/tabpaint/api.js +++ b/testing/talos/talos/tests/tabpaint/api.js @@ -21,13 +21,9 @@ */ ChromeUtils.defineESModuleGetters(this, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", TalosParentProfiler: "resource://talos-powers/TalosParentProfiler.sys.mjs", }); -ChromeUtils.defineModuleGetter( - this, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); const REDUCE_MOTION_PREF = "ui.prefersReducedMotion"; const MULTI_OPT_OUT_PREF = "dom.ipc.multiOptOut"; diff --git a/testing/talos/talos/tests/tabswitch/api.js b/testing/talos/talos/tests/tabswitch/api.js index 201c5dd852a8..8ebccdf4110e 100644 --- a/testing/talos/talos/tests/tabswitch/api.js +++ b/testing/talos/talos/tests/tabswitch/api.js @@ -2,11 +2,9 @@ /* globals ExtensionAPI, Services */ -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", +}); this.tabswitch = class extends ExtensionAPI { getAPI(context) { diff --git a/testing/talos/talos/tests/tart/addon/content/tart.js b/testing/talos/talos/tests/tart/addon/content/tart.js index bf72bf78bf5c..61fe282adcda 100644 --- a/testing/talos/talos/tests/tart/addon/content/tart.js +++ b/testing/talos/talos/tests/tart/addon/content/tart.js @@ -27,11 +27,9 @@ // X - tab drag // X - tab remove from the middle // X - Without add-tab button -> can be hidden while testing manually. in talos always with the button -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", +}); /* globals res:true, sequenceArray:true */ diff --git a/toolkit/actors/AboutHttpsOnlyErrorParent.sys.mjs b/toolkit/actors/AboutHttpsOnlyErrorParent.sys.mjs index a7a4b23cfa50..3d4ed65daa5f 100644 --- a/toolkit/actors/AboutHttpsOnlyErrorParent.sys.mjs +++ b/toolkit/actors/AboutHttpsOnlyErrorParent.sys.mjs @@ -2,7 +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/. */ -const { HomePage } = ChromeUtils.import("resource:///modules/HomePage.jsm"); +import { HomePage } from "resource:///modules/HomePage.sys.mjs"; import { PrivateBrowsingUtils } from "resource://gre/modules/PrivateBrowsingUtils.sys.mjs"; export class AboutHttpsOnlyErrorParent extends JSWindowActorParent { diff --git a/toolkit/actors/NetErrorParent.sys.mjs b/toolkit/actors/NetErrorParent.sys.mjs index 7d1f0f3f0fae..9b7d85d83509 100644 --- a/toolkit/actors/NetErrorParent.sys.mjs +++ b/toolkit/actors/NetErrorParent.sys.mjs @@ -18,14 +18,9 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", + HomePage: "resource:///modules/HomePage.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "HomePage", - "resource:///modules/HomePage.jsm" -); - class CaptivePortalObserver { constructor(actor) { this.actor = actor; diff --git a/toolkit/components/downloads/DownloadUIHelper.sys.mjs b/toolkit/components/downloads/DownloadUIHelper.sys.mjs index 9a964fad65ac..0ea6cad85007 100644 --- a/toolkit/components/downloads/DownloadUIHelper.sys.mjs +++ b/toolkit/components/downloads/DownloadUIHelper.sys.mjs @@ -13,13 +13,10 @@ const lazy = {}; // BrowserWindowTracker and PrivateBrowsingUtils are only used when opening downloaded files into a browser window ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter( lazy, "l10n", diff --git a/toolkit/components/extensions/WebNavigation.sys.mjs b/toolkit/components/extensions/WebNavigation.sys.mjs index b040a6cbaa08..3de3c58986b6 100644 --- a/toolkit/components/extensions/WebNavigation.sys.mjs +++ b/toolkit/components/extensions/WebNavigation.sys.mjs @@ -6,12 +6,8 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "BrowserWindowTracker", - "resource:///modules/BrowserWindowTracker.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ClickHandlerParent: "resource:///actors/ClickHandlerParent.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.sys.mjs", diff --git a/toolkit/components/extensions/parent/ext-browserSettings.js b/toolkit/components/extensions/parent/ext-browserSettings.js index d8d2e579bdfc..7b292f76b869 100644 --- a/toolkit/components/extensions/parent/ext-browserSettings.js +++ b/toolkit/components/extensions/parent/ext-browserSettings.js @@ -6,11 +6,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", +}); var { ExtensionPreferencesManager } = ChromeUtils.importESModule( "resource://gre/modules/ExtensionPreferencesManager.sys.mjs" diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_settings.js b/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_settings.js index 66a6b45020b0..8c36f4ef03fd 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_settings.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_settings.js @@ -1,6 +1,7 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { + AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs", Preferences: "resource://gre/modules/Preferences.sys.mjs", }); @@ -16,12 +17,6 @@ AddonTestUtils.createAppInfo( Services.prefs.setBoolPref("extensions.eventPages.enabled", true); -ChromeUtils.defineModuleGetter( - this, - "AboutNewTab", - "resource:///modules/AboutNewTab.jsm" -); - add_task(async function setup() { await AddonTestUtils.promiseStartupManager(); diff --git a/toolkit/components/formautofill/FormAutofillParent.sys.mjs b/toolkit/components/formautofill/FormAutofillParent.sys.mjs index c0ae98b8512a..abda5981e171 100644 --- a/toolkit/components/formautofill/FormAutofillParent.sys.mjs +++ b/toolkit/components/formautofill/FormAutofillParent.sys.mjs @@ -35,16 +35,13 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AddressComponent: "resource://gre/modules/shared/AddressComponent.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", FormAutofillPreferences: "resource://autofill/FormAutofillPreferences.sys.mjs", FormAutofillPrompter: "resource://autofill/FormAutofillPrompter.sys.mjs", OSKeyStore: "resource://gre/modules/OSKeyStore.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - XPCOMUtils.defineLazyGetter(lazy, "log", () => FormAutofill.defineLogGetter(lazy, "FormAutofillParent") ); diff --git a/toolkit/components/normandy/actions/ShowHeartbeatAction.sys.mjs b/toolkit/components/normandy/actions/ShowHeartbeatAction.sys.mjs index d571e46167ce..1a65a10b0b94 100644 --- a/toolkit/components/normandy/actions/ShowHeartbeatAction.sys.mjs +++ b/toolkit/components/normandy/actions/ShowHeartbeatAction.sys.mjs @@ -7,12 +7,9 @@ import { BaseAction } from "resource://normandy/actions/BaseAction.sys.mjs"; const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", -}); - ChromeUtils.defineESModuleGetters(lazy, { ActionSchemas: "resource://normandy/actions/schemas/index.sys.mjs", + BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs", Heartbeat: "resource://normandy/lib/Heartbeat.sys.mjs", NormandyUtils: "resource://normandy/lib/NormandyUtils.sys.mjs", diff --git a/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs b/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs index a6cdc3471334..6bc8176eaac6 100644 --- a/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs +++ b/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs @@ -1428,7 +1428,7 @@ export var PictureInPicture = { }, /** - * This is used in AsyncTabSwitcher.jsm and tabbrowser.js to check if the browser + * This is used in AsyncTabSwitcher.sys.mjs and tabbrowser.js to check if the browser * currently has a PiP window. * If the browser has a PiP window we want to keep the browser in an active state because * the browser is still partially visible. diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 966ccd62d1a5..033ffbdb4a6e 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -2001,8 +2001,8 @@ History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI, } nsCOMPtr bwt = - do_ImportModule("resource:///modules/BrowserWindowTracker.jsm", - "BrowserWindowTracker", &rv); + do_ImportESModule("resource:///modules/BrowserWindowTracker.sys.mjs", + "BrowserWindowTracker", &rv); if (NS_SUCCEEDED(rv)) { // Only if it is running on Firefox, continue to process the followings. nsCOMPtr browser; diff --git a/toolkit/components/telemetry/app/TelemetryReportingPolicy.sys.mjs b/toolkit/components/telemetry/app/TelemetryReportingPolicy.sys.mjs index e7fd74790286..6fe155a2fa56 100644 --- a/toolkit/components/telemetry/app/TelemetryReportingPolicy.sys.mjs +++ b/toolkit/components/telemetry/app/TelemetryReportingPolicy.sys.mjs @@ -494,8 +494,8 @@ var TelemetryReportingPolicyImpl = { } firstRunPolicyURL = Services.urlFormatter.formatURL(firstRunPolicyURL); - const { BrowserWindowTracker } = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + const { BrowserWindowTracker } = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ); let win = BrowserWindowTracker.getTopWindow(); diff --git a/toolkit/content/widgets/browser-custom-element.js b/toolkit/content/widgets/browser-custom-element.js index dd1e3bc9fa3b..7b6d3aaeb193 100644 --- a/toolkit/content/widgets/browser-custom-element.js +++ b/toolkit/content/widgets/browser-custom-element.js @@ -43,9 +43,9 @@ // available, in which case we return null. We replace this getter // when the module becomes available (should be on delayed startup // when the first browser window loads, via BrowserGlue.sys.mjs). - const kURL = "resource:///modules/ProcessHangMonitor.jsm"; - if (Cu.isModuleLoaded(kURL)) { - let { ProcessHangMonitor } = ChromeUtils.import(kURL); + const kURL = "resource:///modules/ProcessHangMonitor.sys.mjs"; + if (Cu.isESModuleLoaded(kURL)) { + let { ProcessHangMonitor } = ChromeUtils.importESModule(kURL); // eslint-disable-next-line mozilla/valid-lazy Object.defineProperty(lazy, "ProcessHangMonitor", { value: ProcessHangMonitor, diff --git a/toolkit/modules/NewTabUtils.sys.mjs b/toolkit/modules/NewTabUtils.sys.mjs index 55d7d75ee5fa..6ee69d192fa1 100644 --- a/toolkit/modules/NewTabUtils.sys.mjs +++ b/toolkit/modules/NewTabUtils.sys.mjs @@ -30,8 +30,8 @@ ChromeUtils.defineESModuleGetters(lazy, { let BrowserWindowTracker; try { - BrowserWindowTracker = ChromeUtils.import( - "resource:///modules/BrowserWindowTracker.jsm" + BrowserWindowTracker = ChromeUtils.importESModule( + "resource:///modules/BrowserWindowTracker.sys.mjs" ).BrowserWindowTracker; } catch (e) { // BrowserWindowTracker is used to determine devicePixelRatio in diff --git a/toolkit/mozapps/extensions/content/aboutaddons.js b/toolkit/mozapps/extensions/content/aboutaddons.js index 8275a2afefbb..bc8101dfcdde 100644 --- a/toolkit/mozapps/extensions/content/aboutaddons.js +++ b/toolkit/mozapps/extensions/content/aboutaddons.js @@ -579,7 +579,7 @@ var DiscoveryAPI = { }, get clientIdDiscoveryEnabled() { - // These prefs match Discovery.jsm for enabling clientId cookies. + // These prefs match Discovery.sys.mjs for enabling clientId cookies. return ( Services.prefs.getBoolPref(PREF_RECOMMENDATION_ENABLED, false) && Services.prefs.getBoolPref(PREF_TELEMETRY_ENABLED, false) && diff --git a/toolkit/mozapps/extensions/test/browser/browser_html_discover_view_clientid.js b/toolkit/mozapps/extensions/test/browser/browser_html_discover_view_clientid.js index 034a42be5ac3..ff95c88fe19b 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_html_discover_view_clientid.js +++ b/toolkit/mozapps/extensions/test/browser/browser_html_discover_view_clientid.js @@ -44,7 +44,7 @@ function isNoticeVisible(win) { add_setup(async function () { await SpecialPowers.pushPrefEnv({ set: [ - // Enable clientid - see Discovery.jsm for the first two prefs. + // Enable clientid - see Discovery.sys.mjs for the first two prefs. ["browser.discovery.enabled", true], // Enabling the Data Upload pref may upload data. // Point data reporting services to localhost so the data doesn't escape. diff --git a/toolkit/mozapps/extensions/test/browser/head.js b/toolkit/mozapps/extensions/test/browser/head.js index 4d0f325858f9..22592134d4fd 100644 --- a/toolkit/mozapps/extensions/test/browser/head.js +++ b/toolkit/mozapps/extensions/test/browser/head.js @@ -1640,8 +1640,8 @@ function loadTestSubscript(filePath) { } function cleanupPendingNotifications() { - const { ExtensionsUI } = ChromeUtils.import( - "resource:///modules/ExtensionsUI.jsm" + const { ExtensionsUI } = ChromeUtils.importESModule( + "resource:///modules/ExtensionsUI.sys.mjs" ); info("Cleanup any pending notification before exiting the test"); const keys = ChromeUtils.nondeterministicGetWeakSetKeys(