I’ve made good progress on converting my WebVR app to WebXR, thanks to help from @RaananW. I’ve run into another problem, though, that I can’t reproduce in the playground. My efforts to debug my code have also fallen short, so I thought I’d describe it in case anyone has any insight.
When I click on the XR goggles icon, the standard modal pops up asking me to authorize WebXR. But it then quickly disappears, and the goggles have the word “error” over them, like this:
But there are no specific details re. what aspect of the configuration is not supported.
Strangely, when I manage to authorize XR before the modal closes, it works fine on my phone despite the error.
When I do the same thing on the Oculus Quest, the authorize-XR popup also disappears shortly after opening, as it does on my phone. But there is no error in the console, and the word “error” doesn’t appear over the goggles. The XR button no longer works, though.
Any ideas what bug lurking in my code could case a problem like this? A long shot, but I figured it couldn’t hurt to ask. Thanks.
Yeah, this is the most undocumented and unexplained error they could come up with. This means one of few issues - headset is not supported, user did not authorize, the mode/reference type you asked for is not supported and unknown errors. But it DOES mean your browser supports XR one way or the other.
I assue you are using immersive-vr . what reference space type are you using? local-floor?
Are you running code after this call? something that might attract the browser’s attention and close this dialog? This might be the issue at hand. The googles-button does not assume that you changed anything, so the “ERROR” text stays, even thou you might have changed something internally (or got the permissions really quick). If it enters VR mode, there is no error.
I would check what causes that. Feels like it is related.
Thanks so much for your ideas, @RaananW. They prompted me to look through my code to find something like what you described.
In case it helps others, I discovered I shouldn’t use window.history.pushState while waiting for the user to authorize XR. Ok to use it one in XR, I think, but it closes the authorize-XR dialog if it’s open and makes some browsers think the user has opted not to authorize.
There are flags in chrome://flags that might get it to work (the oculus vr support - should be on, sandbox mode, and openxr). Try a combination of those.
It is not a fix, it is the browser’s configuration. It is the openXR and sandbox flags, after enabling the oculus one. Try a few combinations, one should work
Android supports ar mode when arcore is installed (ar services by Google), and VR mode with daydream. I don’t use android for VR, but I know it should still work.