Sec-CH-UA-Model header

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.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Tiêu đề HTTP Sec-CH-UA-Model request header là một gợi ý máy khách tác nhân người dùng cho biết mẫu thiết bị mà trình duyệt đang chạy trên đó.

Loại tiêu đề Request header, Client hint
Forbidden request header Có (tiền tố Sec-)

Cú pháp

http
Sec-CH-UA-Model: <device-version>

Chỉ thị

<device-version>

Chuỗi chứa phiên bản thiết bị. Ví dụ: "Pixel 3".

Ví dụ

Sử dụng Sec-CH-UA-Model

Máy chủ yêu cầu tiêu đề Sec-CH-UA-Model bằng cách bao gồm Accept-CH trong phản hồi cho bất kỳ yêu cầu nào từ máy khách, sử dụng tên của tiêu đề mong muốn làm token:

http
HTTP/1.1 200 OK
Accept-CH: Sec-CH-UA-Model

Máy khách có thể chọn cung cấp gợi ý, và thêm tiêu đề Sec-CH-UA-Model vào các yêu cầu tiếp theo. Ví dụ: trên điện thoại di động, máy khách có thể thêm tiêu đề như sau:

http
GET /my/page HTTP/1.1
Host: example.site

Sec-CH-UA: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
Sec-CH-UA-Mobile: ?1
Sec-CH-UA-Platform: "Android"
Sec-CH-UA-Bitness: "64"
Sec-CH-UA-Model: "Pixel 3 XL"

Đặc tả

Specification
User-Agent Client Hints
# sec-ch-ua-model

Tương thích trình duyệt

Xem thêm