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.
The following diagram shows all of the timestamp properties defined in PerformanceNavigationTiming.
Instance properties
This interface extends the following PerformanceEntry properties by qualifying and constraining them as follows:
PerformanceEntry.entryTypeRead only-
Returns
"navigation". PerformanceEntry.nameRead only-
Returns the document's URL.
PerformanceEntry.startTimeRead only-
Returns a
DOMHighResTimeStampwith a value of "0". PerformanceEntry.durationRead only-
Returns a
timestampthat is the difference between thePerformanceNavigationTiming.loadEventEndandPerformanceEntry.startTimeproperties.
This interface also extends the following PerformanceResourceTiming properties by qualifying and constraining them as follows:
PerformanceResourceTiming.initiatorTypeRead only-
Returns
"navigation".
The interface also supports the following properties:
-
A
DOMHighResTimeStamprepresenting the time immediately before the user agent sets the document'sreadyStateto"complete". -
A
DOMHighResTimeStamprepresenting the time immediately after the current document'sDOMContentLoadedevent handler completes. -
A
DOMHighResTimeStamprepresenting the time immediately before the current document'sDOMContentLoadedevent handler starts. -
A
DOMHighResTimeStamprepresenting the time immediately before the user agent sets the document'sreadyStateto"interactive". -
A
DOMHighResTimeStamprepresenting the time immediately after the current document'sloadevent handler completes. -
A
DOMHighResTimeStamprepresenting the time immediately before the current document'sloadevent handler starts. -
A number representing the number of redirects since the last non-redirect navigation in the current browsing context.
-
A string representing the navigation type. Either
"navigate","reload","back_forward"or"prerender". -
A
DOMHighResTimeStamprepresenting the time immediately after the current document'sunloadevent handler completes. -
A
DOMHighResTimeStamprepresenting the time immediately before the current document'sunloadevent handler starts.
Instance methods
-
Returns a JSON representation of the
PerformanceNavigationTimingobject.
Specifications
| Specification |
|---|
| Navigation Timing Level 2 # sec-PerformanceNavigationTiming |
Browser compatibility
BCD tables only load in the browser