Permissions-Policy: chỉ thị accelerometer
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ị accelerometer của header HTTP Permissions-Policy kiểm soát việc tài liệu hiện tại có được phép thu thập thông tin về gia tốc của thiết bị thông qua giao diện Accelerometer 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 constructor Accelerometer() sẽ ném một DOMException kiểu SecurityError.
Cú pháp
http
Permissions-Policy: accelerometer=<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 accelerometer là: self.
Thông số kỹ thuật
| Specification |
|---|
| Generic Sensor API> # permissions-policy> |