Back to Content

Permissions-Policy: xr-spatial-tracking directive

files/en-us/web/http/reference/headers/permissions-policy/xr-spatial-tracking/index.md

latest1.6 KB
Original Source

{{SeeCompatTable}}

The HTTP {{HTTPHeader("Permissions-Policy")}} header xr-spatial-tracking directive controls whether the current document is allowed to use the WebXR Device API.

Specifically, where a defined policy blocks usage of this feature:

  • {{DOMxRef("XRSystem/isSessionSupported","navigator.xr.isSessionSupported()")}} and {{DOMxRef("XRSystem/requestSession","navigator.xr.requestSession()")}} calls will return a {{jsxref("Promise")}} that rejects with a {{domxref("DOMException")}} of type SecurityError.

  • {{domxref("XRSystem/devicechange_event", "devicechange")}} events are not fired on the {{DOMxRef("Navigator.xr","navigator.xr")}} object.

Syntax

http
Permissions-Policy: xr-spatial-tracking=<allowlist>;
  • <allowlist>

Default policy

The default allowlist for xr-spatial-tracking is self.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • WebXR Device API
  • {{DOMxRef("XRSystem/requestSession","navigator.xr.requestSession()")}}, and {{DOMxRef("XRSystem/isSessionSupported","navigator.xr.isSessionSupported()")}} and {{domxref("XRSystem/devicechange_event", "devicechange")}} event on {{DOMxRef("Navigator.xr","navigator.xr")}}
  • {{HTTPHeader("Permissions-Policy")}} header
  • Permissions Policy