PerformanceNavigationTiming: criticalCHRestart property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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:

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

Specifications

Specification
Navigation Timing Level 2
# dom-performancenavigationtiming-criticalchrestart

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
criticalCHRestart
Experimental
Chrome – Full support
Chrome 116 (Release date: 2023-08-15)
footnote Full support
Edge – Full support
Edge 116 (Release date: 2023-08-21)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 102 (Release date: 2023-08-23)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 116 (Release date: 2023-08-15)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 78 (Release date: 2023-10-23)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 24 (Release date: 2024-01-25)
footnote Full support
WebView Android – Full support
WebView Android 116 (Release date: 2023-08-15)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also