W3cubDocs

/Web APIs

PerformanceNavigationTiming

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.

Only the current document is included in the performance timeline, so there is only one PerformanceNavigationTiming object in the performance timeline. It inherits all of the properties and methods of PerformanceResourceTiming and PerformanceEntry.

PerformanceEntry PerformanceResourceTiming PerformanceNavigationTiming

The following diagram shows all of the timestamp properties defined in PerformanceNavigationTiming.

Timestamp diagram listing timestamps in the order in which they are recorded for the fetching of a document

Instance properties

This interface extends the following PerformanceEntry properties by qualifying and constraining them as follows:

PerformanceEntry.entryType Read only

Returns "navigation".

PerformanceEntry.name Read only

Returns the document's URL.

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.

This interface also extends the following PerformanceResourceTiming properties by qualifying and constraining them as follows:

PerformanceResourceTiming.initiatorType Read only

Returns "navigation".

The interface also supports the following properties:

PerformanceNavigationTiming.activationStart Read only Experimental

A DOMHighResTimeStamp representing the time between when a document starts prerendering and when it is activated.

PerformanceNavigationTiming.domComplete Read only

A DOMHighResTimeStamp representing the time immediately before the user agent sets the document's readyState to "complete".

PerformanceNavigationTiming.domContentLoadedEventEnd Read only

A DOMHighResTimeStamp representing the time immediately after the current document's DOMContentLoaded event handler completes.

PerformanceNavigationTiming.domContentLoadedEventStart Read only

A DOMHighResTimeStamp representing the time immediately before the current document's DOMContentLoaded event handler starts.

PerformanceNavigationTiming.domInteractive Read only

A DOMHighResTimeStamp representing the time immediately before the user agent sets the document's readyState to "interactive".

PerformanceNavigationTiming.loadEventEnd Read only

A DOMHighResTimeStamp representing the time immediately after the current document's load event handler completes.

PerformanceNavigationTiming.loadEventStart Read only

A DOMHighResTimeStamp representing the time immediately before the current document's load event handler starts.

PerformanceNavigationTiming.redirectCount Read only

A number representing the number of redirects since the last non-redirect navigation in the current browsing context.

PerformanceNavigationTiming.type Read only

A string representing the navigation type. Either "navigate", "reload", "back_forward" or "prerender".

PerformanceNavigationTiming.unloadEventEnd Read only

A DOMHighResTimeStamp representing the time immediately after the current document's unload event handler completes.

PerformanceNavigationTiming.unloadEventStart Read only

A DOMHighResTimeStamp representing the time immediately before the current document's unload event handler starts.

Instance methods

PerformanceNavigationTiming.toJSON()

Returns a JSON representation of the PerformanceNavigationTiming object.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
PerformanceNavigationTiming 57 12 58 11 44 15 57 57 58 43 15.1 7.0
activationStart 108 108 No No 94 No 57 57 No 43 No 7.0
criticalCHRestart 116 116 No No 102 No 116 116 No No No No
domComplete 57 12 58 11 44 15 57 57 58 43 15.1 7.0
domContentLoadedEventEnd 57 12 58 11 44 15 57 57 58 43 15.1 7.0
domContentLoadedEventStart 57 12 58 11 44 15 57 57 58 43 15.1 7.0
domInteractive 57 12 58 11 44 15 57 57 58 43 15.1 7.0
loadEventEnd 57 12 58 11 44 15 57 57 58 43 15.1 7.0
loadEventStart 57 12 58 11 44 15 57 57 58 43 15.1 7.0
redirectCount 57 12 58 11 44 15 57 57 58 43 15.1 7.0
toJSON 57 16 58 No 44 15 57 57 58 43 15.1 7.0
type 57 12 58 11 44 15 57 57 58 43 15.1 7.0
unloadEventEnd 57 12 58 11 44 15 57 57 58 43 15.1 7.0
unloadEventStart 57 12 58 11 44 15 57 57 58 43 15.1 7.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming