PerformanceNavigationTiming
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2021.
* Some parts of this feature may have varying levels of support.
ThePerformanceNavigationTiming 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 onePerformanceNavigationTiming object in the performance timeline. It inherits all of the properties and methods ofPerformanceResourceTiming andPerformanceEntry.
The following diagram shows all of the timestamp properties defined inPerformanceNavigationTiming.
In this article
Instance properties
This interface extends the followingPerformanceEntry properties by qualifying and constraining them as follows:
PerformanceEntry.entryTypeRead onlyReturns
"navigation".PerformanceEntry.nameRead onlyReturns thedocument's URL.Note thattext fragments, and any other fragment directives, are stripped from the URL.
PerformanceEntry.startTimeRead onlyReturns a
DOMHighResTimeStampwith a value of0.PerformanceEntry.durationRead onlyReturns a
timestampthat is the difference between thePerformanceNavigationTiming.loadEventEndandPerformanceEntry.startTimeproperties.
This interface also extends the followingPerformanceResourceTiming properties by qualifying and constraining them as follows:
PerformanceResourceTiming.initiatorTypeRead onlyReturns
"navigation".
The interface also supports the following properties:
PerformanceNavigationTiming.activationStartRead onlyExperimentalA
DOMHighResTimeStamprepresenting the time between when a document starts prerendering and when it is activated.PerformanceNavigationTiming.criticalCHRestartRead onlyExperimentalA
DOMHighResTimeStamprepresenting the time at which the connection restart occurred due toCritical-CHHTTP response header mismatch.PerformanceNavigationTiming.domCompleteRead onlyA
DOMHighResTimeStamprepresenting the time immediately before the user agent sets the document'sreadyStateto"complete".PerformanceNavigationTiming.domContentLoadedEventEndRead onlyA
DOMHighResTimeStamprepresenting the time immediately after the current document'sDOMContentLoadedevent handler completes.PerformanceNavigationTiming.domContentLoadedEventStartRead onlyA
DOMHighResTimeStamprepresenting the time immediately before the current document'sDOMContentLoadedevent handler starts.PerformanceNavigationTiming.domInteractiveRead onlyA
DOMHighResTimeStamprepresenting the time immediately before the user agent sets the document'sreadyStateto"interactive".PerformanceNavigationTiming.loadEventEndRead onlyA
DOMHighResTimeStamprepresenting the time immediately after the current document'sloadevent handler completes.PerformanceNavigationTiming.loadEventStartRead onlyA
DOMHighResTimeStamprepresenting the time immediately before the current document'sloadevent handler starts.PerformanceNavigationTiming.notRestoredReasonsRead onlyExperimentalA
NotRestoredReasonsobject providing report data on reasons why the current document was blocked from using the back/forward cache (bfcache) on navigation.PerformanceNavigationTiming.redirectCountRead onlyA number representing the number of redirects since the last non-redirect navigation in the current browsing context.
PerformanceNavigationTiming.typeRead onlyA string representing the navigation type. Either
"navigate","reload", or"back_forward".PerformanceNavigationTiming.unloadEventEndRead onlyA
DOMHighResTimeStamprepresenting the time immediately after the current document'sunloadevent handler completes.PerformanceNavigationTiming.unloadEventStartRead onlyA
DOMHighResTimeStamprepresenting the time immediately before the current document'sunloadevent handler starts.
Instance methods
PerformanceNavigationTiming.toJSON()Returns a JSON representation of the
PerformanceNavigationTimingobject.
Specifications
| Specification |
|---|
| Navigation Timing Level 2> # sec-PerformanceNavigationTiming> |