Permissions-Policy: xr-spatial-tracking
{{HTTPSidebar}}
{{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 typeSecurityError
. -
{{domxref("XRSystem/devicechange_event", "devicechange")}}
events are not fired on the{{DOMxRef("Navigator.xr","navigator.xr")}}
object.
Syntax
Permissions-Policy: xr-spatial-tracking=<allowlist>;
<allowlist>
- : A list of origins for which permission is granted to use the feature. See
Permissions-Policy
> Syntax for more details.
- : A list of origins for which permission is granted to use the feature. See
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