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
method name
void
chrome.module.methodName(,
)
Undocumented.
A description from the json schema def of the function goes here.
Parameters
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(Type param1, Type param2) {...};
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.
Fires when a navigation is about to occur.
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; 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.
-
-
-
-
-
requestId
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The ID of the request to retrieve the document of this navigation. Note that this event is fired prior to the corresponding chrome.experimental.webRequest.onBeforeRequest.
-
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.
-
-
-
-
-
-
-
onBeforeRetarget
chrome.experimental.webNavigation.onBeforeRetarget.addListener(function(object details) {...});
Undocumented.
Fires when a new window, or a new tab in an existing window, is about to be created to host a navigation.
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.
-
-
-
-
-
sourceUrl
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The URL of the document that is opening 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.
-
-
-
-
-
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.
-
-
-
-
-
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.
-
-
-
-
-
-
-
onCommitted
chrome.experimental.webNavigation.onCommitted.addListener(function(object details) {...});
Undocumented.
Fires 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.
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; positive value indicates navigation in a subframe.
-
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.
-
-
-
-
-
-
-
onCompleted
chrome.experimental.webNavigation.onCompleted.addListener(function(object details) {...});
Undocumented.
Fires when a document, including the resources it refers to, is completely loaded and initialized.
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; positive value indicates navigation in a subframe.
-
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.
-
-
-
-
-
-
-
onDOMContentLoaded
chrome.experimental.webNavigation.onDOMContentLoaded.addListener(function(object details) {...});
Undocumented.
Fires when the page's DOM is fully constructed, but the referenced resources may not finish loading.
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; positive value indicates navigation in a subframe.
-
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.
-
-
-
-
-
-
-
onErrorOccurred
chrome.experimental.webNavigation.onErrorOccurred.addListener(function(object details) {...});
Undocumented.
Fires when an error occurs.
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; positive value indicates navigation in a subframe.
-
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.
-
-
-
-
-
-
-