#35011·electron

[Bug]: WebXR API not working

Author: acceleratxrCreated Jul 21, 2022Updated Sep 24, 2026
Labelsbug :beetle:

Preflight Checklist

Electron Version

19.0.8

What operating system are you using?

Windows

Operating System Version

Windows 11 Pro 22000.795

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Using the WebXR API successfully detects 'immersive-vr' as being supported.

The following is our react-based application running in Chrome version 103.

image

Actual Behavior

Using the WebXR API does not detect 'immersive-vr' as being supported.

image

Testcase Gist URL

No response

Additional Information

I was able to reproduce this behavior using Electron v19.0.8, v20.0.0-beta10, and a custom v21 nightly build with checkout_openxr explicitly set to True. I have also tried explicitly disabling the sandbox mode for the browser window as shown in the example below...

mainWindow = new BrowserWindow({
            backgroundColor: "#000",
            frame: false,
            width: Store.has("win.width") ? Store.get("win.width") : MIN_WIN_WIDTH,
            height: Store.has("win.height") ? Store.get("win.height") : MIN_WIN_HEIGHT,
            x: Store.has("win.x") ? Store.get("win.x") : undefined,
            y: Store.has("win.y") ? Store.get("win.y") : undefined,
            minWidth: MIN_WIN_WIDTH,
            minHeight: MIN_WIN_HEIGHT,
            webPreferences: {
                contextIsolation: false,
                nodeIntegration: false,
                preload: __dirname + "/preload.js",
                sandbox: false
            },
        });

Test code for detecting the VR support is as follows...

const [vrSupported, setVRSupported] = useState(true);

    useEffect(() => {
        if ("xr" in navigator) {
            //@ts-ignore
            navigator.xr.isSessionSupported('immersive-vr')
                .then((isSupported: boolean) => {
                    setVRSupported(isSupported);
                });
        }
    }, []);