Name Description Size
.eslintrc.js 439
accessibility.js Mapping of text size to contrast ratio score levels 6162
async-storage.js Adapted from https://github.com/mozilla-b2g/gaia/blob/f09993563fb5fec4393eb71816ce76cb00463190/shared/js/async_storage.js (converted to use Promises instead of callbacks). This file defines an asynchronous version of the localStorage API, backed by an IndexedDB database. It creates a global asyncStorage object that has methods like the localStorage object. To store a value use setItem: asyncStorage.setItem("key", "value"); This returns a promise in case you want confirmation that the value has been stored. asyncStorage.setItem("key", "newvalue").then(function() { console.log("new value stored"); }); To read a value, call getItem(), but note that you must wait for a promise resolution for the value to be retrieved. asyncStorage.getItem("key").then(function(value) { console.log("The value of key is:", value); }); Note that unlike localStorage, asyncStorage does not allow you to store and retrieve values by setting and querying properties directly. You cannot just write asyncStorage.key; you have to explicitly call setItem() or getItem(). removeItem(), clear(), length(), and key() are like the same-named methods of localStorage, and all return a promise. The asynchronous nature of getItem() makes it tricky to retrieve multiple values. But unlike localStorage, asyncStorage does not require the values you store to be strings. So if you need to save multiple values and want to retrieve them together, in a single asynchronous operation, just group the values into a single object. The properties of this object may not include DOM elements, but they may include things like Blobs and typed arrays. 6530
async-utils.js Helpers for async functions. An async function returns a Promise for the resolution of the function. When the function returns, the promise is resolved with the returned value. If it throws the promise rejects with the thrown error. 2361
commands
compatibility
constants.js Constants used in various panels, shared between client and the server. 5894
content-observer.js Handles adding an observer for the creation of content document globals, event sent immediately after a web content document window has been set up, but before any script code has been executed. 2130
css
debounce.js Create a debouncing function wrapper to only call the target function after a certain amount of time has passed without it being called. @param {Function} func The function to debounce @param {number} wait The wait period @param {Object} scope The scope to use for func @return {Function} The debounced function, which has a `cancel` method that the consumer can call to cancel any pending setTimeout callback. 1218
defer.js Create a Promise and return it in an object with its resolve and reject functions. This is useful when you need to settle a promise in a different location than where it is created. @returns {Object} An object with the following properties: - {Promise} promise: The created DOM promise - {Function} resolve: The resolve parameter of `promise` - {Function} reject: The reject parameter of `promise` 855
DevToolsInfaillibleUtils.sys.mjs The 3 methods here are duplicated from ThreadSafeDevToolsUtils.js The ones defined here are used from other sys.mjs files, mostly from the NetworkObserver codebase, while the ones remaining in ThreadSafeDevToolsUtils.js are used in commonjs modules, including modules which can be loaded in workers. sys.mjs modules are currently not supported in workers, see Bug 1247687. 2959
DevToolsUtils.js globals setImmediate, rpc 29847
discovery
dom-helpers.js A simple way to be notified (once) when a window becomes interactive (DOMContentLoaded). It is based on the chromeEventHandler. This is useful when chrome iframes are loaded in content docshells (in Firefox tabs for example). @param nsIDOMWindow win The content window, owning the document to traverse. @param Function callback The method to call when the frame is loaded. @param String targetURL (optional) Check that the frame URL corresponds to the provided URL before calling the callback. 1854
dom-node-constants.js 783
dom-node-filter-constants.js 708
event-emitter.js Registers an event `listener` that is called every time events of specified `type` is emitted on the given event `target`. @param {Object} target Event target object. @param {String} type The type of event. @param {Function|Object} listener The listener that processes the event. @param {Object} options @param {AbortSignal} options.signal The listener will be removed when linked AbortController’s abort() method is called @returns {Function} A function that removes the listener when called. 13451
extend.js Utility function, that is useful for creating objects that inherit from other objects, without associated classes. Replacement for `extends` API from "sdk/core/heritage". 547
flags.js This module controls various global flags that can be toggled on and off. These flags are generally used to change the behavior of the code during testing. They are tracked by preferences so that they are propagated between the parent and content processes. The flags are exposed via a module as a conveniene and to stop from littering preference names throughout the code ase. Each of the flags is documented where it is defined. 2592
generate-uuid.js Returns a new `uuid`. 334
heapsnapshot
images
indentation.js Get the number of indentation units to use to indent a "block" and a boolean indicating whether indentation must be done using tabs. @return {Object} an object of the form {indentUnit, indentWithTabs}. |indentUnit| is the number of indentation units to use to indent a "block". |indentWithTabs| is a boolean which is true if indentation should be done using tabs. 5220
indexed-db.js This indexedDB helper is a simplified version of sdk/indexed-db. It creates a DB with a principal dedicated to DevTools. 1490
inspector
jar.mn 1600
jsbeautify
l10n.js Memoized getter for properties files that ensures a given url is only required and parsed once. @param {String} url The URL of the properties file to parse. @return {Object} parsed properties mapped in an object. 8549
layout
loader
locales
moz.build 1851
natural-sort.js Sort numbers, strings, IP Addresses, Dates, Filenames, version numbers etc. "the way humans do." @param {Object} a Passed in by Array.sort(a, b) @param {Object} b Passed in by Array.sort(a, b) @param {String} sessionString Client-side value of storage-expires-session l10n string. Since this function can be called from both the client and the server, and given that client and server might have different locale, we can't compute the localized string directly from here. @param {Boolean} insensitive Should the search be case insensitive? 4377
network-observer
node-properties
path.js Join all the arguments together and normalize the resulting URI. The initial path must be an full URI with a protocol (i.e. http://). 616
performance-new
picker-constants.js Types of content pickers that can be triggered from DevTools. Used for instance by RDM to keep track of which picker is currently enabled. 446
platform
plural-form.js The code below is mostly is a slight modification of intl/locale/PluralForm.jsm that removes dependencies on chrome privileged APIs. To make maintenance easier, this file is kept as close as possible to the original in terms of implementation. The modified methods here are - makeGetter (remove code adding the caller name to the log) - get ruleNum() (rely on LocalizationHelper instead of String.services) - log() (rely on console.log) Disable eslint warnings to preserve original code style. 7044
protocol
protocol.js 1379
qrcode
security
specs
sprintfjs
storage
system.js Information from nsIXULAppInfo, regarding the application itself. 5549
test-helpers
tests
ThreadSafeDevToolsUtils.js General utilities used throughout devtools that can also be used in workers. 9800
throttle.js 1950
transport
validate-breakpoint.jsm Given a breakpoint location object, throws if the breakpoint look invalid 1600
wasm-source-map.js SourceMapConsumer for WebAssembly source maps. It transposes columns with lines, which allows mapping data to be used with SpiderMonkey Debugger API. 2659
webconsole
webextension-fallback.html 295
worker