webNavigation

Get notifications about the various stages of a navigation event.

To use this API you need to have the "webNavigation" permission.

Types

webNavigation.TransitionType
Cause of the navigation.
webNavigation.TransitionQualifier

Functions

webNavigation.getFrame()
Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
webNavigation.getAllFrames()
Retrieves information about all frames of a given tab.

Events

webNavigation.onBeforeNavigate
Fired when a navigation is about to occur.
webNavigation.onCommitted
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.
webNavigation.onDOMContentLoaded
Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.
webNavigation.onCompleted
Fired when a document, including the resources it refers to, is completely loaded and initialized.
webNavigation.onErrorOccurred
Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.
webNavigation.onCreatedNavigationTarget
Fired when a new window, or a new tab in an existing window, is created to host a navigation.
webNavigation.onReferenceFragmentUpdated
Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.
webNavigation.onTabReplaced
Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.
webNavigation.onHistoryStateUpdated
Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.

Browser compatibility

EdgeFirefoxChromeOpera
TransitionQualifier?45.0Yes33
TransitionType?45.0Yes33
getAllFrames?47.0Yes33
getFrame?47.0Yes33
onBeforeNavigate?45.0Yes33
onCommitted?45.0Yes33
onCompleted?45.0Yes33
onCreatedNavigationTarget?NoYes33
onDOMContentLoaded?45.0Yes33
onErrorOccurred?45.0Yes33
onHistoryStateUpdated?47.0Yes33
onReferenceFragmentUpdated?45.0Yes33
onTabReplaced?NoYes33
Firefox
TransitionQualifier48.0
TransitionType48.0
getAllFrames48.0
getFrame48.0
onBeforeNavigate48.0
onCommitted48.0
onCompleted48.0
onCreatedNavigationTargetNo
onDOMContentLoaded48.0
onErrorOccurred48.0
onHistoryStateUpdated48.0
onReferenceFragmentUpdated48.0
onTabReplacedNo

Chrome incompatibilities

  • Firefox does not support:
    • onCreatedNavigationTarget
    • onTabReplaced
    • transition types and qualifiers
    • Filtering
  • In Firefox  onReferenceFragmentUpdated also triggers for pushState.

Acknowledgements

This API is based on Chromium's chrome.webNavigation API. This documentation is derived from web_navigation.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,