这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
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.
<div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/PerformanceEntry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/PerformanceNavigationTiming" target="_top"><rect x="201" y="1" width="270" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceNavigationTiming</text></a></svg></div>
a:hover text { fill: #0095DD; pointer-events: all;}
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
只读
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
只读
DOMHighResTimeStamp
representing the time value equal to the time immediately after the current document's
DOMContentLoaded
event completes.
PerformanceNavigationTiming.domContentLoadedEventStart
只读
DOMHighResTimeStamp
representing the time value equal to the time immediately before the user agent fires the
DOMContentLoaded
event at the current document.
PerformanceNavigationTiming.domInteractive
只读
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
只读
DOMHighResTimeStamp
representing the time when the load event of the current document is completed.
PerformanceNavigationTiming.loadEventStart
只读
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
只读
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
只读
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
只读
string
representing the navigation type. Must be: "
navigate
", "
reload
", "
back_forward
" or "
prerender
".
PerformanceNavigationTiming.unloadEventEnd
只读
DOMHighResTimeStamp
representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document.
PerformanceNavigationTiming.unloadEventStart
只读
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
对象。
| 规范 | 状态 | 注释 |
|---|---|---|
|
Navigation Timing Level 2
The definition of 'PerformanceNavigationTiming' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
PerformanceNavigationTiming
|
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 |
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 |
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
PerformanceNavigationTiming