mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
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
This commit is contained in:
parent
e997490209
commit
9fe8bde13c
@ -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) {
|
||||
|
@ -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":
|
||||
|
@ -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);
|
||||
|
@ -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 = {
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
@ -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.
|
||||
|
@ -412,7 +412,7 @@ class MigrationUtils {
|
||||
});
|
||||
|
||||
Services.tm.spinEventLoopUntil(
|
||||
"MigrationUtils.jsm:MU_spinResolve",
|
||||
"MigrationUtils.sys.mjs:MU_spinResolve",
|
||||
() => done || gForceExitSpinResolve
|
||||
);
|
||||
if (!done) {
|
||||
|
@ -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.
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -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`:
|
||||
|
||||
|
@ -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(
|
||||
`
|
||||
|
@ -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.
|
||||
|
@ -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`_
|
||||
|
@ -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`_
|
||||
|
@ -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
|
||||
-------
|
||||
|
@ -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 {
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarProvidersManager.jsm>`_,
|
||||
At the core is the `UrlbarProvidersManager <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarProvidersManager.sys.mjs>`_,
|
||||
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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarTokenizer.jsm>`_
|
||||
The *searchString* gets tokenized by the `UrlbarTokenizer <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarTokenizer.sys.mjs>`_
|
||||
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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarController.jsm>`_
|
||||
`UrlbarController <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarController.sys.mjs>`_
|
||||
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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarInput.jsm>`_
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
`UrlbarInput.sys.mjs <https://searchfox.org/mozilla-central/source/browser/components/urlbar/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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarView.jsm>`_
|
||||
`UrlbarView.sys.mjs <https://searchfox.org/mozilla-central/source/browser/components/urlbar/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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarResult.jsm>`_
|
||||
An `UrlbarResult <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarResult.sys.mjs>`_
|
||||
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
|
||||
|
@ -7,7 +7,7 @@ Before results appear in the UrlbarView, they are fetched from providers.
|
||||
Each `UrlbarProvider <https://firefox-source-docs.mozilla.org/browser/urlbar/overview.html#urlbarprovider>`_
|
||||
implements its own internal ranking and returns sorted results.
|
||||
|
||||
Externally all the results are ranked by the `UrlbarMuxer <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm>`_
|
||||
Externally all the results are ranked by the `UrlbarMuxer <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarMuxerUnifiedComplete.sys.mjs>`_
|
||||
according to an hardcoded list of groups and sub-grups.
|
||||
|
||||
.. NOTE:: Preferences can influence the groups order, for example by putting
|
||||
|
@ -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 <https://searchfox.org/mozilla-central/sou
|
||||
rce/browser/components/urlbar/UrlbarProviderPlaces.jsm>`_, 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 <https://searchfox.org/mozilla-central/
|
||||
source/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm>`_.
|
||||
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 <https://
|
||||
Many test utils modules end with ``TestUtils.sys.mjs``. However not every testing
|
||||
function will end with ``TestUtils.sys.mjs``. For example, `PlacesUtils <https://
|
||||
searchfox.org/mozilla-central/source/toolkit/components/places/PlacesUtils.
|
||||
jsm>`_ 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 <https://searchfox.org/mozilla-central/source/testing/mochitest
|
||||
/tests/SimpleTest/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.
|
||||
|
||||
|
@ -3,8 +3,8 @@ Utilities
|
||||
|
||||
Various modules provide shared utilities to the other components:
|
||||
|
||||
`UrlbarPrefs.jsm <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarPrefs.jsm>`_
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
`UrlbarPrefs.sys.mjs <https://searchfox.org/mozilla-central/source/browser/components/urlbar/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 <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarUtils.jsm>`_
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
`UrlbarUtils.sys.mjs <https://searchfox.org/mozilla-central/source/browser/components/urlbar/UrlbarUtils.sys.mjs>`_
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Includes shared utils and constants shared across all the components.
|
||||
|
@ -4,7 +4,7 @@
|
||||
Browser Usage Telemetry
|
||||
=======================
|
||||
|
||||
The `BrowserUsageTelemetry.jsm <https://searchfox.org/mozilla-central/source/browser/modules/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 <https://searchfox.org/mozilla-central/source/browser/modules/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).
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
|
@ -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 => {
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user