MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-survey

PerformanceNavigationTiming

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The PerformanceNavigationTiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. For example, this interface can be used to determine how much time it takes to load or unload a document.

Properties

This interface extends the following PerformanceEntry properties for navigation performance entry types by qualifying and constraining them as follows:

PerformanceEntry.entryType Read only
Returns "navigation".
PerformanceEntry.name Read only
Returns the document's address.
PerformanceEntry.startTime Read only
Returns a DOMHighResTimeStamp with a value of "0".
PerformanceEntry.duration Read only
Returns a timestamp that is the difference between the PerformanceNavigationTiming.loadEventEnd and PerformanceEntry.startTime properties.

The interface also supports the following properties:

PerformanceNavigationTiming.domComplete Read only
A DOMHighResTimeStamp representing a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete.
PerformanceNavigationTiming.domContentLoadedEventEnd Read only
A DOMHighResTimeStamp representing the time value equal to the time immediately after the current document's DOMContentLoaded event completes.
PerformanceNavigationTiming.domContentLoadedEventStart Read only
A DOMHighResTimeStamp representing the time value equal to the time immediately before the user agent fires the DOMContentLoaded event at the current document.
PerformanceNavigationTiming.domInteractive Read only
A DOMHighResTimeStamp representing a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
PerformanceNavigationTiming.loadEventEnd Read only
A DOMHighResTimeStamp representing the time when the load event of the current document is completed.
PerformanceNavigationTiming.loadEventStart Read only
A DOMHighResTimeStamp representing the time value equal to the time immediately before the load event of the current document is fired.
PerformanceNavigationTiming.redirectCount Read only
A number representing the number of redirects since the last non-redirect navigation under the current browsing context.
PerformanceNavigationTiming.type Read only
A string representing the navigation type. Must be: "navigate", "reload", "back_forward" or "prerender".
PerformanceNavigationTiming.unloadEventEnd Read only
A DOMHighResTimeStamp representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document.
PerformanceNavigationTiming.unloadEventStart Read only
A DOMHighResTimeStamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.

Methods

PerformanceNavigationTiming.toJSON()
Returns a DOMString that is the JSON representation of the PerformanceNavigationTiming object.

Specifications

Specification Status Comment
Navigation Timing Level 2
The definition of 'PerformanceNavigationTiming' in that specification.
Working Draft Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support. 57 (Yes) 58 (58) No support 44 No support
Feature Android Webview Chrome for Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support. 57 57 (Yes) 58.0 (58) No support 44 No support

[1] Gecko has been given a pref that can be used to disable PerformanceNavigationTiming if required — dom.enable_performance_navigation_timing, defaulting to true (bug 1403926).

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, jpmedley, abbycar, rolfedh, AFBarstow
 Last updated by: chrisdavidmills,