Babylon WebXR is Broken on Oculus Quest 2 "Meta Quest Browser" and "Firefox Reality Browser"

Hello Babylon Devs!

The default WebXR demo (created by the babylon team): WebXR Demos and Examples | Babylon.js Documentation, does not work on Oculus Quest “Meta Quest Browser” or “Firefox Reality Browser”.

I have tried various forms of writing javascript, with different frameworks, different import methods, etc… and nothing resolves the issue. I have nailed it down to several function calls though, anytime a “Enable WebXR” function is called, the browser will crash and not render anything. If you remove the XR function call and reload, the page will display the scene:

//THIS BREAKS: MetaQuest browser and FireFox Reality Browser
scene.createDefaultXRExperienceAsync().then(() => {
babylonEngine.runRenderLoop(() => {
scene.render()
})
})

The above breaks these browsers.

The below will fix it:
babylonEngine.runRenderLoop(() => {
scene.render()
})

I have posted my code here: GitHub - tnraddatz/BabylonJsBugReport: BabylonJsBugReport

Another important note here is that the code works fine on desktop Chrome and desktop Firefox. I’ve tested it, and it works, with the “WebXR Device Emulator” for both desktop browsers. This issue seems to be just affecting Oculus quest browsers.

1 Like

Resolved my own question:

XR requires HTTPS.

You cannot do local development with HTTP to serve WebXR. HTTPS is required for WebXR to work in Oculus Quest browsers.

To emulate HTTPs traffic you can use NGROK, https://dashboard.ngrok.com

2 Likes

Thanks for your hardwork @tnraddatz and sharing. I’m going to bookmark this for my #VR #VirtualReality #Quest2 needs.