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 @@ -31,14 +31,22 @@ A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that

- `errorOccurred`
- : `boolean`. True if the last navigation in this frame was interrupted by an error, i.e., the {{WebExtAPIRef("webNavigation.onErrorOccurred", "onErrorOccurred")}} event fired.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `url`
- : `string`. The URL associated with this frame.
- `frameId`
- : `integer`. The ID of the frame. If this is the main frame, then `frameId` is zero.
- `frameType`
- : `string`. The type of frame. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"` .
- `parentFrameId`
- : `integer`. ID of this frame's parent. This is -1 if there is no parent frame: that is, if this frame is the top-level browsing context in the tab.
- `url`
- : `string`. The URL currently associated with this frame.
- `documentId`
- : `string`. A UUID of the frame's document.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

If the tab is discarded, the promise will instead resolve with a `null` value. If the specified tab could not be found, or some other error occurs, the promise will be rejected with an error message.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,36 @@ let gettingFrame = browser.webNavigation.getFrame(
### Parameters

- `details`
- : `object`. Information about the frame to retrieve information about.
- `tabId`
- : `object`. Information about the frame to retrieve information about. Must include one of `tabId`, `frameId`, or `documentId`.
- `tabId` {{optional_inline}}
- : `integer`. The ID of the tab in which the frame is.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- `frameId` {{optional_inline}}
- : `integer`. The ID of the frame in the given tab.
- `documentId` {{optional_inline}}
- : `string`. The UUID of the frame's document.

Must include one of

### Return value

A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with an object containing the following properties:
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with an object containing these properties:

- `errorOccurred`
- : `boolean`. True if the last navigation in this frame was interrupted by an error, i.e., the {{WebExtAPIRef("webNavigation.onErrorOccurred", "onErrorOccurred")}} event fired.
- `url`
- : `string`. The URL currently associated with this frame, if the frame identified by `frameId` existed at one point in the tab identified by `tabId`. The fact that a URL is associated with a given `frameId` does not imply that the corresponding frame still exists.
- : `string`. The URL associated with this frame, if the frame identified by `frameId` existed at one point in the tab identified by `tabId`. The fact that a URL is associated with a given `frameId` does not imply that the corresponding frame still exists.
- `frameType`
- : `string`. The type of frame. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"` .
- `parentFrameId`
- : `integer`. ID of this frame's parent. This is -1 if there is no parent frame: that is, if this frame is the top-level browsing context in the tab.
- `documentId`
- : `string`. A UUID of the frame's document.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.

If the tab is discarded, the promise will instead resolve with a `null` value. If the specified tab or frame ID could not be found, or some other error occurs, the promise will be rejected with an error message.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,21 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation is about to occur.
- `url`
- : `string`. The URL to which the given frame will navigate.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation is about to occur. `0` indicates that navigation happens in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.
frameType
- `frameType`
- : `string`. The type of frame. Returns the values `"outermost_frame"`, `"fenced_frame"`, or `"sub_frame"` .
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, or `"pending_deletion"`.
- `timeStamp`
- : `number`. The time when the browser is about to start the navigation, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,31 @@ Events have three functions:

### details

- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `tabId`
- : `integer`. The ID of the tab in which the navigation is about to occur.
- `url`
- : `string`. The URL to which the given frame will navigate.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- : `string`. The URL to which the frame will navigate.
- `frameId`
- : `integer`. Frame in which the navigation will occur. `0` indicates that navigation happens in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `timeStamp`
- : `number`. The time that the navigation was committed, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
, `"fenced_frame"`, and `"sub_frame"`.
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `transitionType`
- : {{WebExtAPIRef("webNavigation.transitionType", "transitionType")}}. The reason for the navigation. (For example, `"link"` if the user clicked a link, or `"reload"` if the user reloaded the page.)
- `transitionQualifiers`
- : `Array` of {{WebExtAPIRef("webNavigation.transitionQualifier", "transitionQualifier")}}. Extra information about the navigation: for example, whether there was a server or client redirect.
- `timeStamp`
- : `number`. The time that the navigation was committed, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,22 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation has occurred.
- `url`
- : `string`. The URL to which the given frame has navigated.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation has occurred. `0` indicates that navigation happened in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happened in a nested iframe. Frame IDs are unique for a given tab and process.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `timeStamp`
- : `number`. The time at which the page finished loading, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Events have three functions:

- `sourceFrameId`
- : `integer`. ID of the frame from which the navigation is initiated. `0` indicates that the frame is the tab's top-level browsing context, not a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation is initiated from a nested iframe. Frame IDs are unique for a given tab and process.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process the navigation originated from.
- `sourceTabId`
- : `integer`. The ID of the tab from which the navigation is initiated. For example, if the user opens a link in a new tab, this will be the ID of the tab containing the link.
- `tabId`
Expand All @@ -65,6 +63,8 @@ Events have three functions:
- : `string`. The URL which will be loaded in the new tab.
- `windowId`
- : `number`. The ID of the window in which the new tab is created.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process the navigation originated from.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,22 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation has occurred.
- `url`
- : `string`. The URL to which the given frame has navigated.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation is occurring. `0` indicates that navigation happens in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `timeStamp`
- : `number`. The time at which `DOMContentLoaded` was fired, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation was happening.
- `url`
- : `string`. The URL to which the given frame was navigating.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is never set in modern browsers. It used to represent the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation was happening.

Expand All @@ -53,10 +51,20 @@ Events have three functions:

Frame IDs are unique for a given tab and process.

- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `timeStamp`
- : `number`. The time at which the error occurred, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is never set in modern browsers. It used to represent the ID of the process running the renderer for this tab.
- `error`
- : `string`. The error code. This is an internal error code, and is not guaranteed to stay the same or be consistent from one browser to another.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,26 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation is about to occur.
- `url`
- : `string`. The URL to which the given frame will navigate.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation will occur. `0` indicates that navigation happens in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `timeStamp`
- : `number`. The time that the URL was changed by the history API, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `transitionType`
- : {{WebExtAPIRef("webNavigation.transitionType", "transitionType")}}. The reason for the navigation: for example, `"link"` if the user clicked a link.
- `transitionQualifiers`
- : `Array` of {{WebExtAPIRef("webNavigation.transitionQualifier", "transitionQualifier")}}. Extra information about the navigation: for example, whether there was a server or client redirect.
- `timeStamp`
- : `number`. The time that the URL was changed by the history API, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,26 @@ Events have three functions:
- : `integer`. The ID of the tab in which the navigation is about to occur.
- `url`
- : `string`. The URL to which the given frame will navigate.
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.
- `frameId`
- : `integer`. Frame in which the navigation will occur. `0` indicates that navigation happens in the tab's top-level browsing context, not in a nested {{HTMLElement("iframe")}}. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.
- `frameType`
- : `string`. The type of frame the navigation occurred in. Returns the values `"outermost_frame"`, `"fenced_frame"`, and `"sub_frame"`.
- `parentFrameId`
- : `integer`. ID of this frame's parent. Set to `-1` if this is a top-level frame.
- `timeStamp`
- : `number`. The time that the fragment identifier for the page was changed, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `documentId`
- : `string`. A UUID of the document loaded.
- `parentDocumentId`
- : `string`. A UUID of the parent document owning the frame. Not set if there is no parent.
- `documentLifecycle`
- : `string`. The lifecycle the document is in. Returns the values `"prerender"`, `"active"`, `"cached"`, and `"pending_deletion"`.
- `transitionType`
- : {{WebExtAPIRef("webNavigation.transitionType", "transitionType")}}. The reason for the navigation: for example, `"link"` if the user clicked a link.
- `transitionQualifiers`
- : `Array` of {{WebExtAPIRef("webNavigation.transitionQualifier", "transitionQualifier")}}. Extra information about the navigation: for example, whether there was a server or client redirect.
- `timeStamp`
- : `number`. The time that the fragment identifier for the page was changed, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time).
- `processId` {{optional_inline}} {{deprecated_inline}}
- : `integer`. This value is not set in modern browsers. When it was set, it represented the ID of the process running the renderer for this tab.

## Examples

Expand Down