From 9fe8bde13c45b0f34fe4c66653882354a2e6d3aa Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 11 Mar 2024 15:26:28 +0000 Subject: [PATCH] Bug 1884623 - Update more jsm references in production code and docs in browser/. r=mossop,extension-reviewers,omc-reviewers,migration-reviewers,robwu,mconley,aminomancer Differential Revision: https://phabricator.services.mozilla.com/D204182 --- browser/actors/SearchSERPTelemetryChild.sys.mjs | 3 ++- browser/actors/WebRTCChild.sys.mjs | 2 +- browser/app/profile/firefox.js | 2 +- browser/base/content/contentTheme.js | 2 +- browser/base/content/nsContextMenu.js | 4 +++- .../actors/AboutWelcomeChild.sys.mjs | 2 +- .../actors/AboutWelcomeParent.sys.mjs | 4 ++-- browser/components/asrouter/docs/telemetry.md | 2 +- .../asrouter/modules/ASRouterPreferences.sys.mjs | 2 +- .../migration/EdgeProfileMigrator.sys.mjs | 4 ++-- .../components/migration/MigrationUtils.sys.mjs | 2 +- browser/components/newtab/docs/index.rst | 2 +- .../newtab/docs/v2-system-addon/preferences.md | 2 +- .../docs/v2-system-addon/unit_testing_guide.md | 8 ++++---- browser/components/places/Interactions.sys.mjs | 6 +++--- browser/components/places/PlacesUIUtils.sys.mjs | 4 ++-- browser/components/places/docs/Bookmarks.rst | 6 +++--- browser/components/places/docs/History.rst | 6 +++--- .../places/docs/architecture-overview.rst | 2 +- browser/components/search/SearchOneOffs.sys.mjs | 2 +- browser/components/urlbar/UrlbarInput.sys.mjs | 2 +- .../urlbar/UrlbarProviderRemoteTabs.sys.mjs | 2 +- .../urlbar/UrlbarProviderTopSites.sys.mjs | 2 +- .../urlbar/UrlbarSearchOneOffs.sys.mjs | 2 +- browser/components/urlbar/UrlbarUtils.sys.mjs | 2 +- browser/components/urlbar/docs/overview.rst | 16 ++++++++-------- browser/components/urlbar/docs/ranking.rst | 2 +- browser/components/urlbar/docs/testing.rst | 16 ++++++++-------- browser/components/urlbar/docs/utilities.rst | 8 ++++---- browser/docs/BrowserUsageTelemetry.rst | 2 +- .../extensions/search-detection/extension/api.js | 4 ++-- browser/modules/PageActions.sys.mjs | 2 +- browser/modules/PermissionUI.sys.mjs | 4 ++-- browser/modules/Sanitizer.sys.mjs | 4 ++-- 34 files changed, 69 insertions(+), 66 deletions(-) diff --git a/browser/actors/SearchSERPTelemetryChild.sys.mjs b/browser/actors/SearchSERPTelemetryChild.sys.mjs index ac19bec4e047..0c3d1870df50 100644 --- a/browser/actors/SearchSERPTelemetryChild.sys.mjs +++ b/browser/actors/SearchSERPTelemetryChild.sys.mjs @@ -70,7 +70,8 @@ class SearchProviders { * Gets the search provider information for any provider with advert information. * If there is nothing in the cache, it will obtain it from shared data. * - * @returns {object} Returns the search provider information. @see SearchTelemetry.jsm + * @returns {object} Returns the search provider information. + * @see SearchTelemetry.sys.mjs */ get info() { if (this._searchProviderInfo) { diff --git a/browser/actors/WebRTCChild.sys.mjs b/browser/actors/WebRTCChild.sys.mjs index 9febd74b05d0..50db01709d9b 100644 --- a/browser/actors/WebRTCChild.sys.mjs +++ b/browser/actors/WebRTCChild.sys.mjs @@ -95,7 +95,7 @@ export class WebRTCChild extends JSWindowActorChild { } // This observer is called from BrowserProcessChild to avoid - // loading this .jsm when WebRTC is not in use. + // loading this module when WebRTC is not in use. static observe(aSubject, aTopic, aData) { switch (aTopic) { case "getUserMedia:request": diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 7b0c04421910..822262cbd335 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -57,7 +57,7 @@ pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/Sys pref("extensions.systemAddon.update.enabled", true); // Disable add-ons that are not installed by the user in all scopes by default. -// See the SCOPE constants in AddonManager.jsm for values to use here. +// See the SCOPE constants in AddonManager.sys.mjs for values to use here. pref("extensions.autoDisableScopes", 15); // Scopes to scan for changes at startup. pref("extensions.startupScanScopes", 0); diff --git a/browser/base/content/contentTheme.js b/browser/base/content/contentTheme.js index 805fc778c008..3c46b80becae 100644 --- a/browser/base/content/contentTheme.js +++ b/browser/base/content/contentTheme.js @@ -137,7 +137,7 @@ /** * ContentThemeController handles theme updates sent by the frame script. * To be able to use ContentThemeController, you must add your page to the whitelist - * in LightweightThemeChildListener.jsm + * in LightweightThemeChild.sys.mjs */ const ContentThemeController = { /** diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index 5b020cd5866a..660a9e4db2e3 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -336,7 +336,9 @@ class nsContextMenu { InlineSpellCheckerUI.clearDictionaryListFromMenu(); InlineSpellCheckerUI.uninit(); if ( - Cu.isModuleLoaded("resource://gre/modules/LoginManagerContextMenu.jsm") + Cu.isESModuleLoaded( + "resource://gre/modules/LoginManagerContextMenu.sys.mjs" + ) ) { nsContextMenu.LoginManagerContextMenu.clearLoginsFromMenu(document); } diff --git a/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs b/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs index 24bf73c80abb..d3a334d6127f 100644 --- a/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs +++ b/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs @@ -242,7 +242,7 @@ export class AboutWelcomeChild extends JSWindowActorChild { } /** - * Send message that can be handled by AboutWelcomeParent.jsm + * Send message that can be handled by AboutWelcomeParent.sys.mjs * * @param {string} type * @param {any=} data diff --git a/browser/components/aboutwelcome/actors/AboutWelcomeParent.sys.mjs b/browser/components/aboutwelcome/actors/AboutWelcomeParent.sys.mjs index 1eb77da0d8f9..bbcd2d0078d8 100644 --- a/browser/components/aboutwelcome/actors/AboutWelcomeParent.sys.mjs +++ b/browser/components/aboutwelcome/actors/AboutWelcomeParent.sys.mjs @@ -132,7 +132,7 @@ export class AboutWelcomeParent extends JSWindowActorParent { } /** - * Handle messages from AboutWelcomeChild.jsm + * Handle messages from AboutWelcomeChild.sys.mjs * * @param {string} type * @param {any=} data @@ -273,7 +273,7 @@ export class AboutWelcomeParent extends JSWindowActorParent { export class AboutWelcomeShoppingParent extends AboutWelcomeParent { /** - * Handle messages from AboutWelcomeChild.jsm + * Handle messages from AboutWelcomeChild.sys.mjs * * @param {string} type * @param {any=} data diff --git a/browser/components/asrouter/docs/telemetry.md b/browser/components/asrouter/docs/telemetry.md index 4484a3eaf4f2..67c5385ae9f5 100644 --- a/browser/components/asrouter/docs/telemetry.md +++ b/browser/components/asrouter/docs/telemetry.md @@ -86,5 +86,5 @@ before we can automatically act on them. * If you have any questions, the Glean Team is available across a lot of timezones on the [`#glean:mozilla.org` channel](https://chat.mozilla.org/#/room/#glean:mozilla.org) on Matrix and Slack `#data-help`. - [submit-glean-for-glean]: https://searchfox.org/mozilla-central/search?q=.submitGleanPingForPing&path=*.jsm&case=false®exp=false + [submit-glean-for-glean]: https://searchfox.org/mozilla-central/search?q=.submitGleanPingForPing&path=*.sys.mjs&case=false®exp=false [metrics-yaml]: https://searchfox.org/mozilla-central/source/browser/components/newtab/metrics.yaml diff --git a/browser/components/asrouter/modules/ASRouterPreferences.sys.mjs b/browser/components/asrouter/modules/ASRouterPreferences.sys.mjs index c7617d80c02c..e9a08fe2597b 100644 --- a/browser/components/asrouter/modules/ASRouterPreferences.sys.mjs +++ b/browser/components/asrouter/modules/ASRouterPreferences.sys.mjs @@ -9,7 +9,7 @@ const DEVTOOLS_PREF = /** * Use `ASRouterPreferences.console.debug()` and friends from ASRouter files to - * log messages during development. See LOG_LEVELS in ConsoleAPI.jsm for the + * log messages during development. See LOG_LEVELS in Console.sys.mjs for the * available methods as well as the available values for this pref. */ const DEBUG_PREF = "browser.newtabpage.activity-stream.asrouter.debugLogLevel"; diff --git a/browser/components/migration/EdgeProfileMigrator.sys.mjs b/browser/components/migration/EdgeProfileMigrator.sys.mjs index d495727ec936..d34743dcf24c 100644 --- a/browser/components/migration/EdgeProfileMigrator.sys.mjs +++ b/browser/components/migration/EdgeProfileMigrator.sys.mjs @@ -54,8 +54,8 @@ ChromeUtils.defineLazyGetter(lazy, "gEdgeDatabase", function () { * * @param {string} tableName the name of the table to read. * @param {string[]|Function} columns a list of column specifiers - * (see ESEDBReader.jsm) or a function that - * generates them based on the database + * (see ESEDBReader.sys.mjs) or a function + * that generates them based on the database * reference once opened. * @param {nsIFile} dbFile the database file to use. Defaults to * the main Edge database. diff --git a/browser/components/migration/MigrationUtils.sys.mjs b/browser/components/migration/MigrationUtils.sys.mjs index 49c8e43d9da0..cda3028cc4fe 100644 --- a/browser/components/migration/MigrationUtils.sys.mjs +++ b/browser/components/migration/MigrationUtils.sys.mjs @@ -412,7 +412,7 @@ class MigrationUtils { }); Services.tm.spinEventLoopUntil( - "MigrationUtils.jsm:MU_spinResolve", + "MigrationUtils.sys.mjs:MU_spinResolve", () => done || gForceExitSpinResolve ); if (!done) { diff --git a/browser/components/newtab/docs/index.rst b/browser/components/newtab/docs/index.rst index 48cf01c331b0..5a1168826722 100644 --- a/browser/components/newtab/docs/index.rst +++ b/browser/components/newtab/docs/index.rst @@ -8,7 +8,7 @@ Some of these source files (such as ``.js``, ``.jsx``, and ``.scss``) require an We are working on migrating this to work with ``mach``, but in the meantime, please follow the following steps if you need to make changes in this directory: -For ``.jsm`` or ``.sys.mjs`` files (system modules) +For ``.sys.mjs`` files (system modules) --------------------------------------------------- No build step is necessary. Use ``mach`` and run mochitests according to your regular Firefox workflow. diff --git a/browser/components/newtab/docs/v2-system-addon/preferences.md b/browser/components/newtab/docs/v2-system-addon/preferences.md index ec6ba82491e7..d709e830e420 100644 --- a/browser/components/newtab/docs/v2-system-addon/preferences.md +++ b/browser/components/newtab/docs/v2-system-addon/preferences.md @@ -43,7 +43,7 @@ pref in the following files: You can see an example in [this patch](https://github.com/mozilla/activity-stream/pull/2977). -## Reading, setting, and observing preferences from `.jsm`s +## Reading, setting, and observing preferences from `.sys.mjs`s To read/set/observe Activity Stream preferences, construct a `Prefs` instance found in `lib/ActivityStreamPrefs.sys.mjs`. diff --git a/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md b/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md index c3dd369a2dd4..bc0b2e8b53d3 100644 --- a/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md +++ b/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md @@ -4,7 +4,7 @@ Our unit tests in Activity Stream are written with mocha, chai, and sinon, and run with karma. They include unit tests for both content code (React components, etc.) -and `.jsm`s. +and `.sys.mjs`s. You can find unit tests in `tests/unit`. @@ -32,7 +32,7 @@ If you are creating a new test, add it to a subdirectory of the `tests/unit` that corresponds to the file you are testing. Tests should end with `.test.js` or `.test.jsx` if the test includes any jsx. -For example, if the file you are testing is `lib/Foo.jsm`, the test +For example, if the file you are testing is `lib/Foo.sys.mjs`, the test file should be `test/unit/lib/Foo.test.js` ## Mocha tests @@ -96,9 +96,9 @@ assert.isUserEventAction({type: "FOO"}); assert.isUserEventAction(ac.UserEvent({event: "BLOOP"})); ``` -## Overriding globals in `.jsm`s +## Overriding globals in `.sys.mjs`s -Most `.jsm`s you will be testing use `Cu.import` or `XPCOMUtils` to inject globals. +Most `.sys.mjs`s you will be testing use `Cu.import` or `XPCOMUtils` to inject globals. In order to add mocks/stubs/fakes for these globals, you should use the `GlobalOverrider` utility in `test/unit/utils`: diff --git a/browser/components/places/Interactions.sys.mjs b/browser/components/places/Interactions.sys.mjs index ad6b3aac4a57..36c629eb821b 100644 --- a/browser/components/places/Interactions.sys.mjs +++ b/browser/components/places/Interactions.sys.mjs @@ -612,7 +612,7 @@ class InteractionsStore { // Block async shutdown to ensure the last write goes through. this.progress = {}; lazy.PlacesUtils.history.shutdownClient.jsclient.addBlocker( - "Interactions.jsm:: store", + "Interactions.sys.mjs:: store", async () => this.flush(), { fetchState: () => this.progress } ); @@ -640,7 +640,7 @@ class InteractionsStore { */ async reset() { await lazy.PlacesUtils.withConnectionWrapper( - "Interactions.jsm::reset", + "Interactions.sys.mjs::reset", async db => { await db.executeCached(`DELETE FROM moz_places_metadata`); } @@ -735,7 +735,7 @@ class InteractionsStore { this.progress.pendingUpdates = i; await lazy.PlacesUtils.withConnectionWrapper( - "Interactions.jsm::updateDatabase", + "Interactions.sys.mjs::updateDatabase", async db => { await db.executeCached( ` diff --git a/browser/components/places/PlacesUIUtils.sys.mjs b/browser/components/places/PlacesUIUtils.sys.mjs index a7f272f78d18..b9e9efe70ed8 100644 --- a/browser/components/places/PlacesUIUtils.sys.mjs +++ b/browser/components/places/PlacesUIUtils.sys.mjs @@ -1230,8 +1230,8 @@ export var PlacesUIUtils = { * Helpers for consumers of editBookmarkOverlay which don't have a node as their input. * * Given a bookmark object for either a url bookmark or a folder, returned by - * Bookmarks.fetch (see Bookmark.jsm), this creates a node-like object suitable for - * initialising the edit overlay with it. + * Bookmarks.fetch (see Bookmark.sys.mjs), this creates a node-like object + * suitable for initialising the edit overlay with it. * * @param {object} aFetchInfo * a bookmark object returned by Bookmarks.fetch. diff --git a/browser/components/places/docs/Bookmarks.rst b/browser/components/places/docs/Bookmarks.rst index 1c830c74efd1..a7db0004f322 100644 --- a/browser/components/places/docs/Bookmarks.rst +++ b/browser/components/places/docs/Bookmarks.rst @@ -1,5 +1,5 @@ -Bookmarks.jsm -============= +Bookmarks.sys.mjs +================= Asynchronous API for managing bookmarks. Bookmarks are organized in a tree structure, and include URLs, folders and separators. Multiple bookmarks for the same URL are allowed. @@ -47,4 +47,4 @@ Main functions Each successful operation is notified through the PlacesObservers :doc:`notifyObservers` interface. -Full file with actual javadoc and description of each method - `Bookmarks.jsm`_ +Full file with actual javadoc and description of each method - `Bookmarks.sys.mjs`_ diff --git a/browser/components/places/docs/History.rst b/browser/components/places/docs/History.rst index 5dbf3704dc26..6eba0164e327 100644 --- a/browser/components/places/docs/History.rst +++ b/browser/components/places/docs/History.rst @@ -1,5 +1,5 @@ -History.jsm -=========== +History.sys.mjs +=============== Asynchronous API for managing history. @@ -40,4 +40,4 @@ Main functions Each successful operation is notified through the PlacesObservers :doc:`notifyObservers` interface. -Full file with actual javadoc and description of each method - `History.jsm`_ +Full file with actual javadoc and description of each method - `History.sys.mjs`_ diff --git a/browser/components/places/docs/architecture-overview.rst b/browser/components/places/docs/architecture-overview.rst index 76c93aa8b33d..a7b0ac9a22fe 100644 --- a/browser/components/places/docs/architecture-overview.rst +++ b/browser/components/places/docs/architecture-overview.rst @@ -86,7 +86,7 @@ Most part of backend code is located in : `Toolkit/Components/Places`_: - :doc:`PlacesTransactions` - This module serves as the transactions manager for Places .. _Toolkit/Components/Places: https://searchfox.org/mozilla-central/source/toolkit/components/places - .. _PlacesUtils: https://searchfox.org/mozilla-central/source/toolkit/components/places/PlacesUtils.jsm + .. _PlacesUtils: https://searchfox.org/mozilla-central/source/toolkit/components/places/PlacesUtils.sys.mjs Storage ------- diff --git a/browser/components/search/SearchOneOffs.sys.mjs b/browser/components/search/SearchOneOffs.sys.mjs index 0459af092a2e..ff6d3ba17e30 100644 --- a/browser/components/search/SearchOneOffs.sys.mjs +++ b/browser/components/search/SearchOneOffs.sys.mjs @@ -14,7 +14,7 @@ const EMPTY_ADD_ENGINES = []; /** * Defines the search one-off button elements. These are displayed at the bottom * of the address bar and search bar. The address bar buttons are a subclass in - * browser/components/urlbar/UrlbarSearchOneOffs.jsm. If you are adding a new + * browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs. If you are adding a new * subclass, see "Methods for subclasses to override" below. */ export class SearchOneOffs { diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs index 47614a726721..5ce17a574e9f 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -1150,7 +1150,7 @@ export class UrlbarInput { // to the list that we use to make decisions. // Because we are directly asking for a search here, bypassing the // docShell, we need to do the same ourselves. - // See also URIFixupChild.jsm and keyword-uri-fixup. + // See also URIFixupChild.sys.mjs and keyword-uri-fixup. let fixupInfo = this._getURIFixupInfo(originalUntrimmedValue.trim()); if (fixupInfo) { this.window.gKeywordURIFixup.check( diff --git a/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs b/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs index 1b84750b2536..80614dcbe316 100644 --- a/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs @@ -167,7 +167,7 @@ class ProviderRemoteTabs extends UrlbarProvider { ); // We want to return the most relevant remote tabs and thus the most - // recent ones. While SyncedTabs.jsm returns tabs that are sorted by + // recent ones. While SyncedTabs.sys.mjs returns tabs that are sorted by // most recent client, then most recent tab, we can do better. For // example, the most recent client might have one recent tab and then // many very stale tabs. Those very stale tabs will push out more recent diff --git a/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs b/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs index 4f2a51e7f3ba..e9d968f20fcc 100644 --- a/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs @@ -139,7 +139,7 @@ class ProviderTopSites extends UrlbarProvider { } // This is done here, rather than in the global scope, because - // TOP_SITES_DEFAULT_ROWS causes the import of Reducers.jsm, and we want to + // TOP_SITES_DEFAULT_ROWS causes the import of Reducers.sys.mjs, and we want to // do that only when actually querying for Top Sites. if (this.topSitesRows === undefined) { XPCOMUtils.defineLazyPreferenceGetter( diff --git a/browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs b/browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs index cdbb3aea53ac..3c79172ab452 100644 --- a/browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs +++ b/browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs @@ -27,7 +27,7 @@ export class UrlbarSearchOneOffs extends SearchOneOffs { this.view = view; this.input = view.input; lazy.UrlbarPrefs.addObserver(this); - // Override the SearchOneOffs.jsm value for the Address Bar. + // Override the SearchOneOffs.sys.mjs value for the Address Bar. this.disableOneOffsHorizontalKeyNavigation = true; this._webEngines = []; this.addEventListener("rebuild", this); diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs index 838108210740..2bbb5d1ab0fa 100644 --- a/browser/components/urlbar/UrlbarUtils.sys.mjs +++ b/browser/components/urlbar/UrlbarUtils.sys.mjs @@ -2471,7 +2471,7 @@ export class UrlbarProvider { * The index of the picked result. * {string} selType * The type of the selected result. See TelemetryEvent.record() in - * UrlbarController.jsm. + * UrlbarController.sys.mjs. * {string} provider * The name of the provider that produced the picked result. * diff --git a/browser/components/urlbar/docs/overview.rst b/browser/components/urlbar/docs/overview.rst index acc0db58744c..ea8cb9b78192 100644 --- a/browser/components/urlbar/docs/overview.rst +++ b/browser/components/urlbar/docs/overview.rst @@ -70,7 +70,7 @@ The Model The *Model* is the component responsible for retrieving search results based on the user's input, and sorting them accordingly to their importance. -At the core is the `UrlbarProvidersManager `_, +At the core is the `UrlbarProvidersManager `_, a component tracking all the available search providers, and managing searches across them. @@ -90,7 +90,7 @@ Queries can be canceled. terminating any running and future SQL query, unless a query is running inside a *runInCriticalSection* task. -The *searchString* gets tokenized by the `UrlbarTokenizer `_ +The *searchString* gets tokenized by the `UrlbarTokenizer `_ component into tokens, some of these tokens have a special meaning and can be used by the user to restrict the search to specific result type (See the *UrlbarTokenizer::TYPE* enum). @@ -118,7 +118,7 @@ UrlbarProvider A provider is specialized into searching and returning results from different information sources. Internal providers are usually implemented in separate -*jsm* modules with a *UrlbarProvider* name prefix. External providers can be +*sys.mjs* modules with a *UrlbarProvider* name prefix. External providers can be registered as *Objects* through the *UrlbarProvidersManager*. Each provider is independent and must satisfy a base API, while internal implementation details may vary deeply among different providers. @@ -235,7 +235,7 @@ indicated by the UrlbarQueryContext.muxer property. The Controller -------------- -`UrlbarController `_ +`UrlbarController `_ is the component responsible for reacting to user's input, by communicating proper course of action to the Model (e.g. starting/stopping a query) and the View (e.g. showing/hiding a panel). It is also responsible for reporting Telemetry. @@ -268,8 +268,8 @@ user and handling their input. The View is a replaceable component, as such what is described here is a reference for the default View, but may not be valid for other implementations. -`UrlbarInput.jsm `_ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`UrlbarInput.sys.mjs `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements an input box *View*, owns an *UrlbarView*. @@ -312,7 +312,7 @@ Implements an input box *View*, owns an *UrlbarView*. value; } -`UrlbarView.jsm `_ +`UrlbarView.sys.mjs `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Represents the base *View* implementation, communicates with the *Controller*. @@ -342,7 +342,7 @@ Represents the base *View* implementation, communicates with the *Controller*. UrlbarResult ------------ -An `UrlbarResult `_ +An `UrlbarResult `_ instance represents a single search result with a result type, that identifies specific kind of results. Each kind has its own properties, that the *View* may support, and a few common diff --git a/browser/components/urlbar/docs/ranking.rst b/browser/components/urlbar/docs/ranking.rst index a1c9d03c3cd2..917fd4a38d88 100644 --- a/browser/components/urlbar/docs/ranking.rst +++ b/browser/components/urlbar/docs/ranking.rst @@ -7,7 +7,7 @@ Before results appear in the UrlbarView, they are fetched from providers. Each `UrlbarProvider `_ implements its own internal ranking and returns sorted results. -Externally all the results are ranked by the `UrlbarMuxer `_ +Externally all the results are ranked by the `UrlbarMuxer `_ according to an hardcoded list of groups and sub-grups. .. NOTE:: Preferences can influence the groups order, for example by putting diff --git a/browser/components/urlbar/docs/testing.rst b/browser/components/urlbar/docs/testing.rst index a56bd297a767..14569918dc92 100644 --- a/browser/components/urlbar/docs/testing.rst +++ b/browser/components/urlbar/docs/testing.rst @@ -53,10 +53,10 @@ If you are writing a test for a urlbarProvider, you can test the Provider through a XPCShell test. Providers do not modify the UI, instead what they do is receive a url string query, search for the string and bring back the result. An example is the `ProviderPlaces `_, which fetches +rce/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs>`_, which fetches results from the Places database. Another component that’s good for writing XPCShell test is the `urlbarMuxer `_. +source/browser/components/urlbar/UrlbarMuxerUnifiedComplete.sys.mjs>`_. There may be times where writing both an XPCShell test and browser test is necessary. In these situations, you could be testing the result from a Provider @@ -131,10 +131,10 @@ This section describes common test utilities which may be useful when writing a test for the address bar. Below are a description of common utils where you can find helpful testing methods. -Many test utils modules end with ``TestUtils.jsm``. However not every testing -function will end with ``TestUtils.jsm``. For example, `PlacesUtils `_ does not have “Test” within its name. +sys.mjs>`_ does not have “Test” within its name. A critical function to remember is the ``registerCleanupFunction`` within the ``head.js`` file mentioned below. This function's purpose may be to clean @@ -150,7 +150,7 @@ test and contains imports to modules which are useful for each test. Any tasks ``head.js`` adds (via add_task) will run first for each test, and any variables and functions it defines will be available in the scope of each test. This file is small because most of our Utils are actually in other -`.jsm` files. +`.sys.mjs` files. The ``XPCOMUtils.defineLazyModuleGetters`` method within ``head.js`` sets up modules names to where they can be found, their paths. ``Lazy`` means the files @@ -189,7 +189,7 @@ new or private windows, and etc. TestUtils ~~~~~~~~~ -`TestUtils.jsm <../../testing/testutils.html>`_ is useful for general +`TestUtils.sys.mjs <../../testing/testutils.html>`_ is useful for general purpose testing and does not depend on the browser window. This file contains methods that are useful when waiting for a condition to return true, waiting for a specific preference to change, and etc. @@ -204,7 +204,7 @@ EventUtils ~~~~~~~~~~ `EventUtils.js `_ is an older test file and does not -need to be imported because it is not a ``.jsm`` file. ``EventUtils`` is only +need to be imported because it is not a ``.sys.mjs`` file. ``EventUtils`` is only used for browser tests, unlike the other TestUtils listed above which are used for browser tests, XPCShell tests and other tests. diff --git a/browser/components/urlbar/docs/utilities.rst b/browser/components/urlbar/docs/utilities.rst index 9e300878729b..27ee15df6f46 100644 --- a/browser/components/urlbar/docs/utilities.rst +++ b/browser/components/urlbar/docs/utilities.rst @@ -3,8 +3,8 @@ Utilities Various modules provide shared utilities to the other components: -`UrlbarPrefs.jsm `_ -------------------------------------------------------------------------------------------------------------- +`UrlbarPrefs.sys.mjs `_ +------------------------------------------------------------------------------------------------------------------- Implements a Map-like storage or urlbar related preferences. The values are kept up-to-date. @@ -19,7 +19,7 @@ up-to-date. Newly added preferences should always be properly documented in UrlbarPrefs. -`UrlbarUtils.jsm `_ -------------------------------------------------------------------------------------------------------------- +`UrlbarUtils.sys.mjs `_ +------------------------------------------------------------------------------------------------------------------- Includes shared utils and constants shared across all the components. diff --git a/browser/docs/BrowserUsageTelemetry.rst b/browser/docs/BrowserUsageTelemetry.rst index e3438308335e..4493560851a6 100644 --- a/browser/docs/BrowserUsageTelemetry.rst +++ b/browser/docs/BrowserUsageTelemetry.rst @@ -4,7 +4,7 @@ Browser Usage Telemetry ======================= -The `BrowserUsageTelemetry.jsm `_ module is the main module for measurements regarding the browser usage (e.g. tab and window counts, search counts, ...). +The `BrowserUsageTelemetry.sys.mjs `_ module is the main module for measurements regarding the browser usage (e.g. tab and window counts, search counts, ...). The measurements recording begins right after the ``SessionStore`` has finished restoring the session (i.e. restoring tabs/windows after Firefox starts). diff --git a/browser/extensions/search-detection/extension/api.js b/browser/extensions/search-detection/extension/api.js index dd15b080abcb..2eb792510426 100644 --- a/browser/extensions/search-detection/extension/api.js +++ b/browser/extensions/search-detection/extension/api.js @@ -61,7 +61,7 @@ this.addonsSearchDetection = class extends ExtensionAPI { _urls // We only want to collect "search URLs" (and not "suggestion" - // ones for instance). See `URL_TYPE` in `SearchUtils.jsm`. + // ones for instance). See `URL_TYPE` in `SearchUtils.sys.mjs`. .filter(({ type }) => type === "text/html") .forEach(({ template }) => { // If this is changed, double check the code in the background @@ -116,7 +116,7 @@ this.addonsSearchDetection = class extends ExtensionAPI { // search engines has changed, e.g., a new engine has been added or an // engine has been removed. // - // See: https://searchfox.org/mozilla-central/source/toolkit/components/search/SearchUtils.jsm#145-152 + // See: https://searchfox.org/mozilla-central/rev/cb44fc4f7bb84f2a18fedba64c8563770df13e34/toolkit/components/search/SearchUtils.sys.mjs#185-193 onSearchEngineModified: new ExtensionCommon.EventManager({ context, name: "addonsSearchDetection.onSearchEngineModified", diff --git a/browser/modules/PageActions.sys.mjs b/browser/modules/PageActions.sys.mjs index 4e089f2fc733..f5951142ddf7 100644 --- a/browser/modules/PageActions.sys.mjs +++ b/browser/modules/PageActions.sys.mjs @@ -896,7 +896,7 @@ Action.prototype = { * The chosen icon URL. */ _iconURLForSize(urls, preferredSize) { - // This case is copied from ExtensionParent.jsm so that our image logic is + // This case is copied from ExtensionParent.sys.mjs so that our image logic is // the same, so that WebExtensions page action tests that deal with icons // pass. let bestSize = null; diff --git a/browser/modules/PermissionUI.sys.mjs b/browser/modules/PermissionUI.sys.mjs index 2f44073f4394..e94beb79ac3d 100644 --- a/browser/modules/PermissionUI.sys.mjs +++ b/browser/modules/PermissionUI.sys.mjs @@ -19,8 +19,8 @@ * const { Integration } = ChromeUtils.importESModule( * "resource://gre/modules/Integration.sys.mjs" * ); - * const { PermissionUI } = ChromeUtils.import( - * "resource:///modules/PermissionUI.jsm" + * const { PermissionUI } = ChromeUtils.importESModule( + * "resource:///modules/PermissionUI.sys.mjs" * ); * * const SoundCardIntegration = base => { diff --git a/browser/modules/Sanitizer.sys.mjs b/browser/modules/Sanitizer.sys.mjs index 133214196b6d..13b7a307ea4f 100644 --- a/browser/modules/Sanitizer.sys.mjs +++ b/browser/modules/Sanitizer.sys.mjs @@ -27,7 +27,7 @@ var logConsole; function log(msg) { if (!logConsole) { logConsole = console.createInstance({ - prefix: "** Sanitizer.jsm", + prefix: "Sanitizer", maxLogLevelPref: "browser.sanitizer.loglevel", }); } @@ -456,7 +456,7 @@ export var Sanitizer = { // When making any changes to the sanitize implementations here, // please check whether the changes are applicable to Android - // (mobile/android/modules/geckoview/GeckoViewStorageController.jsm) as well. + // (mobile/android/modules/geckoview/GeckoViewStorageController.sys.mjs) as well. items: { cache: {