PerformanceNavigationTiming
Experimental: 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.entryTypeRead only-
Returns
"navigation". PerformanceEntry.nameRead only-
Returns the document's address.
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 following PerformanceResourceTiming properties for navigation performance entry types by qualifying and constraining them as follows:
PerformanceResourceTiming.initiatorTypeRead only-
Returns
"navigation".
The interface also supports the following properties:
-
A
DOMHighResTimeStamprepresenting a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete. -
A
DOMHighResTimeStamprepresenting the time value equal to the time immediately after the current document's DOMContentLoaded event completes. -
A
DOMHighResTimeStamprepresenting the time value equal to the time immediately before the user agent fires the DOMContentLoaded event at the current document. -
A
DOMHighResTimeStamprepresenting atimestamprepresenting the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive. -
A
DOMHighResTimeStamprepresenting the time when the load event of the current document is completed. -
A
DOMHighResTimeStamprepresenting the time value equal to the time immediately before the load event of the current document is fired. -
A number representing the number of redirects since the last non-redirect navigation under the current browsing context.
If there was no redirect, or if the redirect was from another origin, and that origin does not permit it's timing information to be exposed to the current origin then the value will be 0.
-
A
DOMHighResTimeStamprepresenting the time immediately before the user agent starts requesting the resource from the server, or from relevant application caches or from local resources. -
A
DOMHighResTimeStamprepresenting the time immediately after the user agent's HTTP parser receives the first byte of the response from relevant application caches, or from local resources or from the server. -
A
stringrepresenting the navigation type. Must be: "navigate", "reload", "back_forward" or "prerender". -
A
DOMHighResTimeStamprepresenting the time value equal to the time immediately after the user agent finishes the unload event of the previous document. -
A
DOMHighResTimeStamprepresenting the time value equal to the time immediately before the user agent starts the unload event of the previous document.
Methods
-
Returns a
DOMStringthat is the JSON representation of thePerformanceNavigationTimingobject.
Specifications
| Specification |
|---|
| Navigation Timing Level 2 # sec-PerformanceNavigationTiming |
Browser compatibility
BCD tables only load in the browser