Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ The promise is rejected if the injection fails, such as when the injection targe

Each `InjectionResult` object has these properties:

- `documentId`
- : `string`. The document associated with the injection.
- `frameId`
- : `number`. The frame ID associated with the injection.
- `result` {{optional_inline}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ Values of this type are objects. They contain these properties:
- `allFrames` {{optional_inline}}
- : `boolean`. Whether the script or CSS is injected into all frames within the tab. Defaults to `false`. Cannot be `true` if `frameIds` is specified.

- `documentIds` {{optional_inline}}
- : `array` of `string`. The IDs of the documents to inject into. Must not be specified if `frameIds` is set.

- `frameIds` {{optional_inline}}
- : `array` of `number`. Array of the IDs of the frames to inject into.
- : `array` of `number`. Array of the IDs of the frames to inject into. Must not be specified if `documentIds` is set.

- `tabId`
- : `number`. The ID of the tab to inject into.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ browser.tabs.connect(
- : `integer`. ID of the tab whose content scripts we want to connect to.
- `connectInfo` {{optional_inline}}
- : An object with the following properties:
- `documentId` {{optional_inline}}
- : `string`. Open a port to a specific document identified by `documentId` instead of all frames in the tab.
- `name` {{optional_inline}}
- : `string`. Will be passed into {{WebExtAPIRef("runtime.onConnect")}} event listeners in content scripts belonging to this extension and running in the specified tab.
- `frameId` {{optional_inline}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const sending = browser.tabs.sendMessage(
- : `any`. An object that can be serialized (see [Data cloning algorithm](/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#data_cloning_algorithm)).
- `options` {{optional_inline}}
- : `object`.
- `documentId` {{optional_inline}}
- : `string`. Send a message to a specific document identified by `documentId` instead of all frames in the tab.
- `frameId` {{optional_inline}}
- : `integer`. Sends the message to a specific frame identified by `frameId` instead of all frames in the tab. Whether the content script is executed in all frames depends on the `all_frames` setting in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) section of `manifest.json`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ Events have three functions:
- : `string`. The server's [hostname](https://en.wikipedia.org/wiki/Hostname#Internet_hostnames).
- `port`
- : `integer`. The server's port number.

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `frameId`
- : `integer`. This is `0` if the request occurs in the main frame; a positive value is the ID of a subframe where the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates this frame's ID, not the outer frame's ID. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `incognito`
- : `boolean`. Whether the request is from a private browsing window.
- `isProxy`
Expand All @@ -117,6 +122,8 @@ Events have three functions:
> `webRequest.onAuthRequired` is only called for HTTP and HTTPS/TLS proxy servers requiring authentication, not for SOCKS proxy servers requiring authentication.
- `method`
- : `string`. Standard HTTP method (For example, `"GET"` or `"POST"`).
- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame that sent the request. Set to `-1` if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
- : `string`. URL of the document in which the resource will be loaded. For example, if the web page at "https\://example.com" contains an image or an iframe, then the `documentUrl` for the image or iframe will be "https\://example.com". For a top-level document, `documentUrl` is undefined.
- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `fromCache`
- : `boolean`. Indicates if this response was fetched from disk cache.
- `incognito`
Expand All @@ -69,6 +75,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
Expand All @@ -77,6 +81,8 @@ Events have three functions:

- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `incognito`
- : `boolean`. Whether the request is from a private browsing window.
- `method`
Expand All @@ -86,6 +92,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
Expand All @@ -87,6 +91,8 @@ Events have three functions:
- : `integer`. The `frameId` of the document. `details.frameAncestors[0].frameId` is the same as `details.parentFrameId`.
- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `incognito`
- : `boolean`. Whether the request is from a private browsing window.
- `method`
Expand All @@ -96,6 +102,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
- : `string`. URL of the document in which the resource will be loaded. For example, if the web page at "https\://example.com" contains an image or an iframe, then the `documentUrl` for the image or iframe will be "https\://example.com". For a top-level document, `documentUrl` is undefined.
- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `fromCache`
- : `boolean`. Indicates if this response was fetched from disk cache.
- `incognito`
Expand All @@ -69,6 +75,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
Expand All @@ -58,6 +62,8 @@ Events have three functions:
- : `string`. The error description. This string is an internal error string, may vary from one browser to another, and is not guaranteed to stay the same between releases.
- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `fromCache`
- : `boolean`. Indicates if this response was fetched from disk cache.
- `incognito`
Expand All @@ -71,6 +77,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
Expand All @@ -74,6 +78,8 @@ Events have three functions:

- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `fromCache`
- : `boolean`. Whether the response is fetched from disk cache.
- `incognito`
Expand All @@ -87,6 +93,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request is the iframe's parent document, but the `originUrl` is the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame that sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ Events have three functions:

### details

- `documentId` {{optional_inline}}
- : `string`. The UUID of the document making the request.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `cookieStoreId`
- : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
- `documentUrl`
- : `string`. URL of the document in which the resource will be loaded. For example, if the web page at "https\://example.com" contains an image or an iframe, then the `documentUrl` for the image or iframe will be "https\://example.com". For a top-level document, `documentUrl` is undefined.
- `frameId`
- : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
- `frameType`
- : `string`. The type of frame the request occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"`.
- `fromCache`
- : `boolean`. Indicates if this response was fetched from disk cache.
- `incognito`
Expand All @@ -69,6 +75,8 @@ Events have three functions:

The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link.

- `parentDocumentId`{{optional_inline}}
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `parentFrameId`
- : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.
- `proxyInfo`
Expand Down
Loading