Back to Content

Permissions-Policy: accelerometer directive

files/en-us/web/http/reference/headers/permissions-policy/accelerometer/index.md

latest1.0 KB
Original Source

{{SeeCompatTable}}

The HTTP {{HTTPHeader('Permissions-Policy')}} header accelerometer directive controls whether the current document is allowed to gather information about the acceleration of the device through the {{domxref('Accelerometer')}} interface.

Specifically, where a defined policy blocks use of this feature, {{domxref("Accelerometer.Accelerometer", "Accelerometer()")}} constructor calls will throw a {{domxref("DOMException")}} of type SecurityError.

Syntax

http
Permissions-Policy: accelerometer=<allowlist>;
  • <allowlist>

Default policy

The default allowlist for accelerometer is: self.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also