| title | PerformanceNavigationTiming |
|---|---|
| slug | Web/API/PerformanceNavigationTiming |
| page-type | web-api-interface |
| browser-compat | api.PerformanceNavigationTiming |
{{APIRef("Performance API")}}
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 {{domxref("PerformanceResourceTiming")}} and {{domxref("PerformanceEntry")}}.
{{InheritanceDiagram}}
The following diagram shows all of the timestamp properties defined in PerformanceNavigationTiming.
This interface extends the following {{domxref('PerformanceEntry')}} properties by qualifying and constraining them as follows:
- {{domxref("PerformanceEntry.entryType")}} {{ReadOnlyInline}}
- : Returns
"navigation".
- : Returns
- {{domxref("PerformanceEntry.name")}} {{ReadOnlyInline}}
- : Returns the document's URL. Note that text fragments, and any other fragment directives, are stripped from the URL.
- {{domxref("PerformanceEntry.startTime")}} {{ReadOnlyInline}}
- : Returns a {{domxref("DOMHighResTimeStamp")}} with a value of
0.
- : Returns a {{domxref("DOMHighResTimeStamp")}} with a value of
- {{domxref("PerformanceEntry.duration")}} {{ReadOnlyInline}}
- : Returns a {{domxref("DOMHighResTimeStamp","timestamp")}} that is the difference between the {{domxref("PerformanceNavigationTiming.loadEventEnd")}} and {{domxref("PerformanceEntry.startTime")}} properties.
This interface also extends the following {{domxref('PerformanceResourceTiming')}} properties by qualifying and constraining them as follows:
- {{domxref('PerformanceResourceTiming.initiatorType')}} {{ReadOnlyInline}}
- : Returns
"navigation".
- : Returns
The interface also supports the following properties:
- {{domxref('PerformanceNavigationTiming.activationStart')}} {{ReadOnlyInline}} {{experimental_inline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time between when a document starts prerendering and when it is activated.
- {{domxref('PerformanceNavigationTiming.criticalCHRestart')}} {{ReadOnlyInline}} {{experimental_inline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time at which the connection restart occurred due to {{HTTPHeader("Critical-CH")}} HTTP response header mismatch.
- {{domxref('PerformanceNavigationTiming.domComplete')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the user agent sets the document's
readyStateto"complete".
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the user agent sets the document's
- {{domxref('PerformanceNavigationTiming.domContentLoadedEventEnd')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
DOMContentLoadedevent handler completes.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
- {{domxref('PerformanceNavigationTiming.domContentLoadedEventStart')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
DOMContentLoadedevent handler starts.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
- {{domxref('PerformanceNavigationTiming.domInteractive')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the user agent sets the document's
readyStateto"interactive".
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the user agent sets the document's
- {{domxref('PerformanceNavigationTiming.loadEventEnd')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
loadevent handler completes.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
- {{domxref('PerformanceNavigationTiming.loadEventStart')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
loadevent handler starts.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
- {{domxref('PerformanceNavigationTiming.notRestoredReasons')}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A {{domxref("NotRestoredReasons")}} object providing report data on reasons why the current document was blocked from using the back/forward cache ({{Glossary("bfcache")}}) on navigation.
- {{domxref('PerformanceNavigationTiming.redirectCount')}} {{ReadOnlyInline}}
- : A number representing the number of redirects since the last non-redirect navigation in the current browsing context.
- {{domxref('PerformanceNavigationTiming.type')}} {{ReadOnlyInline}}
- : A string representing the navigation type. Either
"navigate","reload", or"back_forward".
- : A string representing the navigation type. Either
- {{domxref('PerformanceNavigationTiming.unloadEventEnd')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
unloadevent handler completes.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately after the current document's
- {{domxref('PerformanceNavigationTiming.unloadEventStart')}} {{ReadOnlyInline}}
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
unloadevent handler starts.
- : A {{domxref("DOMHighResTimeStamp")}} representing the time immediately before the current document's
- {{domxref("PerformanceNavigationTiming.toJSON()")}}
- : Returns a JSON representation of the
PerformanceNavigationTimingobject.
- : Returns a JSON representation of the
{{Specifications}}
{{Compat}}
- {{domxref("Performance.navigation")}}
- {{domxref("PerformanceNavigation")}}