Draft
This page is not complete.
The WebXR Device API dictionary XRSessionInit specifies required and/or optional features when requesting a new XRSession by calling the navigator.xr.requestSession() method.
Properties
The following parameters are all optional. If none are included, the device will use a default feature configuration for all options.
optionalFeaturesOptional- An array of values identifying features which the returned
XRSessionmay optionally support. At this time, all features are identified using strings from theXRReferenceSpaceTypeenumeration, but future updates to the WebXR standard may add more features. requiredFeaturesOptional- An array of values which the returned
XRSessionmust support. These values currently must come from the enumerated typeXRReferenceSpaceType. More features may be added in future updates to the WebXR standard.
Default features
Immersive sessions
All immersive (both immersive-vr and immersive-ar) sessions support both the viewer and local reference spaces.
Because immersive sessions are required to support the local reference space, any request to open an immersive XRSession is required to obtain explicit or implicit user consent.
Inline sessions
All inline WebXR sessions support the viewer reference space.
Security requirements
Each reference space or feature type has minimum safety requirements. By session type, those are:
| Reference space type | User consent rquirement | Feature policy requirement |
|---|---|---|
bounded-floor |
Always required | xr-spatial-tracking |
local |
Always required for inline sessions | xr-spatial-tracking |
local-floor |
Always required | xr-spatial-tracking |
unbounded |
Always required | xr-spatial-tracking |
viewer |
Always required | — |
