Back to Content

Permissions-Policy: gyroscope directive

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

latest1006 B
Original Source

{{SeeCompatTable}}

The HTTP {{HTTPHeader("Permissions-Policy")}} header gyroscope directive controls whether the current document is allowed to gather information about the orientation of the device through the {{domxref("Gyroscope")}} interface.

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

Syntax

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

Default policy

The default allowlist for gyroscope is self.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also