WebNavigation API
For information on how to use experimental APIs, see the chrome.experimental.* APIs page.
WebNavigation API
Use the chrome.experimental.webNavigation module to recieve
notifications about the status of navigations requests in-flight. This
module is still very much experimental. For information on how to use
experimental APIs, see the chrome.experimental.*
APIs page.
A note about timestamps
It's important to note that some technical oddities in the OS's handling
of distinct Chrome processes can cause the clock to be skewed between the
browser itself and extension processes. That means that WebNavigation's events'
timeStamp property is only guaranteed to be internally
consistent. Comparing one event to another event will give you the correct
offset between them, but comparing them to the current time inside the
extension (via (new Date()).getTime(), for instance) might give
unexpected results.
API reference: chrome.experimental.webNavigation
Properties
getLastError
chrome.extensionlastError
Methods
getFrame
void
chrome.experimental.webNavigation.getFrame(, object
details, function
callback)
Undocumented.
Retrieves information about the given frame.
Parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
- Information about the frame to retrieve information about.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the frame is.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the frame in the given tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function(object details) {...};
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
errorOccurred
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
Events
onBeforeNavigate
chrome.experimental.webNavigation.onBeforeNavigate.addListener(function(object details) {...});
Undocumented.
Fired when a navigation is about to occur.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation is about to occur.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the browser was about to start the navigation, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns
onBeforeRetarget
chrome.experimental.webNavigation.onBeforeRetarget.addListener(function(object details) {...});
Undocumented.
Fired when a new window, or a new tab in an existing window, is about to be created to host a navigation.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
sourceTabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation is triggered.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
sourceFrameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The URL to be opened in the new window.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the url is opened
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the browser was about to create a new view, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns
onCommitted
chrome.experimental.webNavigation.onCommitted.addListener(function(object details) {...});
Undocumented.
Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation occurs.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
transitionType
(
optional
enumerated
Type
array of
string
["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"]
)
-
Undocumented.
- Cause of the navigation. The same transition types as defined in the history API are used.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
transitionQualifiers
(
optional
enumerated
Type
array of
paramType
)
-
Undocumented.
- A list of transition qualifiers.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the navigation was committed, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns
onCompleted
chrome.experimental.webNavigation.onCompleted.addListener(function(object details) {...});
Undocumented.
Fired when a document, including the resources it refers to, is completely loaded and initialized.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation occurs.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the document finished loading, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns
onDOMContentLoaded
chrome.experimental.webNavigation.onDOMContentLoaded.addListener(function(object details) {...});
Undocumented.
Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation occurs.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the page's DOM was fully constructed, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns
onErrorOccurred
chrome.experimental.webNavigation.onErrorOccurred.addListener(function(object details) {...});
Undocumented.
Fired when an error occurs.
Listener parameters
-
details
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
tabId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The ID of the tab in which the navigation occurs.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
frameId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
error
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The error description.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
timeStamp
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- The time when the error occurred, in milliseconds since the epoch.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
Extra parameters to addListener
Listener returns