-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
40 lines (26 loc) · 1.33 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
title: "Permissions-Policy: ambient-light-sensor"
slug: Web/HTTP/Headers/Permissions-Policy/ambient-light-sensor
page-type: http-permissions-policy-directive
status:
- experimental
browser-compat: http.headers.Permissions-Policy.ambient-light-sensor
---
{{HTTPSidebar}} {{SeeCompatTable}}
The HTTP {{HTTPHeader('Permissions-Policy')}} header `ambient-light-sensor` directive controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the {{domxref('AmbientLightSensor')}} interface.
Specifically, where a defined policy blocks use of this feature, {{domxref("AmbientLightSensor.AmbientLightSensor", "AmbientLightSensor()")}} constructor calls will throw a {{domxref("DOMException")}} of type `SecurityError`.
## Syntax
```http
Permissions-Policy: ambient-light-sensor=<allowlist>;
```
- `<allowlist>`
- : A list of origins for which permission is granted to use the feature. See [`Permissions-Policy` > Syntax](/en-US/docs/Web/HTTP/Headers/Permissions-Policy#syntax) for more details.
## Default policy
The default allowlist for `ambient-light-sensor` is `self`.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{HTTPHeader('Permissions-Policy')}} header
- [Permissions Policy](/en-US/docs/Web/HTTP/Permissions_Policy)