aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/performancenavigationtiming
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/performancenavigationtiming
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/performancenavigationtiming')
-rw-r--r--files/zh-cn/web/api/performancenavigationtiming/index.html108
1 files changed, 108 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/performancenavigationtiming/index.html b/files/zh-cn/web/api/performancenavigationtiming/index.html
new file mode 100644
index 0000000000..566d0bb4d7
--- /dev/null
+++ b/files/zh-cn/web/api/performancenavigationtiming/index.html
@@ -0,0 +1,108 @@
+---
+title: PerformanceNavigationTiming
+slug: Web/API/PerformanceNavigationTiming
+translation_of: Web/API/PerformanceNavigationTiming
+---
+<div>{{APIRef("Navigation Timing")}}{{SeeCompatTable}}</div>
+
+<p><span class="seoSummary"><strong><code>PerformanceNavigationTiming </code></strong>提供了用于存储和检索有关浏览器文档事件的指标的方法和属性。 例如,此接口可用于确定加载或卸载文档需要多少时间。</span></p>
+
+<ul>
+</ul>
+
+<p>{{InheritanceDiagram}}</p>
+
+<h2 id="属性">属性</h2>
+
+<p>该接口扩展了 {{domxref('PerformanceEntry')}} 属性,修订和约束以下性能条目:</p>
+
+<dl>
+ <dt>{{domxref("PerformanceEntry.entryType")}} {{readonlyInline}}</dt>
+ <dd>返回 <code>"navigation"</code>.</dd>
+ <dt>{{domxref("PerformanceEntry.name")}} {{readonlyInline}}</dt>
+ <dd>返回 <a href="https://dom.spec.whatwg.org/#concept-document-url">文档地址</a>.</dd>
+ <dt>{{domxref("PerformanceEntry.startTime")}} {{readonlyInline}}</dt>
+ <dd>返回值为0的 {{domxref("DOMHighResTimeStamp")}}。</dd>
+ <dt>{{domxref("PerformanceEntry.duration")}} {{readonlyInline}}</dt>
+ <dd>返回 {{domxref("DOMHighResTimeStamp","timestamp")}} 值,即 {{domxref("PerformanceNavigationTiming.loadEventEnd")}} 和 {{domxref("PerformanceEntry.startTime")}} 属性之间的差值。</dd>
+</dl>
+
+<p>该接口还扩展 {{domxref('PerformanceResourceTiming')}} 属性,修订和约束以下性能条目:</p>
+
+<dl>
+ <dt>{{domxref('PerformanceResourceTiming.initiatorType')}}{{readonlyInline}}</dt>
+ <dd>返回 <code>"navigation"</code>.</dd>
+</dl>
+
+<p>该接口还支持以下属性:</p>
+
+<dl>
+ <dt>{{domxref('PerformanceNavigationTiming.domComplete')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于浏览器将当前文档的当前文档准备<em><a href="https://html.spec.whatwg.org/multipage/syntax.html#the-end">就绪</a></em>之前的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.domContentLoadedEventEnd')}} {{readonlyInline}}</dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于当前文档的 <a href="https://html.spec.whatwg.org/multipage/syntax.html#the-end">DOMContentLoaded</a> 事件完成后的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.domContentLoadedEventStart')}} {{readonlyInline}}</dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于用户代理在当前文档上触发 <a href="https://html.spec.whatwg.org/multipage/syntax.html#the-end">DOMContentLoaded</a> 事件之前的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.domInteractive')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于用户代理将当前文档的当前文档准备就绪设置为<a href="https://html.spec.whatwg.org/multipage/syntax.html#the-end">交互</a>之前的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.loadEventEnd')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,代表当前文档的加载事件完成的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.loadEventStart')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于立即触发当前文档的加载事件之前的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.redirectCount')}} {{readonlyInline}} </dt>
+ <dd>表示自当前浏览上下文中上次非重定向导航以来的重定向次数的数字。</dd>
+ <dd>如果没有重定向,或者重定向是从另一个 origin 发的,并且该 origin 不允许将其计时信息公开给当前来源,则该值为0。</dd>
+</dl>
+
+<dl>
+ <dt>{{domxref('PerformanceNavigationTiming.requestStart')}} {{readonlyInline}} </dt>
+ <dd>返回一个 {{domxref("DOMHighResTimeStamp")}} 时间值,代表 UA 立即开始从服务器,相关应用程序缓存或本地资源请求资源之前的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.responseStart')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,代表用户代理的HTTP解析器从相关应用程序缓存,本地资源或服务器接收到响应的第一个字节后立即的时间。</dd>
+</dl>
+
+<dl>
+ <dt>{{domxref('PerformanceNavigationTiming.type')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMString","string")}} 表示导航类型,取值为为:“<code>navigate</code>”,“<code>reload</code>”,“<code>back_forward</code>”或“<code>prerender</code>”。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.unloadEventEnd')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于用户代理程序完成前一文档的卸载事件之后的时间。</dd>
+ <dt>{{domxref('PerformanceNavigationTiming.unloadEventStart')}} {{readonlyInline}} </dt>
+ <dd>一个 {{domxref("DOMHighResTimeStamp")}} 时间值,等于用户代理程序开始前一个文档的卸载事件之前的时间。</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<dl>
+ <dt>{{domxref("PerformanceNavigationTiming.toJSON()")}}</dt>
+ <dd>返回一个表示{{domxref("PerformanceNavigationTiming")}}对象的{{domxref("DOMString")}} JSON。</dd>
+</dl>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">注释</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Navigation Timing Level 2', '#sec-PerformanceNavigationTiming', 'PerformanceNavigationTiming')}}</td>
+ <td>{{Spec2('Navigation Timing Level 2')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.PerformanceNavigationTiming")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{domxref("Performance.navigation")}}</li>
+ <li>{{domxref("PerformanceNavigation")}}</li>
+</ul>