PerformanceNavigationTiming

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

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.

特性

This interface extends the following PerformanceEntry properties for navigation performance entry types by qualifying and constraining them as follows:

PerformanceEntry.entryType 只读
返回 "navigation" .
PerformanceEntry.name 只读
返回 文档的地址 .
PerformanceEntry.startTime 只读
返回 DOMHighResTimeStamp with a value of " 0 ".
PerformanceEntry.duration 只读
返回 timestamp that is the difference between the PerformanceNavigationTiming.loadEventEnd and PerformanceEntry.startTime 特性。

This interface also extends following PerformanceResourceTiming properties for navigation performance entry types by qualifying and constraining them as follows:

PerformanceResourceTiming.initiatorType 只读
返回 "navigation" .

The interface also supports the following properties:

PerformanceNavigationTiming.domComplete 只读
A DOMHighResTimeStamp representing a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete .
PerformanceNavigationTiming.domContentLoadedEventEnd 只读
A DOMHighResTimeStamp representing the time value equal to the time immediately after the current document's DOMContentLoaded event completes.
PerformanceNavigationTiming.domContentLoadedEventStart 只读
A DOMHighResTimeStamp representing the time value equal to the time immediately before the user agent fires the DOMContentLoaded event at the current document.
PerformanceNavigationTiming.domInteractive 只读
A DOMHighResTimeStamp representing a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive .
PerformanceNavigationTiming.loadEventEnd 只读
A DOMHighResTimeStamp representing the time when the load event of the current document is completed.
PerformanceNavigationTiming.loadEventStart 只读
A DOMHighResTimeStamp representing the time value equal to the time immediately before the load event of the current document is fired.
PerformanceNavigationTiming.redirectCount 只读
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.
PerformanceNavigationTiming.requestStart 只读
A DOMHighResTimeStamp representing the time immediately before the user agent starts requesting the resource from the server, or from relevant application caches or from local resources.
PerformanceNavigationTiming.responseStart 只读
A DOMHighResTimeStamp representing 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.
PerformanceNavigationTiming.type 只读
A string representing the navigation type. Must be: " navigate ", " reload ", " back_forward " or " prerender ".
PerformanceNavigationTiming.unloadEventEnd 只读
A DOMHighResTimeStamp representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document.
PerformanceNavigationTiming.unloadEventStart 只读
A DOMHighResTimeStamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.

方法

PerformanceNavigationTiming.toJSON()
返回 DOMString that is the JSON representation of the PerformanceNavigationTiming 对象。

规范

规范 状态 Comment
Navigation Timing Level 2
The definition of 'PerformanceNavigationTiming' in that specification.
工作草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
PerformanceNavigationTiming
Chrome 57 Edge ≤18 Firefox 58
58
You can disable this feature using the dom.enable_performance_navigation_timing preference (see bug 1403926 ).
IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58
58
You can disable this feature using the dom.enable_performance_navigation_timing preference (see bug 1403926 ).
Opera Android 43 Safari iOS No Samsung Internet Android 7.0
domComplete
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
domContentLoadedEventEnd
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
domContentLoadedEventStart
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
domInteractive
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
loadEventEnd
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
loadEventStart
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
redirectCount
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
toJSON
Chrome 57 Edge ≤18 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
type
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
unloadEventEnd
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
unloadEventStart
Chrome 57 Edge 12 Firefox 58 IE No Opera 44 Safari No WebView Android 57 Chrome Android 57 Firefox Android 58 Opera Android 43 Safari iOS No Samsung Internet Android 7.0

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
见实现注意事项。

另请参阅