Permissions-Policy: chỉ thị compute-pressure
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.
Chỉ thị compute-pressure của header HTTP Permissions-Policy kiểm soát quyền truy cập vào Compute Pressure API.
Cú pháp
Permissions-Policy: compute-pressure=<allowlist>;
<allowlist>-
Danh sách các nguồn gốc được cấp quyền sử dụng tính năng. Xem
Permissions-Policy> Cú pháp để biết thêm chi tiết.
Chính sách mặc định
Danh sách cho phép mặc định cho compute-pressure là self, cho phép sử dụng trong các frame lồng nhau cùng nguồn gốc nhưng ngăn nội dung bên thứ ba sử dụng tính năng này. Các worker (dedicated và shared) tuân thủ chính sách quyền được đặt bởi tài liệu sở hữu chúng.
Ví dụ
>Bật compute pressure cho nội dung bên thứ ba
Việc sử dụng bên thứ ba có thể được bật có chọn lọc bằng cách sử dụng thuộc tính allow trên các phần tử <iframe>:
<iframe src="https://example.com" allow="compute-pressure"></iframe>
Tắt hoàn toàn Compute Pressure API
Header phản hồi HTTP này tắt hoàn toàn compute pressure:
Permissions-Policy: compute-pressure=()
Thông số kỹ thuật
| Specification |
|---|
| Compute Pressure Level 1> # policy-control> |