大网数据广告活动
Web 标准与前端开发

PerformanceNavigationTiming: criticalCHRestart property

· 52CE 我爱测

A website can indicate that a particular Client Hint is critical to the page by including it in a Critical-CH HTTP response header (as well as the Accept-CH HTTP request header which is needed for all client hints whether critical or not). Doing so will trigger a connection resta

Performance API

A website can indicate that a particular Client Hint is critical to the page by including it in a Critical-CH HTTP response header (as well as the Accept-CH HTTP request header which is needed for all client hints whether critical or not). Doing so will trigger a connection restart if the hint listed in the Critical-CH HTTP response header could have been, but wasn't, included in the HTTP request initially sent. If the browser does not support that client hint, it is ignored and no connection restart occurs.

The criticalCHRestart read-only property represents the time at which the connection restart occurred.

Value

A DOMHighResTimeStamp representing the number of milliseconds elapsed since PerformanceEntry.startTime when the connection restart occurred in milliseconds.

If the value is 0 the connection was not restarted.

Examples

Detecting connection restart pages

The following JavaScript can be used to see if the connection was restarted:

const restartTime =
  performance?.getEntriesByType?.("navigation")[0]?.criticalCHRestart;
if (restartTime > 0) {
  console.log("Time at which connection restart happened:", restartTime);
}

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。