webvr navigator.getVRDevices throws an error




DOM: Device Interfaces
3 years ago
2 years ago


(Reporter: brian, Unassigned)


Mac OS X

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [webvr])



3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150108202552

Steps to reproduce:

- Running Nightly 38.0a1 (2015-01-21) on OSX 10.9.5
- Oculus SDK 0.4.4 and WebVR Oculus Rift Enabler
- Opened non-e10s window
- launch any webvr demo (e.g. anything on mozvr.com)

Actual results:

Any call to `navigator.getVRDevices()` throws an error. The console shows "NS_ERROR_FAILURE:" with no additional information.

Strangely, if I make the same call in the console, it does return a Promise, but the callback never fires.

The error is thrown regardless of whether I have my Oculus Rift plugged in and powered on.

Expected results:

`navigator.getVRDevices()` should return a Promise that fires a callback with an array of devices.


3 years ago
Blocks: 1036600
Component: Untriaged → DOM: Device Interfaces
Product: Firefox → Core
Version: Firefox 38 → Trunk
Check in about:config whether dom.vr.enabled is set to true.  The addon should be automatically doing this.  This is maybe dumb, but have you restarted the browser since installing the addon?  It *shouldn't* be necessary, but I think there is one code path that might require it in some instances (basically if early init fails, we might mark init as failed for future attempts).

Comment 2

3 years ago
dom.vr.enabled was already set to true.

I'm pretty sure I had restarted, but I did it again to make sure, and this time it worked. This was on my office machine (iMac).

On my laptop (MBP), I'm quite certain I had already restarted. I loaded up the previous version of Nightly and installed the add-on. Then, I waited for the update to download and restarted with yesterday's version, because I knew it wouldn't run with the previous version I had. After I restarted it didn't work.
Whiteboard: [webvr]
The code that implements the promise has been replaced with recent e10s support for WebVR.  It is likely that the conditions causing this error no longer apply.

Please confirm if you are still having this issue in the current Nightly build.
Can we mark this as "Resolved"?
Flags: needinfo?(brian)
I just tried this, and I'm unable to reproduce the issue in comment 0 using Firefox release (43.0.4; Mac OS X 10.10.5) nor the latest Nightly (46.0a1 (2016-01-11); Mac OS X 10.10.5).

Comment 5

2 years ago
I haven't seen this problem in a while, so it's probably fine to resolve it. Thanks everyone.
Flags: needinfo?(brian)
This was likely fixed as an effect of the code being replaced during refactoring.
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.