WebXRLimited availability
The navigator.xr API represents the browser's virtual reality or augmented reality system. You can use to request a WebXR session.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–78Not supported
79+Supportedsince Dec 10, 2019
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–78Not supported
79+Supportedsince Dec 17, 2019
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: xr.
Feature detection
JS · check before using
if ("ondevicechange" in XRSystem.prototype) {
// the devicechange event is supported
}Sub-features
Support for each part of the feature (107). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Navigator.xr | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| WebGL2RenderingContext.makeXRCompatible | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| WebGLRenderingContext.makeXRCompatible | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRBoundedReferenceSpace | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRBoundedReferenceSpace.boundsGeometry | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRFrame | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRFrame.getPose | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRFrame.getViewerPose | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRFrame.session | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource.gripSpace | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource.handedness | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource.profiles | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource.targetRayMode | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSource.targetRaySpace | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSourceArray | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSourceArray.@@iterator | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSourceArray.entries | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSourceArray.forEach | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |
| XRInputSourceArray.keys | 79 | 79 | ✕ | ✕ | 79 | ✕ | ✕ |