| .eslintrc.mjs |
Silencing the error because ... |
7406 |
- |
| child |
|
|
- |
| components.conf |
|
1126 |
- |
| ConduitsChild.sys.mjs |
This @file implements the child side of Conduits, an abstraction over
Fission IPC for extension API subject. See {@link ConduitsParent.sys.mjs}
for more details about the overall design.
@typedef {object} MessageData
@property {ConduitID} [target]
@property {ConduitID} [sender]
@property {boolean} query
@property {object} arg
@typedef {import("ConduitsParent.sys.mjs").ConduitAddress} ConduitAddress
@typedef {import("ConduitsParent.sys.mjs").ConduitID} ConduitID
|
6382 |
- |
| ConduitsParent.sys.mjs |
This @file implements the parent side of Conduits, an abstraction over
Fission IPC for extension Contexts, API managers, Ports/Messengers, and
other types of "subjects" participating in implementation of extension APIs.
Additionally, knowledge about conduits from all child processes is gathered
here, and used together with the full CanonicalBrowsingContext tree to route
IPC messages and queries directly to the right subjects.
Each Conduit is tied to one subject, attached to a ConduitAddress descriptor,
and exposes an API for sending/receiving via an actor, or multiple actors in
case of the parent process.
@typedef {number|string} ConduitID
@typedef {object} ConduitAddress
@property {ConduitID} [id] Globally unique across all processes.
@property {string[]} [recv]
@property {string[]} [send]
@property {string[]} [query]
@property {string[]} [cast]
@property {*} [actor]
@property {boolean} [verified]
@property {string} [url]
@property {number} [frameId]
@property {string} [workerScriptURL]
@property {number} [workerDescriptorId]
@property {string} [extensionId]
@property {string} [envType]
@property {string} [instanceId]
@property {number} [portId]
@property {boolean} [native]
@property {boolean} [source]
@property {string} [reportOnClosed]
Lists of recvX, sendX, queryX and castX methods this subject will use.
@typedef {"messenger"|"port"|"tab"} BroadcastKind
Kinds of broadcast targeting filters.
@example
```js
{
init(actor) {
this.conduit = actor.openConduit(this, {
id: this.id,
recv: ["recvAddNumber"],
send: ["sendNumberUpdate"],
});
},
recvAddNumber({ num }, { actor, sender }) {
num += 1;
this.conduit.sendNumberUpdate(sender.id, { num });
}
}
```
|
15210 |
- |
| docs |
|
|
- |
| DocumentObserver.h |
|
1874 |
- |
| dummy.xhtml |
|
296 |
- |
| ext-browser-content.js |
|
8570 |
- |
| ext-toolkit.json |
|
7077 |
- |
| Extension.sys.mjs |
This file is the main entry point for extensions. When an extension
loads, its bootstrap.js file creates a Extension instance
and calls .startup() on it. It calls .shutdown() when the extension
unloads. Extension manages any extension-specific state in
the chrome process.
TODO(rpl): we are current restricting the extensions to a single process
(set as the current default value of the "dom.ipc.processCount.extension"
preference), if we switch to use more than one extension process, we have to
be sure that all the browser's frameLoader are associated to the same process,
e.g. by enabling the `maychangeremoteness` attribute, and/or setting
`initialBrowsingContextGroupId` attribute to the correct value.
At that point we are going to keep track of the existing browsers associated to
a webextension to ensure that they are all running in the same process (and we
are also going to do the same with the browser element provided to the
addon debugging Remote Debugging actor, e.g. because the addon has been
reloaded by the user, we have to ensure that the new extension pages are going
to run in the same process of the existing addon debugging browser element).
|
153018 |
- |
| ExtensionActions.sys.mjs |
Common base class for Page and Browser actions. |
23771 |
- |
| ExtensionActivityLog.sys.mjs |
Notify all listeners of an extension activity.
@param {string} id The ID of the extension that caused the activity.
@param {string} viewType The view type the activity is in.
@param {string} type The type of the activity.
@param {string} name The API name or path.
@param {object} data Activity specific data.
@param {Date} [timeStamp] The timestamp for the activity.
|
3411 |
- |
| ExtensionChild.sys.mjs |
This file handles addon logic that is independent of the chrome process and
may run in all web content and extension processes.
Don't put contentscript logic here, use ExtensionContent.sys.mjs instead.
|
31729 |
- |
| ExtensionChildDevToolsUtils.sys.mjs |
@file
This module contains utilities for interacting with DevTools
from the child process.
|
3200 |
- |
| ExtensionCommon.sys.mjs |
This module contains utilities and base classes for logic which is
common between the parent and child process, and in particular
between ExtensionParent.sys.mjs and ExtensionChild.sys.mjs.
|
94701 |
- |
| ExtensionContent.sys.mjs |
@type {Promise<PrecompiledScript> & { script?: PrecompiledScript }} |
51795 |
- |
| ExtensionDNR.sys.mjs |
Whenever a request occurs, the rules of each RuleManager are matched against
the request to determine the final action to take. The RequestEvaluator class
is responsible for evaluating rules, and its behavior is described below.
Short version:
Find the highest-priority rule that matches the given request. If the
request is not canceled, all matching allowAllRequests and modifyHeaders
actions are returned.
Longer version:
Unless stated otherwise, the explanation below describes the behavior within
an extension.
An extension can specify rules, optionally in multiple rulesets. The ability
to have multiple ruleset exists to support bulk updates of rules. Rulesets
are NOT independent - rules from different rulesets can affect each other.
When multiple rules match, the order between rules are defined as follows:
- Ruleset precedence: session > dynamic > static (order from manifest.json).
- Rules in ruleset precedence: ordered by rule.id, lowest (numeric) ID first.
- Across all rules+rulesets: highest rule.priority (default 1) first,
action precedence if rule priority are the same.
The primary documented way for extensions to describe precedence is by
specifying rule.priority. Between same-priority rules, their precedence is
dependent on the rule action. The ruleset/rule ID precedence is only used to
have a defined ordering if multiple rules have the same priority+action.
Rule actions have the following order of precedence and meaning:
- "allow" can be used to ignore other same-or-lower-priority rules.
- "allowAllRequests" (for main_frame / sub_frame resourceTypes only) has the
same effect as allow, but also applies to (future) subresource loads in
the document (including descendant frames) generated from the request.
- "block" cancels the matched request.
- "upgradeScheme" upgrades the scheme of the request.
- "redirect" redirects the request.
- "modifyHeaders" rewrites request/response headers.
The matched rules are evaluated in two passes:
1. findMatchingRules():
Find the highest-priority rule(s), and choose the action with the highest
precedence (across all rulesets, any action except modifyHeaders).
This also accounts for any allowAllRequests from an ancestor frame.
2. getMatchingModifyHeadersRules():
Find matching rules with the "modifyHeaders" action, minus ignored rules.
Reaching this step implies that the request was not canceled, so either
the first step did not yield a rule, or the rule action is "allow" or
"allowAllRequests" (i.e. ignore same-or-lower-priority rules).
If an extension does not have sufficient permissions for the action, the
resulting action is ignored.
The above describes the evaluation within one extension. When a sequence of
(multiple) extensions is given, they may return conflicting actions in the
first pass. This is resolved by choosing the action with the following order
of precedence, in RequestEvaluator.evaluateRequest():
- block
- redirect / upgradeScheme
- allow / allowAllRequests
|
93449 |
- |
| ExtensionDNRLimits.sys.mjs |
NOTE: this limit may be increased in the future, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1894119
|
3166 |
- |
| ExtensionDNRStore.sys.mjs |
Internal representation of the enabled static rulesets (used in StoreData
and Store methods type signatures).
@typedef {object} EnabledStaticRuleset
@inner
@property {number} idx
Represent the position of the static ruleset in the manifest
`declarative_net_request.rule_resources` array.
@property {Array<Rule>} rules
Represent the array of the DNR rules associated with the static
ruleset.
|
69561 |
- |
| ExtensionMenus.sys.mjs |
MenuId represent the type of the ids associated to the extension
created menus, which is expected to be of type:
- string
- or an auto-generated integer (for menus created without a pre-assigned menu id,
only allowed for extensions with a persistent background script or without any background
context at all).
Only menus registered by extensions with a non-persistent backgrond context are going
to be persisted across sessions, and their id is always a string.
@typedef {number} integer
@typedef {string|integer} MenuId
/**
This class manages the extensions menus stored on disk across
all extensions (with kvstore as the underlying backend).
|
19502 |
- |
| ExtensionPageChild.sys.mjs |
This file handles privileged extension page logic that runs in the
child process.
|
15177 |
- |
| ExtensionParent.sys.mjs |
This module contains code for managing APIs that need to run in the
parent process, and handles the parent side of operations that need
to be proxied from ExtensionChild.sys.mjs.
|
76585 |
- |
| ExtensionPermissionMessages.sys.mjs |
Localization object holding the fluent definitions of permission descriptions
of WebExtension APIs defined in toolkit.
This is exported to allow builds (e.g. Thunderbird) to extend or modify the
object via its addResourceIds() method.
|
3926 |
- |
| ExtensionPermissions.sys.mjs |
|
32413 |
- |
| ExtensionPolicyService.cpp |
ExtensionPolicyService
*************************************************************************** |
26765 |
- |
| ExtensionPolicyService.h |
|
4526 |
- |
| ExtensionPreferencesManager.sys.mjs |
@file
This module is used for managing preferences from WebExtension APIs.
It takes care of the precedence chain and decides whether a preference
needs to be updated when a change is requested by an API.
It deals with preferences via settings objects, which are objects with
the following properties:
prefNames: An array of strings, each of which is a preference on
which the setting depends.
setCallback: A function that returns an object containing properties and
values that correspond to the prefs to be set.
|
22896 |
- |
| ExtensionProcessScript.sys.mjs |
This script contains the minimum, skeleton content process code that we need
in order to lazily load other extension modules when they are first
necessary. Anything which is not likely to be needed immediately, or shortly
after startup, in *every* browser process live outside of this file.
|
16881 |
- |
| extensionProcessScriptLoader.js |
|
310 |
- |
| extensions-toolkit.manifest |
|
835 |
- |
| ExtensionsChild.cpp |
static |
2051 |
- |
| ExtensionsChild.h |
|
903 |
- |
| ExtensionScriptingStore.sys.mjs |
Returns all the stored scripts for a given extension (ID).
@param {string} extensionId An extension ID
@returns {Promise<Array>} An array of scripts
|
11530 |
- |
| ExtensionSettingsStore.sys.mjs |
@file
This module is used for storing changes to settings that are
requested by extensions, and for finding out what the current value
of a setting should be, based on the precedence chain.
When multiple extensions request to make a change to a particular
setting, the most recently installed extension will be given
precedence.
This precedence chain of settings is stored in JSON format,
without indentation, using UTF-8 encoding.
With indentation applied, the file would look like this:
{
type: { // The type of settings being stored in this object, i.e., prefs.
key: { // The unique key for the setting.
initialValue, // The initial value of the setting.
precedenceList: [
{
id, // The id of the extension requesting the setting.
installDate, // The install date of the extension, stored as a number.
value, // The value of the setting requested by the extension.
enabled // Whether the setting is currently enabled.
}
],
},
key: {
// ...
}
}
}
|
22097 |
- |
| ExtensionShortcuts.sys.mjs |
An instance of this class is assigned to the shortcuts property of each
active webextension that has commands defined.
It manages loading any updated shortcuts along with the ones defined in
the manifest and registering them to a browser window. It also provides
the list, update and reset APIs for the browser.commands interface and
the about:addons manage shortcuts page.
|
16305 |
- |
| ExtensionsParent.cpp |
|
4066 |
- |
| ExtensionsParent.h |
|
1925 |
- |
| ExtensionStorage.sys.mjs |
Like toJSON, but attempts to serialize every value separately, and
elides any which fail to serialize. Should only be used if initial
JSON serialization fails.
@returns {object}
|
20418 |
- |
| ExtensionStorageIDB.sys.mjs |
Get the DOMException error name for a given error object.
@param {Error | undefined} error
The Error object to convert into a string, or undefined if there was no error.
@returns {string | undefined}
The DOMException error name (sliced to a maximum of 80 chars),
"OtherError" if the error object is not a DOMException instance,
or `undefined` if there wasn't an error.
|
35453 |
- |
| ExtensionStorageSync.sys.mjs |
|
4987 |
- |
| ExtensionStorageSyncKinto.sys.mjs |
@typedef {any} Collection
@typedef {any} CollectionKeyManager
@typedef {any} FXAccounts
@typedef {any} KeyBundle
@typedef {any} SyncResultObject
|
45791 |
- |
| ExtensionTaskScheduler.sys.mjs |
This file provides task queue functionality, with the following features:
- Parallel reads + sequential writes. Running tasks as fast as possible.
- Automatic lifetime management: When an extension is unloaded, the task
queue is automatically released when the last task finishes.
- Supports extension-specific operations without requiring the extension to
be running: helpers take extensionId instead of Extension.
See the ExtensionTaskScheduler class for documentation on usage.
|
10056 |
- |
| ExtensionTelemetry.sys.mjs |
Get a trimmed version of the given string if it is longer than 80 chars (used in telemetry
when a string may be longer than allowed).
@param {string} str
The original string content.
@returns {string}
The trimmed version of the string when longer than 80 chars, or the given string
unmodified otherwise.
|
9974 |
- |
| ExtensionTestCommon.sys.mjs |
This module contains extension testing helper logic which is common
between all test suites.
|
27396 |
- |
| ExtensionUserScripts.sys.mjs |
User scripts are internally represented as the options to pass to the
WebExtensionContentScript constructor in the child.
@typedef {WebExtensionContentScriptInit & {matches: string[]}} InternalUserScript
The internal representation is derived from the public representation as
defined in user_scripts.json.
@typedef {object} RegisteredUserScript
|
23443 |
- |
| ExtensionUserScriptsContent.sys.mjs |
This file handles logic related to user script code execution in content.
It complements ExtensionContent.sys.mjs and is a separate file because this
module only needs to be loaded when an extension runs user scripts.
|
9798 |
- |
| ExtensionUtils.sys.mjs |
An Error subclass for which complete error messages are always passed
to extensions, rather than being interpreted as an unknown error.
|
10205 |
- |
| ExtensionWorkerChild.sys.mjs |
This file handles extension background service worker logic that runs in the
child process.
|
25864 |
- |
| ExtensionXPCShellUtils.sys.mjs |
@type {import("resource://gre/modules/addons/XPIDatabase.sys.mjs").AddonWrapper} |
20632 |
- |
| extIWebNavigation.idl |
|
1230 |
- |
| FindContent.sys.mjs |
findRanges
Performs a search which will cache found ranges in `iterator._previousRanges`. Cached
data can then be used by `highlightResults`, `_collectRectData` and `_serializeRangeData`.
@param {object} params - the params.
@param {string} params.queryphrase - the text to search for.
@param {boolean} params.caseSensitive - whether to use case sensitive matches.
@param {boolean} params.includeRangeData - whether to collect and return range data.
@param {boolean} params.matchDiacritics - whether diacritics must match.
@param {boolean} params.searchString - whether to collect and return rect data.
@param {boolean} params.entireWord - whether to match entire words.
@param {boolean} params.includeRectData - collect and return rect data.
@returns {object} that includes:
{number} count - number of results found.
{array} rangeData (if opted) - serialized representation of ranges found.
{array} rectData (if opted) - rect data of ranges found.
|
7563 |
- |
| jar.mn |
|
4164 |
- |
| MatchGlob.h |
|
3672 |
- |
| MatchPattern.cpp |
AtomSet
*************************************************************************** |
24371 |
- |
| MatchPattern.h |
|
11946 |
- |
| MatchURLFilters.sys.mjs |
|
5207 |
- |
| MessageChannel.sys.mjs |
This module provides wrappers around standard message managers to
simplify bidirectional communication. It currently allows a caller to
send a message to a single listener, and receive a reply. If there
are no matching listeners, or the message manager disconnects before
a reply is received, the caller is returned an error.
The listener end may specify filters for the messages it wishes to
receive, and the sender end likewise may specify recipient tags to
match the filters.
The message handler on the listener side may return its response
value directly, or may return a promise, the resolution or rejection
of which will be returned instead. The sender end likewise receives a
promise which resolves or rejects to the listener's response.
A basic setup works something like this:
A content script adds a message listener to its global
ContentFrameMessageManager, with an appropriate set of filters:
{
init(messageManager, window, extensionID) {
this.window = window;
MessageChannel.addListener(
messageManager, "ContentScript:TouchContent",
this);
this.messageFilterStrict = {
innerWindowID: getInnerWindowID(window),
extensionID: extensionID,
};
this.messageFilterPermissive = {
outerWindowID: getOuterWindowID(window),
};
},
receiveMessage({ target, messageName, sender, recipient, data }) {
if (messageName == "ContentScript:TouchContent") {
return new Promise(resolve => {
this.touchWindow(data.touchWith, result => {
resolve({ touchResult: result });
});
});
}
},
};
A script in the parent process sends a message to the content process
via a tab message manager, including recipient tags to match its
filter, and an optional sender tag to identify itself:
let data = { touchWith: "pencil" };
let sender = { extensionID, contextID };
let recipient = { innerWindowID: tab.linkedBrowser.innerWindowID, extensionID };
MessageChannel.sendMessage(
tab.linkedBrowser.messageManager, "ContentScript:TouchContent",
data, {recipient, sender}
).then(result => {
alert(result.touchResult);
});
Since the lifetimes of message senders and receivers may not always
match, either side of the message channel may cancel pending
responses which match its sender or recipient tags.
For the above client, this might be done from an
inner-window-destroyed observer, when its target scope is destroyed:
observe(subject, topic, data) {
if (topic == "inner-window-destroyed") {
let innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
MessageChannel.abortResponses({ innerWindowID });
}
},
From the parent, it may be done when its context is being destroyed:
onDestroy() {
MessageChannel.abortResponses({
extensionID: this.extensionID,
contextID: this.contextID,
});
},
|
36895 |
- |
| MessageManagerProxy.sys.mjs |
Acts as a proxy for a message manager or message manager owner, and
tracks docShell swaps so that messages are always sent to the same
receiver, even if it is moved to a different <browser>.
@param {nsIMessageSender|Element} target
The target message manager on which to send messages, or the
<browser> element which owns it.
|
6262 |
- |
| metrics.yaml |
|
52487 |
- |
| moz.build |
|
4652 |
- |
| mozIExtensionAPIRequestHandling.idl |
|
7614 |
- |
| mozIExtensionProcessScript.idl |
|
736 |
- |
| NativeManifests.sys.mjs |
Parse a native manifest of the given type and name.
@param {string} type The type, one of: "pkcs11", "stdio" or "storage".
@param {string} path The path to the manifest file.
@param {string} name The name of the application.
@param {object} context A context object as expected by Schemas.normalize.
@param {object} data The JSON object of the manifest.
@returns {Promise<object>} The contents of the validated manifest, or null if
the manifest is not valid.
|
6657 |
- |
| NativeMessaging.sys.mjs |
@param {BaseContext} context The context that initiated the native app.
@param {string} application The identifier of the native app.
|
15052 |
- |
| NativeMessagingPortal.cpp |
static |
26586 |
- |
| NativeMessagingPortal.h |
|
2800 |
- |
| nsINativeMessagingPortal.idl |
An interface to talk to the WebExtensions XDG desktop portal,
for sandboxed browsers (e.g. packaged as a snap or a flatpak).
See https://github.com/flatpak/xdg-desktop-portal/issues/655.
|
3357 |
- |
| parent |
|
|
- |
| PExtensions.ipdl |
A generic protocol used by the extension framework for process-level IPC. A
child instance is created at startup in the parent process and each content
child process, which can be accessed via
`mozilla::extensions::ExtensionsChild::Get()`.
|
1863 |
- |
| ProxyChannelFilter.sys.mjs |
@returns {TabTrackerBase} |
13615 |
- |
| schemas |
|
|
- |
| Schemas.sys.mjs |
Defines a lazy getter for the given property on the given object. Any
security wrappers are waived on the object before the property is
defined, and the getter and setter methods are wrapped for the target
scope.
The given getter function is guaranteed to be called only once, even
if the target scope retrieves the wrapped getter from the property
descriptor and calls it directly.
@param {object} object
The object on which to define the getter.
@param {string | symbol} prop
The property name for which to define the getter.
@param {Function} getter
The function to call in order to generate the final property
value.
|
119974 |
- |
| storage |
|
|
- |
| test |
|
|
- |
| tsconfig.json |
|
282 |
- |
| types |
|
|
- |
| WebExtensionContentScript.h |
|
8082 |
- |
| WebExtensionPolicy.cpp |
|
46306 |
- |
| WebExtensionPolicy.h |
|
13787 |
- |
| webidl-api |
|
|
- |
| WebNavigation.sys.mjs |
@type {Map<string, Set<callback>>} |
12559 |
- |
| WebNavigationFrames.sys.mjs |
The FrameDetail object which represents a frame in WebExtensions APIs.
@typedef {object} FrameDetail
@inner
@property {number} frameId - Represents the numeric id which identify the frame in its tab.
@property {number} parentFrameId - Represents the numeric id which identify the parent frame.
@property {string} url - Represents the current location URL loaded in the frame.
@property {boolean} errorOccurred - Indicates whether an error is occurred during the last load
happened on this frame (NOT YET SUPPORTED).
|
2624 |
- |
| webrequest |
|
|
- |
| WPTEventsChild.sys.mjs |
|
1912 |
- |
| WPTEventsParent.sys.mjs |
|
3102 |
- |