Name Description Size Coverage
AboutPagesUtils.sys.mjs 1076 -
ActorManagerParent.sys.mjs This module handles JavaScript-implemented JSWindowActors, registered through DOM IPC infrastructure, and are fission-compatible. 22396 -
AppConstants.sys.mjs AppConstants is a set of immutable constants that are defined at build time. These should not depend on any other JavaScript module. 6809 -
AppMenuNotifications.sys.mjs 5327 -
AppServicesTracing.sys.mjs A connection between app-services tracing-support library and Firefox. Used by logging and other diagnostic support from app-services Rust components. 13267 -
AsanReporter.sys.mjs -*- indent-tabs-mode: nil; js-indent-level: 2 -*- 6420 -
AsyncPrefs.sys.mjs 4037 -
BinarySearch.sys.mjs Returns the index of the given target in the given array or -1 if the target is not found. See search() for a description of this function's parameters. @returns {integer} The index of `target` in `array` or -1 if `target` is not found. 2598 -
BrowserTelemetryUtils.sys.mjs -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- 2301 -
BrowserUtils.sys.mjs -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- 27891 -
CanonicalJSON.sys.mjs Return the canonical JSON form of the passed source, sorting all the object keys recursively. Note that this method will cause an infinite loop if cycles exist in the source (bug 1265357). @param source The elements to be serialized. The output will have all unicode chars escaped with the unicode codepoint as lowercase hexadecimal. @example CanonicalJSON.stringify(listOfRecords); 2213 -
CertUtils.sys.mjs Reads a set of expected certificate attributes from preferences. The returned array can be passed to validateCert or checkCert to validate that a certificate matches the expected attributes. The preferences should look like this: prefix.1.attribute1 prefix.1.attribute2 prefix.2.attribute1 etc. Each numeric branch contains a set of required attributes for a single certificate. Having multiple numeric branches means that multiple certificates would be accepted by validateCert. @param aPrefBranch The prefix for all preferences, should end with a ".". @return An array of JS objects with names / values corresponding to the expected certificate's attribute names / values. 6976 -
ClipboardContextMenu.sys.mjs 6428 -
Color.sys.mjs A list of minimum contrast ratio's per WCAG 2.0 conformance level. Please refer to section 1.4.3 of the WCAG 2.0 spec at http://www.w3.org/TR/WCAG20/. Simply put: A = Large text only. AA = Regular sized text or large text in enhanced contrast mode. AAA = Regular sized text in enhanced contrast mode. @type {object} 3698 -
ColorPickerPanel.sys.mjs @import {OpenPickerInfo} from "./InputPickerPanelCommon.sys.mjs" 1829 -
Console.sys.mjs Define a 'console' API to roughly match the implementation provided by Firebug. This module helps cases where code is shared between the web and Firefox. See also Browser.sys.mjs for an implementation of other web constants to help sharing code between the web and firefox; The API is only be a rough approximation for 3 reasons: - The Firebug console API is implemented in many places with differences in the implementations, so there isn't a single reference to adhere to - The Firebug console is a rich display compared with dump(), so there will be many things that we can't replicate - The primary use of this API is debugging and error logging so the perfect implementation isn't always required (or even well defined) 22570 -
ContentDOMReference.sys.mjs This module holds weak references to DOM elements that exist within the current content process, and converts them to a unique identifier that can be passed between processes. The identifer, if received by the same content process that issued it, can then be converted back into the DOM element (presuming the element hasn't had all of its other references dropped). The hope is that this module can eliminate the need for passing CPOW references between processes during runtime. 5542 -
CreditCard.sys.mjs A CreditCard object represents a credit card, with number, name, expiration, network, and CCV. The number is the only required information when creating an object, all other members are optional. The number is validated during construction and will throw if invalid. @param {string} name, optional @param {string} number @param {string} expirationString, optional @param {string|number} expirationMonth, optional @param {string|number} expirationYear, optional @param {string} network, optional @param {string|number} ccv, optional @param {string} encryptedNumber, optional @throws if number is an invalid credit card number 14334 -
DateTimePickerPanel.sys.mjs @import {OpenPickerInfo} from "./InputPickerPanelCommon.sys.mjs" 5086 -
DeferredTask.sys.mjs -*- indent-tabs-mode: nil; js-indent-level: 2 -*- 13076 -
docs -
E10SUtils.sys.mjs 27696 -
EventEmitter.sys.mjs An event emitter class that handles listeners for events being emitted. 5563 -
FaviconUtils.sys.mjs Creates a moz-remote-image: URL wrapping the specified URL. @param {string} url The URL to (remotely) load the image from. @param {object} options Further configuration options for loading. @param {number} options.size The size of the final image. Should be > 0. @param {string} options.colorScheme Either "dark" or "light". Used for SVGs. @param {number} options.contentParentId Which process to render the image in. 2153 -
FileUtils.sys.mjs -*- indent-tabs-mode: nil; js-indent-level: 2 -*- 4285 -
FindBarContent.sys.mjs Please keep in sync with toolkit/content/widgets/findbar.js 2819 -
Finder.sys.mjs 25152 -
FinderHighlighter.sys.mjs 72792 -
FinderIterator.sys.mjs FinderIterator. See the documentation for the `start()` method to learn more. 29477 -
FinderParent.sys.mjs 17235 -
FinderSound.sys.mjs 1698 -
FirstStartup.sys.mjs Service for blocking application startup, to be used on the first install. The intended use case is for `FirstStartup` to be invoked when the application is called by an installer, such as the Windows Stub Installer, to allow the application to do some first-install tasks such as performance tuning and downloading critical data. In this scenario, the installer does not exit until the first application window appears, which gives the user experience of the application starting up quickly on first install. 5921 -
FormLikeFactory.sys.mjs A factory to generate FormLike objects that represent a set of related fields which aren't necessarily marked up with a <form> element. FormLike's emulate the properties of an HTMLFormElement which are relevant to form tasks. 8976 -
gecko_metrics.yaml 3931 -
Geometry.sys.mjs Simple Point class. Any method that takes an x and y may also take a point. 9177 -
GMPExtractor.worker.js 3591 -
GMPInstallManager.sys.mjs "); xmlHttp.setRequestHeader("Range", "bytes=0-0"); xmlHttp.send(); }); } function downloadJSON(uri) { let log = getScopedLogger("GMPInstallManager.checkForAddons"); log.info("fetching config from: " + uri); return new Promise((resolve, reject) => { let xmlHttp = new lazy.ServiceRequest({ mozAnon: true }); xmlHttp.onload = function () { resolve(JSON.parse(this.responseText)); }; xmlHttp.onerror = function (e) { reject("Fetching " + uri + " results in error code: " + e.target.status); }; xmlHttp.open("GET", uri); xmlHttp.overrideMimeType("application/json"); xmlHttp.send(); }); } /** If downloading from the network fails (AUS server is down), load the sources from local build configuration. 29669 -
GMPUtils.sys.mjs Checks whether or not a given plugin is hidden. Hidden plugins are neither downloaded nor displayed in the addons manager. @param aPlugin The plugin to check. 10249 -
HiddenFrame.sys.mjs This module contains `HiddenFrame`, a class which creates a windowless browser, and `HiddenBrowserManager` which is a singleton that can be used to manage creating and using multiple hidden frames. 5978 -
IgnoreLists.sys.mjs @typedef {import("../../services/settings/RemoteSettingsClient.sys.mjs").RemoteSettingsClient} RemoteSettingsClient 3557 -
IndexedDB.sys.mjs -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- 11334 -
InlineSpellChecker.sys.mjs 18947 -
InlineSpellCheckerContent.sys.mjs 3326 -
InputPickerPanelCommon.sys.mjs @type {AbortController} 4344 -
Integration.sys.mjs Implements low-overhead integration between components of the application. This may have different uses depending on the component, including: - Providing product-specific implementations registered at startup. - Using alternative implementations during unit tests. - Allowing add-ons to change specific behaviors. Components may define one or more integration points, each defined by a root integration object whose properties and methods are the public interface and default implementation of the integration point. For example: const DownloadIntegration = { getTemporaryDirectory() { return "/tmp/"; }, getTemporaryFile(name) { return this.getTemporaryDirectory() + name; }, }; Other parts of the application may register overrides for some or all of the defined properties and methods. The component defining the integration point does not have to be loaded at this stage, because the name of the integration point is the only information required. For example, if the integration point is called "downloads": Integration.downloads.register(base => ({ getTemporaryDirectory() { return base.getTemporaryDirectory.call(this) + "subdir/"; }, })); When the component defining the integration point needs to call a method on the integration object, instead of using it directly the component would use the "getCombined" method to retrieve an object that includes all overrides. For example: let combined = Integration.downloads.getCombined(DownloadIntegration); Assert.is(combined.getTemporaryFile("file"), "/tmp/subdir/file"); Overrides can be registered at startup or at any later time, so each call to "getCombined" may return a different object. The simplest way to create a reference to the combined object that stays updated to the latest version is to define the root object in an ESM and use the "defineESModuleGetter" method. *** Registration *** Since the interface is not declared formally, the registrations can happen at startup without loading the component, so they do not affect performance. Hovever, this module does not provide a startup registry, this means that the code that registers and implements the override must be loaded at startup. If performance for the override code is a concern, you can take advantage of the fact that the function used to create the override is called lazily, and include only a stub loader for the final code in an existing startup module. The registration of overrides should be repeated for each process where the relevant integration methods will be called. *** Accessing base methods and properties *** Overrides are included in the prototype chain of the combined object in the same order they were registered, where the first is closest to the root. When defining overrides, you do not need to manipulate the prototype chain of the objects you create, because their properties and methods are moved to a new object with the correct prototype. If you do, however, you can call base properties and methods using the "super" keyword. For example: Integration.downloads.register(base => { let newObject = { getTemporaryDirectory() { return super.getTemporaryDirectory() + "subdir/"; }, }; Object.setPrototypeOf(newObject, base); return newObject; }); *** State handling *** Storing state directly on the combined integration object using the "this" reference is not recommended. When a new integration is registered, own properties stored on the old combined object are copied to the new combined object using a shallow copy, but the "this" reference for new invocations of the methods will be different. If the root object defines a property that always points to the same object, for example a "state" property, you can safely use it across registrations. Integration overrides provided by restartless add-ons should not use the "this" reference to store state, to avoid conflicts with other add-ons. *** Interaction with XPCOM *** Providing the combined object as an argument to any XPCOM method will generate a console error message, and will throw an exception where possible. For example, you cannot register observers directly on the combined object. This helps preventing mistakes due to the fact that the combined object reference changes when new integration overrides are registered. 10597 -
jar.mn 266 -
JSONFile.sys.mjs Handles serialization of the data and persistence into a file. This modules handles the raw data stored in JavaScript serializable objects, and contains no special validation or query logic, that is handled entirely by "storage.js" instead. The data can be manipulated only after it has been loaded from disk. The load process can happen asynchronously, through the "load" method, or synchronously, through "ensureDataReady". After any modification, the "saveSoon" method must be called to flush the data to disk asynchronously. The raw data should be manipulated synchronously, without waiting for the event loop or for promise resolution, so that the saved file is always consistent. This synchronous approach also simplifies the query and update logic. For example, it is possible to find an object and modify it immediately without caring whether other code modifies it in the meantime. An asynchronous shutdown observer makes sure that data is always saved before the browser is closed. The data cannot be modified during shutdown. The file is stored in JSON format, without indentation, using UTF-8 encoding. 17171 -
JsonSchema.sys.mjs A facade around @cfworker/json-schema that provides additional formats and convenience methods whil executing inside a sandbox. 5537 -
KeywordUtils.sys.mjs -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- 3831 -
LayoutUtils.sys.mjs -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- 2580 -
LightweightThemeConsumer.sys.mjs 23323 -
Log.sys.mjs Dump a message everywhere we can if we have a failure. 19400 -
LogManager.sys.mjs This module provides a file-based, persistent logging facility for scenarios where retaining those logs over time and across browser restarts is important. Unless you need this feature specifically, please use console.createInstance. 16389 -
metrics.yaml 11306 -
moz.build 10129 -
NewTabUtils.sys.mjs Calculate the MD5 hash for a string. @param aValue The string to convert. @return The base64 representation of the MD5 hash. 64068 -
NLP.sys.mjs NLP, which stands for Natural Language Processing, is a module that provides an entry point to various methods to interface with human language. At least, that's the goal. Eventually. Right now, the find toolbar only really needs the Levenshtein distance algorithm. 1965 -
nsIBrowserWindowTracker.idl Return array of browser tabs that are currently visible. 739 -
nsIRegion.idl The users current region. 622 -
ObjectUtils.sys.mjs This tests objects & values for deep equality. We check using the most exact approximation of equality between two objects to keep the chance of false positives to a minimum. `JSON.stringify` is not designed to be used for this purpose; objects may have ambiguous `toJSON()` implementations that would influence the test. @param {any} a Object or value to be compared. @param {any} b Object or value to be compared. 5879 -
OsEnvironment.sys.mjs -*- js-indent-level: 2; indent-tabs-mode: nil -*- 2927 -
OSKeyStore.sys.mjs Helpers for using OS Key Store. 14539 -
PermissionsUtils.sys.mjs Import permissions from perferences to the Permissions Manager. After being imported, all processed permissions will be set to an empty string. Perferences are only processed once during the application's lifetime - it's safe to call this multiple times without worrying about doing unnecessary work, as the preferences branch will only be processed the first time. @param aPrefBranch Preferences branch to import from. The preferences under this branch can specify whitelist (ALLOW_ACTION) or blacklist (DENY_ACTION) additions using perference names of the form: * <BRANCH>.whitelist.add.<ID> * <BRANCH>.blacklist.add.<ID> Where <ID> can be any valid preference name. The value is expected to be a comma separated list of host named. eg: * something.example.com * foo.exmaple.com,bar.example.com @param aPermission Permission name to be passsed to the Permissions Manager. 3449 -
pings.yaml 622 -
PopupNotifications.sys.mjs Given a DOM node inside a <popupnotification>, return the parent <popupnotification>. 71971 -
Preferences.sys.mjs Get the value of a pref, if any; otherwise return the default value. @param prefName {String|Array} the pref to get, or an array of prefs to get @param defaultValue the default value, if any, for prefs that don't have one @param valueType the XPCOM interface of the pref's complex value type, if any @returns the value of the pref, if any; otherwise the default value 14267 -
PrefUtils.sys.mjs Get a preference of any type from the named branch. @param {string} pref @param {object} [options] @param {"default"|"user"} [options.branchName="user"] One of "default" or "user" @param {string|boolean|integer|null} [options.defaultValue] The value to return if the preference does not exist. Defaults to null. 3951 -
PrivateBrowsingUtils.sys.mjs 2459 -
ProcessType.sys.mjs Converts a key string to a fluent ID defined in processTypes.ftl. 1825 -
ProfileAge.sys.mjs Traverse the contents of the profile directory, finding the oldest file and returning its creation timestamp. 6593 -
PropertyListUtils.sys.mjs Module for reading Property Lists (.plist) files ------------------------------------------------ This module functions as a reader for Apple Property Lists (.plist files). It supports both binary and xml formatted property lists. It does not support the legacy ASCII format. Reading of Cocoa's Keyed Archives serialized to binary property lists isn't supported either. Property Lists objects are represented by standard JS and Mozilla types, namely: XML type Cocoa Class Returned type(s) -------------------------------------------------------------------------- <true/> / <false/> NSNumber TYPE_PRIMITIVE boolean <integer> / <real> NSNumber TYPE_PRIMITIVE number TYPE_INT64 String [1] Not Available NSNull TYPE_PRIMITIVE null [2] TYPE_PRIMITIVE undefined [3] <date/> NSDate TYPE_DATE Date <data/> NSData TYPE_UINT8_ARRAY Uint8Array <array/> NSArray TYPE_ARRAY Array Not Available NSSet TYPE_ARRAY Array [2][4] <dict/> NSDictionary TYPE_DICTIONARY Map Use PropertyListUtils.getObjectType to detect the type of a Property list object. ------------- 1) Property lists supports storing U/Int64 numbers, while JS can only handle numbers that are in this limits of float-64 (±2^53). For numbers that do not outbound this limits, simple primitive number are always used. Otherwise, a String object. 2) About NSNull and NSSet values: While the xml format has no support for representing null and set values, the documentation for the binary format states that it supports storing both types. However, the Cocoa APIs for serializing property lists do not seem to support either types (test with NSPropertyListSerialization::propertyList:isValidForFormat). Furthermore, if an array or a dictionary (Map) contains a NSNull or a NSSet value, they cannot be serialized to a property list. As for usage within OS X, not surprisingly there's no known usage of storing either of these types in a property list. It seems that, for now, Apple is keeping the features of binary and xml formats in sync, probably as long as the XML format is not officially deprecated. 3) Not used anywhere. 4) About NSSet representation: For the time being, we represent those theoretical NSSet objects the same way NSArray is represented. While this would most certainly work, it is not the right way to handle it. A more correct representation for a set is a js generator, which would read the set lazily and has no indices semantics. 29727 -
Region.sys.mjs @typedef {import("../../services/settings/RemoteSettingsClient.sys.mjs").RemoteSettingsClient} RemoteSettingsClient 26811 -
RemotePageAccessManager.sys.mjs RemotePageAccessManager determines which RPM functions a given about page is allowed to access. It does this based on a map from about page URLs to allowed functions for that page/URL. An RPM function will be exported into the page only if it appears in the access managers's accessMap for that page's uri. This module may be used from both the child and parent process. Please note that prefs that one wants to update need to be explicitly allowed within AsyncPrefs.sys.mjs. 14161 -
ResetProfile.sys.mjs Check if reset is supported for the currently running profile. @returns {boolean} whether reset is supported. 3479 -
RustSharedRemoteSettingsService.sys.mjs Rust RemoteSettingsService singleton This component manages the app-wide Rust RemoteSetingsService that's shared by various other Rust components. This is only intended to be passed to Rust code. If you want a general-purpose Remote settings client, use the JS one: - https://firefox-source-docs.mozilla.org/services/settings/index.html - https://searchfox.org/mozilla-central/source/services/settings/remote-settings.sys.mjs 5649 -
SelectionUtils.sys.mjs -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- 5471 -
ServiceRequest.sys.mjs This module consolidates various code and data update requests, so flags can be set, Telemetry collected, etc. in a central place. 4642 -
sessionstore -
ShortcutUtils.sys.mjs Prettifies the modifier keys for an element. @param {Element} aElemKey The key element to get the modifiers from. @return {string} A prettified and properly separated modifier keys string. If the data on `aElemKey` is missing or incomplete, the return value is `""`. @example // example1 (macOS): <key modifiers="ctrl" key="T"/> prettifyShortcut(example1) => "⌃T" // example1 (other): <key modifiers="ctrl" key="T"/> prettifyShortcut(example1) => "Ctrl+T" // example2 (macOS): <key modifiers="ctrl,shift" key="i"/> prettifyShortcut(example2) => "⇧⌃I" // example2 (other): <key modifiers="ctrl,shift" key="i"/> prettifyShortcut(example2) => "Shift+Ctrl+I" // example3: <key/> prettifyShortcut(example3) => "" 14679 -
Sqlite.sys.mjs PRIVACY WARNING =============== Database file names can be exposed through telemetry and in crash reports on the https://crash-stats.mozilla.org site, to allow recognizing the affected database. if your database name may contain privacy sensitive information, e.g. an URL origin, you should use openDatabaseWithFileURL and pass an explicit TelemetryFilename to it. That name will be used both for telemetry and for thread names in crash reports. If you have different needs (e.g. using the javascript module or an async connection from the main thread) please coordinate with the mozStorage peers. 70212 -
SubDialog.sys.mjs The SubDialog resize callback. @callback SubDialog~resizeCallback @param {DOMNode} title - The title element of the dialog. @param {xul:browser} frame - The browser frame of the dialog. 38882 -
subprocess -
tests -
third_party -
Timer.sys.mjs JS module implementation of setTimeout and clearTimeout. 4392 -
Troubleshoot.sys.mjs 36324 -
UpdateUtils.sys.mjs Read the update channel from defaults only. We do this to ensure that the channel is tightly coupled with the application and does not apply to other instances of the application that may use the same profile. @param [optional] aIncludePartners Whether or not to include the partner bits. Default: true. 37192 -
UrlUtils.sys.mjs This module exports useful regular expressions for matching components of a url as well as functions for checking if a given string looks like a url or a part of one. Emails are explicitly NOT counted as urls since we want to deal with them separately. 8496 -
WebChannel.sys.mjs WebChannel is an abstraction that uses the Message Manager and Custom Events to create a two-way communication channel between chrome and content code. 9214 -
win.xhtml 286 -
WindowsLaunchOnLogin.sys.mjs "Launch on Login" is a Firefox feature automatically launches Firefox when the user logs in to Windows. The technical mechanism is simply writing a registry key to `Software\Microsoft\Windows\CurrentVersion\Run`, but there is an issue: when disabled in the Windows UI, additional registry keys are written under `Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run`. Any keys stored here should be seen as a user override and should never be modified. When such keys are present, the launch on login feature should be considered disabled and not available from within Firefox. This module provides the functionality to access and modify these registry keys. MSIX installs cannot write to the registry so we instead use the MSIX-exclusive Windows StartupTask APIs. The difference here is that the startup task is always "registered", we control whether it's enabled or disabled. As such some functions such as getLaunchOnLoginApproved() have different behavior on MSIX installs. 12922 -
WindowsRegistry.sys.mjs Safely reads a value from the registry. @param aRoot The root registry to use. @param aPath The registry path to the key. @param aKey The key name. @param [aRegistryNode=0] Optionally set to nsIWindowsRegKey.WOW64_64 (or nsIWindowsRegKey.WOW64_32) to access a 64-bit (32-bit) key from either a 32-bit or 64-bit application. @return The key value or undefined if it doesn't exist. If the key is a REG_MULTI_SZ, an array is returned. 2953 -