v147 · WebXR · Immersive Web
Compatibility Lab
Probes WebXR session availability, the layers feature flag, and the layer type globals (XRQuadLayer, XRCylinderLayer, XREquirectLayer, XRCubeLayer, XRProjectionLayer). Detects whether the device supports immersive-vr/ar sessions with layers. Provides the requestSession feature-detection fallback.
API probes
Layer type availability
| Layer type | Global defined | Use case |
|---|
Live session capability test
isSessionSupported + layers feature probe
Click "Run session probe" to check WebXR session types…
Fallback pattern
/* Detect WebXR Layers support */
const HAS_WEBXR = 'xr' in navigator;
const HAS_LAYERS = typeof XRQuadLayer !== 'undefined';
async function checkLayersSupport() {
if (!HAS_WEBXR) return 'webxr-unavailable';
try {
// Check if layers feature is supported for immersive-vr
const supported = await navigator.xr.isSessionSupported('immersive-vr');
if (!supported) return 'no-vr-device';
// Try requesting a session with layers feature
// (Won't actually start without user gesture and device connected)
return HAS_LAYERS ? 'layers-api-present' : 'no-layers-globals';
} catch (e) {
return 'error: ' + e.message;
}
}
/* Request session with layers feature */
async function startLayersSession() {
if (!HAS_LAYERS) {
// Fallback: use standard projection-only XR session
return navigator.xr.requestSession('immersive-vr', {
requiredFeatures: ['local'],
});
}
// Request session with layers feature enabled
return navigator.xr.requestSession('immersive-vr', {
requiredFeatures: ['layers'],
optionalFeatures: ['local-floor'],
});
}
see also
- Layer Type Explorer — compositor layer families
- Back to feature index
- ChromeStatus entry
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗