Permissions-Policy: chỉ thị screen-wake-lock

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ị screen-wake-lock của header HTTP Permissions-Policy kiểm soát việc tài liệu hiện tại có được phép sử dụng Screen Wake Lock API để chỉ ra rằng thiết bị không nên làm mờ hoặc tắt màn hình hay không.

Cụ thể, khi một chính sách đã được xác định chặn việc sử dụng tính năng này, các lần gọi WakeLock.request() sẽ trả về một Promise bị từ chối với một DOMException kiểu NotAllowedError.

Cú pháp

http
Permissions-Policy: screen-wake-lock=<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 screen-wake-lockself.

Thông số kỹ thuật

Specification
Screen Wake Lock API
# policy-control

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

Xem thêm