Accept-CH

安全上下文: 此项功能仅在一些支持的浏览器安全上下文(HTTPS)中可用。

Accept-CH 标头由服务器设置,以指定客户端应在后续请求中应包含哪些客户端客户端提示提示标头。

标头类型 响应标头
禁止修改的标头
列入 CORS 白名单的请求标头

备注: 客户端提示只能在安全源(通过 TLS)上访问。所有安全的请求都应该持久化 Accept-CH 标头,以确保客户端提示可靠地发送。

语法

http
Accept-CH: <comma separated list of client hint headers>

示例

http
Accept-CH: Viewport-Width, Width
Vary: Viewport-Width, Width

备注: 请牢记要根据所接受的客户端提示更改响应

规范

Specification
HTTP Client Hints
# section-3.1

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Accept-CH client hint accept (response) header
Content-DPR token
DeprecatedNon-standard
DPR token
DeprecatedNon-standard
Device-Memory token
Experimental
Sec-CH-UA token
Experimental
Sec-CH-UA-Arch token
Experimental
Sec-CH-UA-Full-Version token
Experimental
Sec-CH-UA-Mobile token
Experimental
Sec-CH-UA-Model token
Experimental
Sec-CH-UA-Platform token
Experimental
Sec-CH-UA-Platform-Version token
Experimental
Viewport-Width token
DeprecatedNon-standard
Width token
DeprecatedNon-standard

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.
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.

参见