From 18753bfe4203a645364f053f81b76d3930899c82 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 7 Nov 2022 17:56:10 +0000 Subject: [PATCH] Bug 1798212 - Convert consumers of downloads code to ES modules. r=mak,geckoview-reviewers,extension-reviewers,settings-reviewers,credential-management-reviewers,sgalich,mconley,m_kato Differential Revision: https://phabricator.services.mozilla.com/D161013 --- browser/base/content/browser.js | 12 ++++----- .../test/general/browser_contentAltClick.js | 8 +++--- browser/base/content/test/sanitize/head.js | 2 +- browser/components/BrowserGlue.jsm | 12 ++++----- .../downloads/DownloadSpamProtection.sys.mjs | 16 ++++++----- .../downloads/DownloadsCommon.sys.mjs | 4 +-- .../DownloadsMacFinderProgress.sys.mjs | 6 ++--- .../downloads/DownloadsTaskbar.sys.mjs | 6 ++++- .../downloads/DownloadsViewUI.sys.mjs | 4 +-- .../downloads/content/allDownloadsView.js | 6 ++--- .../components/downloads/content/downloads.js | 6 +---- .../browser/browser_download_is_clickable.js | 8 +++--- .../browser_download_opens_on_click.js | 12 ++++----- .../browser/browser_download_opens_policy.js | 12 ++++----- .../browser_download_spam_protection.js | 8 +++--- ...wser_downloads_context_menu_delete_file.js | 4 +-- .../components/downloads/test/browser/head.js | 12 ++------- .../components/downloads/test/unit/head.js | 12 ++------- .../unit/test_DownloadsViewableInternally.js | 4 ++- .../components/extensions/parent/ext-tabs.js | 14 ++++------ .../test_ext_browsingData_downloads.js | 8 +++--- .../newtab/lib/DownloadsManager.jsm | 10 ++----- browser/components/preferences/preferences.js | 4 ++- .../browser_open_download_preferences.js | 4 +-- .../screenshots/ScreenshotsUtils.sys.mjs | 7 +---- .../screenshots/content/screenshots.js | 5 +--- .../extensions/formautofill/test/unit/head.js | 5 ---- devtools/client/shared/screenshot.js | 6 +---- devtools/client/shared/test/shared-head.js | 8 +++--- .../browser_mixed_content_download.js | 14 +++------- .../browser_mixed_content_auth_download.js | 14 +++------- .../browser_test_mixed_content_download.js | 14 +++------- dom/serviceworkers/test/browser_download.js | 4 ++- .../test/browser_download_canceled.js | 4 +-- .../components/extensions/ext-downloads.js | 8 +++--- testing/modules/FileTestUtils.jsm | 4 +-- .../aboutmemory/content/aboutMemory.js | 6 +---- .../components/cleardata/ClearDataService.jsm | 2 +- .../cleardata/tests/unit/test_downloads.js | 4 +-- .../components/downloads/DownloadCore.sys.mjs | 4 +-- .../downloads/DownloadHistory.sys.mjs | 7 +++-- .../downloads/DownloadIntegration.sys.mjs | 23 +++------------- .../downloads/DownloadLegacy.sys.mjs | 14 +++------- .../downloads/DownloadStore.sys.mjs | 8 +++--- .../components/downloads/Downloads.sys.mjs | 27 +++++++------------ .../components/downloads/test/unit/head.js | 4 +-- .../downloads/test/unit/test_DownloadCore.js | 8 +++--- .../test/unit/test_DownloadHistory.js | 4 +-- .../test_DownloadHistory_initialization.js | 4 +-- .../test_DownloadHistory_initialization2.js | 4 +-- .../downloads/test/unit/test_DownloadStore.js | 14 +++------- .../extensions/parent/ext-downloads.js | 14 +++------- .../xpcshell/test_ext_downloads_download.js | 4 +-- .../test/xpcshell/test_ext_downloads_misc.js | 4 +-- .../test_ext_downloads_partitionKey.js | 4 +-- .../xpcshell/test_ext_downloads_search.js | 4 +-- .../xpcshell/test_ext_downloads_urlencoded.js | 4 +-- .../components/passwordmgr/test/unit/head.js | 5 +--- toolkit/components/printing/content/print.js | 6 +---- toolkit/content/contentAreaUtils.js | 4 +-- toolkit/mozapps/downloads/HelperAppDlg.jsm | 8 +++--- .../HelperAppLauncherDialog_chromeScript.js | 4 +-- ...ser_download_open_with_internal_handler.js | 8 +++--- .../browser_download_preferred_action.js | 4 +-- .../browser_download_privatebrowsing.js | 8 +++--- .../browser_download_skips_dialog.js | 4 +-- .../browser_launched_app_save_directory.js | 4 +-- ...rowser_open_internal_choice_persistence.js | 8 +++--- .../browser_shows_where_to_save_dialog.js | 4 +-- .../mochitest/browser_txt_download_save_as.js | 4 +-- 70 files changed, 199 insertions(+), 326 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index efaa4ccc9ba4..60107856f2a4 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -18,9 +18,10 @@ ChromeUtils.defineESModuleGetters(this, { BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", BrowserTelemetryUtils: "resource://gre/modules/BrowserTelemetryUtils.sys.mjs", Color: "resource://gre/modules/Color.sys.mjs", + Deprecated: "resource://gre/modules/Deprecated.sys.mjs", DevToolsSocketStatus: "resource://devtools/shared/security/DevToolsSocketStatus.sys.mjs", - Deprecated: "resource://gre/modules/Deprecated.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", FirefoxViewNotificationManager: "resource:///modules/firefox-view-notification-manager.sys.mjs", @@ -64,7 +65,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm", CustomizableUI: "resource:///modules/CustomizableUI.jsm", - DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", DownloadUtils: "resource://gre/modules/DownloadUtils.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", ExtensionsUI: "resource:///modules/ExtensionsUI.jsm", @@ -2410,12 +2410,12 @@ var gBrowserInit = { // downloads will start right away, and initializing again won't hurt. try { DownloadsCommon.initializeAllDataLinks(); - ChromeUtils.import( - "resource:///modules/DownloadsTaskbar.jsm" + ChromeUtils.importESModule( + "resource:///modules/DownloadsTaskbar.sys.mjs" ).DownloadsTaskbar.registerIndicator(window); if (AppConstants.platform == "macosx") { - ChromeUtils.import( - "resource:///modules/DownloadsMacFinderProgress.jsm" + ChromeUtils.importESModule( + "resource:///modules/DownloadsMacFinderProgress.sys.mjs" ).DownloadsMacFinderProgress.register(); } Services.telemetry.setEventRecordingEnabled("downloads", true); diff --git a/browser/base/content/test/general/browser_contentAltClick.js b/browser/base/content/test/general/browser_contentAltClick.js index f3e6a4aefaf7..2bafdf5370db 100644 --- a/browser/base/content/test/general/browser_contentAltClick.js +++ b/browser/base/content/test/general/browser_contentAltClick.js @@ -12,11 +12,9 @@ */ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); function setup() { Services.prefs.setBoolPref("browser.altClickSave", true); diff --git a/browser/base/content/test/sanitize/head.js b/browser/base/content/test/sanitize/head.js index 657fcdf178af..29afdcea1131 100644 --- a/browser/base/content/test/sanitize/head.js +++ b/browser/base/content/test/sanitize/head.js @@ -3,11 +3,11 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - Downloads: "resource://gre/modules/Downloads.jsm", FormHistory: "resource://gre/modules/FormHistory.jsm", Sanitizer: "resource:///modules/Sanitizer.jsm", SiteDataTestUtils: "resource://testing-common/SiteDataTestUtils.jsm", diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 4b7f9ec74f2f..df6dcc7f01c3 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -24,11 +24,13 @@ ChromeUtils.defineESModuleGetters(lazy, { BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.sys.mjs", BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.sys.mjs", BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", - DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", - E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", - Integration: "resource://gre/modules/Integration.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", DAPTelemetrySender: "resource://gre/modules/DAPTelemetrySender.sys.mjs", + DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", + DownloadsViewableInternally: + "resource:///modules/DownloadsViewableInternally.sys.mjs", + E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", + Integration: "resource://gre/modules/Integration.sys.mjs", Interactions: "resource:///modules/Interactions.sys.mjs", Log: "resource://gre/modules/Log.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", @@ -47,8 +49,8 @@ ChromeUtils.defineESModuleGetters(lazy, { UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", WebChannel: "resource://gre/modules/WebChannel.sys.mjs", WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs", - setTimeout: "resource://gre/modules/Timer.sys.mjs", clearTimeout: "resource://gre/modules/Timer.sys.mjs", + setTimeout: "resource://gre/modules/Timer.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { @@ -68,8 +70,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { Corroborate: "resource://gre/modules/Corroborate.jsm", Discovery: "resource:///modules/Discovery.jsm", DoHController: "resource:///modules/DoHController.jsm", - DownloadsViewableInternally: - "resource:///modules/DownloadsViewableInternally.jsm", ExtensionsUI: "resource:///modules/ExtensionsUI.jsm", FeatureGate: "resource://featuregates/FeatureGate.jsm", FxAccounts: "resource://gre/modules/FxAccounts.jsm", diff --git a/browser/components/downloads/DownloadSpamProtection.sys.mjs b/browser/components/downloads/DownloadSpamProtection.sys.mjs index 69078515251a..fa0cb974769a 100644 --- a/browser/components/downloads/DownloadSpamProtection.sys.mjs +++ b/browser/components/downloads/DownloadSpamProtection.sys.mjs @@ -6,19 +6,23 @@ * Provides functions to prevent multiple automatic downloads. */ -const { Download, DownloadError } = ChromeUtils.import( - "resource://gre/modules/DownloadCore.jsm" -); +import { + Download, + DownloadError, +} from "resource://gre/modules/DownloadCore.sys.mjs"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + 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", - Downloads: "resource://gre/modules/Downloads.jsm", - DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", - DownloadList: "resource://gre/modules/DownloadList.jsm", }); /** diff --git a/browser/components/downloads/DownloadsCommon.sys.mjs b/browser/components/downloads/DownloadsCommon.sys.mjs index e5b146acfb02..ebc9d5f5e331 100644 --- a/browser/components/downloads/DownloadsCommon.sys.mjs +++ b/browser/components/downloads/DownloadsCommon.sys.mjs @@ -31,6 +31,8 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs", + Downloads: "resource://gre/modules/Downloads.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); @@ -38,8 +40,6 @@ ChromeUtils.defineESModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, { NetUtil: "resource://gre/modules/NetUtil.jsm", BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - DownloadHistory: "resource://gre/modules/DownloadHistory.jsm", - Downloads: "resource://gre/modules/Downloads.jsm", DownloadUtils: "resource://gre/modules/DownloadUtils.jsm", }); diff --git a/browser/components/downloads/DownloadsMacFinderProgress.sys.mjs b/browser/components/downloads/DownloadsMacFinderProgress.sys.mjs index 94de75747dee..d4332e62156b 100644 --- a/browser/components/downloads/DownloadsMacFinderProgress.sys.mjs +++ b/browser/components/downloads/DownloadsMacFinderProgress.sys.mjs @@ -8,12 +8,10 @@ * Handles the download progress indicator of the macOS Finder. */ -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - const lazy = {}; -XPCOMUtils.defineLazyModuleGetters(lazy, { - Downloads: "resource://gre/modules/Downloads.jsm", +ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", }); export var DownloadsMacFinderProgress = { diff --git a/browser/components/downloads/DownloadsTaskbar.sys.mjs b/browser/components/downloads/DownloadsTaskbar.sys.mjs index e8819fdc9e2d..305792127dfb 100644 --- a/browser/components/downloads/DownloadsTaskbar.sys.mjs +++ b/browser/components/downloads/DownloadsTaskbar.sys.mjs @@ -13,9 +13,13 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; + +ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); + XPCOMUtils.defineLazyModuleGetters(lazy, { BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - Downloads: "resource://gre/modules/Downloads.jsm", }); XPCOMUtils.defineLazyGetter(lazy, "gWinTaskbar", function() { diff --git a/browser/components/downloads/DownloadsViewUI.sys.mjs b/browser/components/downloads/DownloadsViewUI.sys.mjs index df03077b7e95..0a02d6f39478 100644 --- a/browser/components/downloads/DownloadsViewUI.sys.mjs +++ b/browser/components/downloads/DownloadsViewUI.sys.mjs @@ -12,15 +12,15 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - Downloads: "resource://gre/modules/Downloads.jsm", DownloadUtils: "resource://gre/modules/DownloadUtils.jsm", - DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", }); XPCOMUtils.defineLazyServiceGetter( diff --git a/browser/components/downloads/content/allDownloadsView.js b/browser/components/downloads/content/allDownloadsView.js index 82761056711d..28f8a62e19d4 100644 --- a/browser/components/downloads/content/allDownloadsView.js +++ b/browser/components/downloads/content/allDownloadsView.js @@ -8,15 +8,15 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", - Downloads: "resource://gre/modules/Downloads.jsm", - DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", - DownloadsViewUI: "resource:///modules/DownloadsViewUI.jsm", NetUtil: "resource://gre/modules/NetUtil.jsm", }); diff --git a/browser/components/downloads/content/downloads.js b/browser/components/downloads/content/downloads.js index 6e2ebbb99cd0..2de6331f2fce 100644 --- a/browser/components/downloads/content/downloads.js +++ b/browser/components/downloads/content/downloads.js @@ -35,12 +35,8 @@ var { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "DownloadsViewUI", - "resource:///modules/DownloadsViewUI.jsm" -); ChromeUtils.defineESModuleGetters(this, { + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); diff --git a/browser/components/downloads/test/browser/browser_download_is_clickable.js b/browser/components/downloads/test/browser/browser_download_is_clickable.js index 13d49329444e..a4c70b3ab440 100644 --- a/browser/components/downloads/test/browser/browser_download_is_clickable.js +++ b/browser/components/downloads/test/browser/browser_download_is_clickable.js @@ -3,11 +3,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "DownloadsViewUI", - "resource:///modules/DownloadsViewUI.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", +}); const { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" diff --git a/browser/components/downloads/test/browser/browser_download_opens_on_click.js b/browser/components/downloads/test/browser/browser_download_opens_on_click.js index 513afe26c10c..5e4d91ed7de8 100644 --- a/browser/components/downloads/test/browser/browser_download_opens_on_click.js +++ b/browser/components/downloads/test/browser/browser_download_opens_on_click.js @@ -3,18 +3,16 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "DownloadsViewUI", - "resource:///modules/DownloadsViewUI.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", +}); const { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" ); -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); add_task(async function test_download_opens_on_click() { diff --git a/browser/components/downloads/test/browser/browser_download_opens_policy.js b/browser/components/downloads/test/browser/browser_download_opens_policy.js index 69d5c71ef5dd..024749617db7 100644 --- a/browser/components/downloads/test/browser/browser_download_opens_policy.js +++ b/browser/components/downloads/test/browser/browser_download_opens_policy.js @@ -7,18 +7,16 @@ const { EnterprisePolicyTesting } = ChromeUtils.importESModule( "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "DownloadsViewUI", - "resource:///modules/DownloadsViewUI.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", +}); const { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" ); -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); add_task(async function test_download_opens_on_click() { 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 fecdf45cd2a4..f34d612b4625 100644 --- a/browser/components/downloads/test/browser/browser_download_spam_protection.js +++ b/browser/components/downloads/test/browser/browser_download_spam_protection.js @@ -8,11 +8,9 @@ var { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); -ChromeUtils.defineModuleGetter( - this, - "DownloadSpamProtection", - "resource:///modules/DownloadSpamProtection.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadSpamProtection: "resource:///modules/DownloadSpamProtection.sys.mjs", +}); XPCOMUtils.defineLazyModuleGetters(this, { BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm", diff --git a/browser/components/downloads/test/browser/browser_downloads_context_menu_delete_file.js b/browser/components/downloads/test/browser/browser_downloads_context_menu_delete_file.js index 39566d26355a..7611b7e1c419 100644 --- a/browser/components/downloads/test/browser/browser_downloads_context_menu_delete_file.js +++ b/browser/components/downloads/test/browser/browser_downloads_context_menu_delete_file.js @@ -3,8 +3,8 @@ "use strict"; -var { DownloadHistory } = ChromeUtils.import( - "resource://gre/modules/DownloadHistory.jsm" +var { DownloadHistory } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadHistory.sys.mjs" ); let gDownloadDir; let downloads = []; diff --git a/browser/components/downloads/test/browser/head.js b/browser/components/downloads/test/browser/head.js index 2b35fe2b7843..3851983e29c4 100644 --- a/browser/components/downloads/test/browser/head.js +++ b/browser/components/downloads/test/browser/head.js @@ -9,17 +9,9 @@ // Globals -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm" -); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); diff --git a/browser/components/downloads/test/unit/head.js b/browser/components/downloads/test/unit/head.js index 734286dabc2e..ec5bfed6710a 100644 --- a/browser/components/downloads/test/unit/head.js +++ b/browser/components/downloads/test/unit/head.js @@ -1,14 +1,6 @@ -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm" -); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); ChromeUtils.defineModuleGetter( diff --git a/browser/components/downloads/test/unit/test_DownloadsViewableInternally.js b/browser/components/downloads/test/unit/test_DownloadsViewableInternally.js index 4b07216ad732..44477ff86258 100644 --- a/browser/components/downloads/test/unit/test_DownloadsViewableInternally.js +++ b/browser/components/downloads/test/unit/test_DownloadsViewableInternally.js @@ -20,7 +20,9 @@ const { PREF_BRANCH_WAS_REGISTERED, PREF_BRANCH_PREVIOUS_ACTION, PREF_BRANCH_PREVIOUS_ASK, -} = ChromeUtils.import("resource:///modules/DownloadsViewableInternally.jsm"); +} = ChromeUtils.importESModule( + "resource:///modules/DownloadsViewableInternally.sys.mjs" +); /* global DownloadIntegration */ Integration.downloads.defineModuleGetter( diff --git a/browser/components/extensions/parent/ext-tabs.js b/browser/components/extensions/parent/ext-tabs.js index 2edfdbc9ff97..416da9ebb059 100644 --- a/browser/components/extensions/parent/ext-tabs.js +++ b/browser/components/extensions/parent/ext-tabs.js @@ -11,20 +11,16 @@ ChromeUtils.defineModuleGetter( "BrowserUIUtils", "resource:///modules/BrowserUIUtils.jsm" ); -ChromeUtils.defineModuleGetter( - this, - "DownloadPaths", - "resource://gre/modules/DownloadPaths.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", + PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", + PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", +}); ChromeUtils.defineModuleGetter( this, "ExtensionControlledPopup", "resource:///modules/ExtensionControlledPopup.jsm" ); -ChromeUtils.defineESModuleGetters(this, { - PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", - PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", -}); ChromeUtils.defineModuleGetter( this, "SessionStore", diff --git a/browser/components/extensions/test/xpcshell/test_ext_browsingData_downloads.js b/browser/components/extensions/test/xpcshell/test_ext_browsingData_downloads.js index fa559e53c9ab..1257f2360020 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_browsingData_downloads.js +++ b/browser/components/extensions/test/xpcshell/test_ext_browsingData_downloads.js @@ -2,11 +2,9 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); const OLD_NAMES = { [Downloads.PUBLIC]: "old-public", diff --git a/browser/components/newtab/lib/DownloadsManager.jsm b/browser/components/newtab/lib/DownloadsManager.jsm index 5dbc5a2e3856..7a173e52d47a 100644 --- a/browser/components/newtab/lib/DownloadsManager.jsm +++ b/browser/components/newtab/lib/DownloadsManager.jsm @@ -2,9 +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/. */ -const { XPCOMUtils } = ChromeUtils.importESModule( - "resource://gre/modules/XPCOMUtils.sys.mjs" -); const { actionTypes: at } = ChromeUtils.import( "resource://activity-stream/common/Actions.jsm" ); @@ -12,15 +9,12 @@ const { actionTypes: at } = ChromeUtils.import( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", + DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", - DownloadsViewUI: "resource:///modules/DownloadsViewUI.jsm", -}); - const DOWNLOAD_CHANGED_DELAY_TIME = 1000; // time in ms to delay timer for downloads changed events class DownloadsManager { diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js index 4fec01dc7d13..de60f05699bd 100644 --- a/browser/components/preferences/preferences.js +++ b/browser/components/preferences/preferences.js @@ -21,7 +21,9 @@ var { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs" ); -var { Downloads } = ChromeUtils.import("resource://gre/modules/Downloads.jsm"); +var { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" +); var { Integration } = ChromeUtils.importESModule( "resource://gre/modules/Integration.sys.mjs" ); diff --git a/browser/components/preferences/tests/browser_open_download_preferences.js b/browser/components/preferences/tests/browser_open_download_preferences.js index abe91e05724c..0323105b9060 100644 --- a/browser/components/preferences/tests/browser_open_download_preferences.js +++ b/browser/components/preferences/tests/browser_open_download_preferences.js @@ -7,8 +7,8 @@ const { HandlerServiceTestUtils } = ChromeUtils.importESModule( "resource://testing-common/HandlerServiceTestUtils.sys.mjs" ); -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/browser/components/screenshots/ScreenshotsUtils.sys.mjs b/browser/components/screenshots/ScreenshotsUtils.sys.mjs index 350c3ef05d86..89b4fadb10c2 100644 --- a/browser/components/screenshots/ScreenshotsUtils.sys.mjs +++ b/browser/components/screenshots/ScreenshotsUtils.sys.mjs @@ -2,18 +2,13 @@ * 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, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(lazy, { - Downloads: "resource://gre/modules/Downloads.jsm", -}); - const PanelPosition = "bottomright topright"; const PanelOffsetX = -33; const PanelOffsetY = -8; diff --git a/browser/components/screenshots/content/screenshots.js b/browser/components/screenshots/content/screenshots.js index af137c53246a..25041c16332f 100644 --- a/browser/components/screenshots/content/screenshots.js +++ b/browser/components/screenshots/content/screenshots.js @@ -10,13 +10,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - Downloads: "resource://gre/modules/Downloads.jsm", -}); - class ScreenshotsUI extends HTMLElement { constructor() { super(); diff --git a/browser/extensions/formautofill/test/unit/head.js b/browser/extensions/formautofill/test/unit/head.js index a2b8e5a3610e..15d363b276c3 100644 --- a/browser/extensions/formautofill/test/unit/head.js +++ b/browser/extensions/formautofill/test/unit/head.js @@ -40,11 +40,6 @@ ChromeUtils.defineModuleGetter( "AddonManagerPrivate", "resource://gre/modules/AddonManager.jsm" ); -ChromeUtils.defineModuleGetter( - this, - "DownloadPaths", - "resource://gre/modules/DownloadPaths.jsm" -); ChromeUtils.defineESModuleGetters(this, { FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); diff --git a/devtools/client/shared/screenshot.js b/devtools/client/shared/screenshot.js index 2ba59df34daf..206fa7feda60 100644 --- a/devtools/client/shared/screenshot.js +++ b/devtools/client/shared/screenshot.js @@ -8,12 +8,8 @@ const { LocalizationHelper } = require("resource://devtools/shared/l10n.js"); const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js index e121d1105224..7b169c8dee51 100644 --- a/devtools/client/shared/test/shared-head.js +++ b/devtools/client/shared/test/shared-head.js @@ -1525,8 +1525,8 @@ let allDownloads = []; * screenshot appears in the private window, not the non-private one (See Bug 1783373) */ async function waitUntilScreenshot({ isWindowPrivate = false } = {}) { - const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" + const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const list = await Downloads.getList(Downloads.ALL); @@ -1561,8 +1561,8 @@ async function waitUntilScreenshot({ isWindowPrivate = false } = {}) { */ async function resetDownloads() { info("Reset downloads"); - const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" + const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const downloadList = await Downloads.getList(Downloads.ALL); const downloads = await downloadList.getAll(); diff --git a/dom/security/test/https-first/browser_mixed_content_download.js b/dom/security/test/https-first/browser_mixed_content_download.js index 0b38ca9a174f..622c085ca8b4 100644 --- a/dom/security/test/https-first/browser_mixed_content_download.js +++ b/dom/security/test/https-first/browser_mixed_content_download.js @@ -1,13 +1,7 @@ -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", +}); const HandlerService = Cc[ "@mozilla.org/uriloader/handler-service;1" diff --git a/dom/security/test/mixedcontentblocker/browser_mixed_content_auth_download.js b/dom/security/test/mixedcontentblocker/browser_mixed_content_auth_download.js index 3b103cf62512..492317e6ad08 100644 --- a/dom/security/test/mixedcontentblocker/browser_mixed_content_auth_download.js +++ b/dom/security/test/mixedcontentblocker/browser_mixed_content_auth_download.js @@ -3,16 +3,10 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", +}); const { PromptTestUtils } = ChromeUtils.import( "resource://testing-common/PromptTestUtils.jsm" diff --git a/dom/security/test/mixedcontentblocker/browser_test_mixed_content_download.js b/dom/security/test/mixedcontentblocker/browser_test_mixed_content_download.js index 755d6eba3bef..18405adee5ae 100644 --- a/dom/security/test/mixedcontentblocker/browser_test_mixed_content_download.js +++ b/dom/security/test/mixedcontentblocker/browser_test_mixed_content_download.js @@ -1,13 +1,7 @@ -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs", +}); const HandlerService = Cc[ "@mozilla.org/uriloader/handler-service;1" diff --git a/dom/serviceworkers/test/browser_download.js b/dom/serviceworkers/test/browser_download.js index 3699f4c0f7d2..3a495a9ecc4b 100644 --- a/dom/serviceworkers/test/browser_download.js +++ b/dom/serviceworkers/test/browser_download.js @@ -1,7 +1,9 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -var { Downloads } = ChromeUtils.import("resource://gre/modules/Downloads.jsm"); +var { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" +); var gTestRoot = getRootDirectory(gTestPath).replace( "chrome://mochitests/content/", diff --git a/dom/serviceworkers/test/browser_download_canceled.js b/dom/serviceworkers/test/browser_download_canceled.js index 7657a57d1130..836a581acf60 100644 --- a/dom/serviceworkers/test/browser_download_canceled.js +++ b/dom/serviceworkers/test/browser_download_canceled.js @@ -19,8 +19,8 @@ * notification with the headers, so there are two ways to produce */ -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); /** diff --git a/mobile/android/components/extensions/ext-downloads.js b/mobile/android/components/extensions/ext-downloads.js index e5e03449c546..da15b1c76348 100644 --- a/mobile/android/components/extensions/ext-downloads.js +++ b/mobile/android/components/extensions/ext-downloads.js @@ -5,11 +5,9 @@ "use strict"; ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); -ChromeUtils.defineModuleGetter( - this, - "DownloadPaths", - "resource://gre/modules/DownloadPaths.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", +}); XPCOMUtils.defineLazyModuleGetters(this, { DownloadTracker: "resource://gre/modules/GeckoViewWebExtension.jsm", }); diff --git a/testing/modules/FileTestUtils.jsm b/testing/modules/FileTestUtils.jsm index aeb6c5a75aec..189f593fcec8 100644 --- a/testing/modules/FileTestUtils.jsm +++ b/testing/modules/FileTestUtils.jsm @@ -10,8 +10,8 @@ var EXPORTED_SYMBOLS = ["FileTestUtils"]; -const { DownloadPaths } = ChromeUtils.import( - "resource://gre/modules/DownloadPaths.jsm" +const { DownloadPaths } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadPaths.sys.mjs" ); const { FileUtils } = ChromeUtils.importESModule( "resource://gre/modules/FileUtils.sys.mjs" diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index 5e6813f3a4a6..7cb5ccefb3ce 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -33,12 +33,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); diff --git a/toolkit/components/cleardata/ClearDataService.jsm b/toolkit/components/cleardata/ClearDataService.jsm index d2c43d9a5179..f3842b50fdc1 100644 --- a/toolkit/components/cleardata/ClearDataService.jsm +++ b/toolkit/components/cleardata/ClearDataService.jsm @@ -14,11 +14,11 @@ const { AppConstants } = ChromeUtils.importESModule( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - Downloads: "resource://gre/modules/Downloads.jsm", ServiceWorkerCleanUp: "resource://gre/modules/ServiceWorkerCleanUp.jsm", }); diff --git a/toolkit/components/cleardata/tests/unit/test_downloads.js b/toolkit/components/cleardata/tests/unit/test_downloads.js index 8645cdfe3477..0d88d4fdd991 100644 --- a/toolkit/components/cleardata/tests/unit/test_downloads.js +++ b/toolkit/components/cleardata/tests/unit/test_downloads.js @@ -4,8 +4,8 @@ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const { FileTestUtils } = ChromeUtils.import( "resource://testing-common/FileTestUtils.jsm" diff --git a/toolkit/components/downloads/DownloadCore.sys.mjs b/toolkit/components/downloads/DownloadCore.sys.mjs index 196c2fa8734d..ab50d61339fc 100644 --- a/toolkit/components/downloads/DownloadCore.sys.mjs +++ b/toolkit/components/downloads/DownloadCore.sys.mjs @@ -14,14 +14,14 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs", + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - DownloadHistory: "resource://gre/modules/DownloadHistory.jsm", - DownloadPaths: "resource://gre/modules/DownloadPaths.jsm", NetUtil: "resource://gre/modules/NetUtil.jsm", OS: "resource://gre/modules/osfile.jsm", }); diff --git a/toolkit/components/downloads/DownloadHistory.sys.mjs b/toolkit/components/downloads/DownloadHistory.sys.mjs index fef17866470d..8a1020f3c410 100644 --- a/toolkit/components/downloads/DownloadHistory.sys.mjs +++ b/toolkit/components/downloads/DownloadHistory.sys.mjs @@ -11,20 +11,19 @@ * exposed to allow the consumers to integrate with history view commands. */ -const { DownloadList } = ChromeUtils.import( - "resource://gre/modules/DownloadList.jsm" -); +import { DownloadList } from "resource://gre/modules/DownloadList.sys.mjs"; + import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - Downloads: "resource://gre/modules/Downloads.jsm", OS: "resource://gre/modules/osfile.jsm", }); diff --git a/toolkit/components/downloads/DownloadIntegration.sys.mjs b/toolkit/components/downloads/DownloadIntegration.sys.mjs index 95fd237219b3..a99c6661900b 100644 --- a/toolkit/components/downloads/DownloadIntegration.sys.mjs +++ b/toolkit/components/downloads/DownloadIntegration.sys.mjs @@ -9,9 +9,7 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" -); +import { Downloads } from "resource://gre/modules/Downloads.sys.mjs"; import { Integration } from "resource://gre/modules/Integration.sys.mjs"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; @@ -24,18 +22,11 @@ ChromeUtils.defineModuleGetter( ); ChromeUtils.defineESModuleGetters(lazy, { DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", + DownloadSpamProtection: "resource:///modules/DownloadSpamProtection.sys.mjs", + DownloadStore: "resource://gre/modules/DownloadStore.sys.mjs", + DownloadUIHelper: "resource://gre/modules/DownloadUIHelper.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadStore", - "resource://gre/modules/DownloadStore.jsm" -); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadUIHelper", - "resource://gre/modules/DownloadUIHelper.jsm" -); ChromeUtils.defineModuleGetter( lazy, "NetUtil", @@ -76,12 +67,6 @@ XPCOMUtils.defineLazyGetter(lazy, "gParentalControlsService", function() { return null; }); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadSpamProtection", - "resource:///modules/DownloadSpamProtection.jsm" -); - XPCOMUtils.defineLazyServiceGetter( lazy, "gApplicationReputationService", diff --git a/toolkit/components/downloads/DownloadLegacy.sys.mjs b/toolkit/components/downloads/DownloadLegacy.sys.mjs index 5d02bf6510ac..31018441dcc9 100644 --- a/toolkit/components/downloads/DownloadLegacy.sys.mjs +++ b/toolkit/components/downloads/DownloadLegacy.sys.mjs @@ -14,16 +14,10 @@ const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadError", - "resource://gre/modules/DownloadCore.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + DownloadError: "resource://gre/modules/DownloadCore.sys.mjs", + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); /** * nsITransfer implementation that provides a bridge to a Download object. diff --git a/toolkit/components/downloads/DownloadStore.sys.mjs b/toolkit/components/downloads/DownloadStore.sys.mjs index e131f0858306..21f516d72d79 100644 --- a/toolkit/components/downloads/DownloadStore.sys.mjs +++ b/toolkit/components/downloads/DownloadStore.sys.mjs @@ -34,11 +34,9 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); XPCOMUtils.defineLazyGetter(lazy, "gTextDecoder", function() { return new TextDecoder(); diff --git a/toolkit/components/downloads/Downloads.sys.mjs b/toolkit/components/downloads/Downloads.sys.mjs index 47bffb7fa650..c217e199676e 100644 --- a/toolkit/components/downloads/Downloads.sys.mjs +++ b/toolkit/components/downloads/Downloads.sys.mjs @@ -8,27 +8,18 @@ import { Integration } from "resource://gre/modules/Integration.sys.mjs"; -const { Download, DownloadError } = ChromeUtils.import( - "resource://gre/modules/DownloadCore.jsm" -); +import { + Download, + DownloadError, +} from "resource://gre/modules/DownloadCore.sys.mjs"; const lazy = {}; -ChromeUtils.defineModuleGetter( - lazy, - "DownloadCombinedList", - "resource://gre/modules/DownloadList.jsm" -); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadList", - "resource://gre/modules/DownloadList.jsm" -); -ChromeUtils.defineModuleGetter( - lazy, - "DownloadSummary", - "resource://gre/modules/DownloadList.jsm" -); +ChromeUtils.defineESModuleGetters(lazy, { + DownloadCombinedList: "resource://gre/modules/DownloadList.sys.mjs", + DownloadList: "resource://gre/modules/DownloadList.sys.mjs", + DownloadSummary: "resource://gre/modules/DownloadList.sys.mjs", +}); Integration.downloads.defineModuleGetter( lazy, diff --git a/toolkit/components/downloads/test/unit/head.js b/toolkit/components/downloads/test/unit/head.js index c80148bf4aa6..aa17d37b8799 100644 --- a/toolkit/components/downloads/test/unit/head.js +++ b/toolkit/components/downloads/test/unit/head.js @@ -20,6 +20,8 @@ const { AppConstants } = ChromeUtils.importESModule( ); ChromeUtils.defineESModuleGetters(this, { + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", + Downloads: "resource://gre/modules/Downloads.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", @@ -27,8 +29,6 @@ ChromeUtils.defineESModuleGetters(this, { }); XPCOMUtils.defineLazyModuleGetters(this, { - DownloadPaths: "resource://gre/modules/DownloadPaths.jsm", - Downloads: "resource://gre/modules/Downloads.jsm", FileTestUtils: "resource://testing-common/FileTestUtils.jsm", HttpServer: "resource://testing-common/httpd.js", MockRegistrar: "resource://testing-common/MockRegistrar.jsm", diff --git a/toolkit/components/downloads/test/unit/test_DownloadCore.js b/toolkit/components/downloads/test/unit/test_DownloadCore.js index 7f41069cba75..abb93f490306 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadCore.js +++ b/toolkit/components/downloads/test/unit/test_DownloadCore.js @@ -9,11 +9,9 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "DownloadError", - "resource://gre/modules/DownloadCore.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadError: "resource://gre/modules/DownloadCore.sys.mjs", +}); // Execution of common tests diff --git a/toolkit/components/downloads/test/unit/test_DownloadHistory.js b/toolkit/components/downloads/test/unit/test_DownloadHistory.js index 2c18e750b53d..69eb1c472878 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadHistory.js +++ b/toolkit/components/downloads/test/unit/test_DownloadHistory.js @@ -7,8 +7,8 @@ "use strict"; -const { DownloadHistory } = ChromeUtils.import( - "resource://gre/modules/DownloadHistory.jsm" +const { DownloadHistory } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadHistory.sys.mjs" ); let baseDate = new Date("2000-01-01"); diff --git a/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization.js b/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization.js index 07156d32f3bb..ea41038bf166 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization.js +++ b/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization.js @@ -3,8 +3,8 @@ "use strict"; -const { DownloadHistory } = ChromeUtils.import( - "resource://gre/modules/DownloadHistory.jsm" +const { DownloadHistory } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadHistory.sys.mjs" ); const { PlacesTestUtils } = ChromeUtils.importESModule( "resource://testing-common/PlacesTestUtils.sys.mjs" diff --git a/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization2.js b/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization2.js index c82f488725c7..8b714a8faedc 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization2.js +++ b/toolkit/components/downloads/test/unit/test_DownloadHistory_initialization2.js @@ -3,8 +3,8 @@ "use strict"; -const { DownloadHistory } = ChromeUtils.import( - "resource://gre/modules/DownloadHistory.jsm" +const { DownloadHistory } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadHistory.sys.mjs" ); /** diff --git a/toolkit/components/downloads/test/unit/test_DownloadStore.js b/toolkit/components/downloads/test/unit/test_DownloadStore.js index 4ffd062343be..99255b3f3b3c 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadStore.js +++ b/toolkit/components/downloads/test/unit/test_DownloadStore.js @@ -11,16 +11,10 @@ // Globals -ChromeUtils.defineModuleGetter( - this, - "DownloadStore", - "resource://gre/modules/DownloadStore.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadError", - "resource://gre/modules/DownloadCore.jsm" -); +ChromeUtils.defineESModuleGetters(this, { + DownloadError: "resource://gre/modules/DownloadCore.sys.mjs", + DownloadStore: "resource://gre/modules/DownloadStore.sys.mjs", +}); /** * Returns a new DownloadList object with an associated DownloadStore. diff --git a/toolkit/components/extensions/parent/ext-downloads.js b/toolkit/components/extensions/parent/ext-downloads.js index 4f70a3a84fb1..342735175cc3 100644 --- a/toolkit/components/extensions/parent/ext-downloads.js +++ b/toolkit/components/extensions/parent/ext-downloads.js @@ -4,20 +4,12 @@ "use strict"; -ChromeUtils.defineModuleGetter( - this, - "Downloads", - "resource://gre/modules/Downloads.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "DownloadPaths", - "resource://gre/modules/DownloadPaths.jsm" -); -ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); ChromeUtils.defineESModuleGetters(this, { + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); +ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); ChromeUtils.defineModuleGetter( this, "DownloadLastDir", diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js index a9edb9d13e02..d9e85772ab7c 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js @@ -3,8 +3,8 @@ "use strict"; const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const gServer = createHttpServer(); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js index bd5ab938ccdf..3265267583c4 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js @@ -2,8 +2,8 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js index 8a5168e75c5b..3326ed0ce91d 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js @@ -2,8 +2,8 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const server = createHttpServer(); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js index f28a4c881f49..98ce1dad2f74 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js @@ -2,8 +2,8 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const server = createHttpServer(); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js index 5d28986771bc..11e293519edf 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js @@ -2,8 +2,8 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); function backgroundScript() { diff --git a/toolkit/components/passwordmgr/test/unit/head.js b/toolkit/components/passwordmgr/test/unit/head.js index 5bbe2f1cc709..405bb054143f 100644 --- a/toolkit/components/passwordmgr/test/unit/head.js +++ b/toolkit/components/passwordmgr/test/unit/head.js @@ -31,13 +31,10 @@ const { MockDocument } = ChromeUtils.importESModule( const lazy = {}; ChromeUtils.defineESModuleGetters(this, { + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", }); -XPCOMUtils.defineLazyModuleGetters(this, { - DownloadPaths: "resource://gre/modules/DownloadPaths.jsm", -}); - const LoginInfo = Components.Constructor( "@mozilla.org/login-manager/loginInfo;1", "nsILoginInfo", diff --git a/toolkit/components/printing/content/print.js b/toolkit/components/printing/content/print.js index 1e839db82e32..dcfb2bd95014 100644 --- a/toolkit/components/printing/content/print.js +++ b/toolkit/components/printing/content/print.js @@ -8,13 +8,9 @@ const { AppConstants, } = window.docShell.chromeEventHandler.ownerGlobal; -ChromeUtils.defineModuleGetter( - this, - "DownloadPaths", - "resource://gre/modules/DownloadPaths.jsm" -); ChromeUtils.defineESModuleGetters(this, { DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs", + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", }); const PDF_JS_URI = "resource://pdf.js/web/viewer.html"; diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index fafc2e92cf76..5371b1a45bfc 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -12,13 +12,13 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ChromeUtils.defineESModuleGetters(this, { BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", Deprecated: "resource://gre/modules/Deprecated.sys.mjs", + DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", + Downloads: "resource://gre/modules/Downloads.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - Downloads: "resource://gre/modules/Downloads.jsm", - DownloadPaths: "resource://gre/modules/DownloadPaths.jsm", DownloadLastDir: "resource://gre/modules/DownloadLastDir.jsm", NetUtil: "resource://gre/modules/NetUtil.jsm", }); diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm index e4eac12975f0..529f9e0e2409 100644 --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm @@ -118,14 +118,14 @@ const nsITimer = Ci.nsITimer; var downloadModule = ChromeUtils.import( "resource://gre/modules/DownloadLastDir.jsm" ); -const { DownloadPaths } = ChromeUtils.import( - "resource://gre/modules/DownloadPaths.jsm" +const { DownloadPaths } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadPaths.sys.mjs" ); const { DownloadUtils } = ChromeUtils.import( "resource://gre/modules/DownloadUtils.jsm" ); -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); const { FileUtils } = ChromeUtils.importESModule( "resource://gre/modules/FileUtils.sys.mjs" diff --git a/uriloader/exthandler/tests/mochitest/HelperAppLauncherDialog_chromeScript.js b/uriloader/exthandler/tests/mochitest/HelperAppLauncherDialog_chromeScript.js index b8176dabc0af..f08cbd9ffa5a 100644 --- a/uriloader/exthandler/tests/mochitest/HelperAppLauncherDialog_chromeScript.js +++ b/uriloader/exthandler/tests/mochitest/HelperAppLauncherDialog_chromeScript.js @@ -4,8 +4,8 @@ const { ComponentUtils } = ChromeUtils.import( "resource://gre/modules/ComponentUtils.jsm" ); -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); let gMIMEService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); diff --git a/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js b/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js index b197fd635848..2b453ad71fbe 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js @@ -5,11 +5,11 @@ requestLongerTimeout(2); -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const { TelemetryTestUtils } = ChromeUtils.import( diff --git a/uriloader/exthandler/tests/mochitest/browser_download_preferred_action.js b/uriloader/exthandler/tests/mochitest/browser_download_preferred_action.js index e2a0efa4dea6..0ffcbabee063 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_preferred_action.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_preferred_action.js @@ -3,8 +3,8 @@ "use strict"; -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const { FileTestUtils } = ChromeUtils.import( "resource://testing-common/FileTestUtils.jsm" diff --git a/uriloader/exthandler/tests/mochitest/browser_download_privatebrowsing.js b/uriloader/exthandler/tests/mochitest/browser_download_privatebrowsing.js index 51840179c20d..4974c4243bae 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_privatebrowsing.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_privatebrowsing.js @@ -8,11 +8,11 @@ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); -const { DownloadPaths } = ChromeUtils.import( - "resource://gre/modules/DownloadPaths.jsm" +const { DownloadPaths } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadPaths.sys.mjs" ); const { FileTestUtils } = ChromeUtils.import( "resource://testing-common/FileTestUtils.jsm" diff --git a/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js b/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js index d2bce4c17bea..3276fbf081dc 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js @@ -1,5 +1,5 @@ -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js b/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js index 8af648fefd7c..a02a1029c114 100644 --- a/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js +++ b/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js @@ -1,5 +1,5 @@ -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const { TestUtils } = ChromeUtils.import( diff --git a/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js b/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js index e6dffa8df4ab..8063aa557556 100644 --- a/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js +++ b/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js @@ -3,11 +3,11 @@ "use strict"; -const { Downloads } = ChromeUtils.import( - "resource://gre/modules/Downloads.jsm" +const { Downloads } = ChromeUtils.importESModule( + "resource://gre/modules/Downloads.sys.mjs" ); -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js b/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js index 2fcf0c161b1c..8c7f7c732fb7 100644 --- a/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js +++ b/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js @@ -3,8 +3,8 @@ "use strict"; -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/uriloader/exthandler/tests/mochitest/browser_txt_download_save_as.js b/uriloader/exthandler/tests/mochitest/browser_txt_download_save_as.js index b7fdd657e8df..a8bad040960f 100644 --- a/uriloader/exthandler/tests/mochitest/browser_txt_download_save_as.js +++ b/uriloader/exthandler/tests/mochitest/browser_txt_download_save_as.js @@ -3,8 +3,8 @@ "use strict"; -const { DownloadIntegration } = ChromeUtils.import( - "resource://gre/modules/DownloadIntegration.jsm" +const { DownloadIntegration } = ChromeUtils.importESModule( + "resource://gre/modules/DownloadIntegration.sys.mjs" ); const HandlerService = Cc[ "@mozilla.org/uriloader/handler-service;1"