Closed Bug 1161220 Opened 7 years ago Closed 6 years ago
Gamepad API does not work on the web console e10s
I know work was done to make the Gamepad API work in bug 852944. My apologies if this is already on people's radars; in that case, please feel free to dupe/close. As of today's Nightly (40.0a1 [2015-05-04]), when trying to use `navigator.getGamepads()` * in an e-10s window, I get an array of length 0 * in a non-e10s window, I get an array of length 1 And the events aren't firing. Test case attached. Also hosted on JS Bin here: http://jsbin.com/tutibi/4/edit?js,console
What platform are you on? This landed in bug 852944 a couple of weeks ago, worked then at least. That said, bug 1156597 still needs to get done so we have constant regression tests happening in mochitest. :|
Assignee: nobody → kyle
Depends on: 852944
Er, meant bug 1156957
(In reply to Kyle Machulis [:kmachulis] [:qdot] (USE NEEDINFO?) from comment #2) > What platform are you on? Mac OS X Yosemite 10.10.1 (14B25)
Your jsbin works fine for me on windows/mac/linux running nightly 2015-05-04, as does http://html5gamepad.com. This is done using both an XBox 360 and generic gamepad. That said, were you trying to run navigator.getGamepads() in a console on a panel with no content loaded (i.e. about:blank or the content tiles page)? If I try that, I have the problem you describe, and in the way you describe (only on e10s), which means we may have a e10s permissions issues.
(In reply to Kyle Machulis [:kmachulis] [:qdot] (USE NEEDINFO?) from comment #5) > Your jsbin works fine for me on windows/mac/linux running nightly > 2015-05-04, as does http://html5gamepad.com. This is done using both an XBox > 360 and generic gamepad. Sorry, I didn't see the see `needinfo`. Yeah, that works for me. > That said, were you trying to run navigator.getGamepads() in a console on a > panel with no content loaded (i.e. about:blank or the content tiles page)? > If I try that, I have the problem you describe, and in the way you describe > (only on e10s), which means we may have a e10s permissions issues. Yes, I can reproduce that. I've connected to a Graphene app via remote debugging, and I'm having the same issue - `navigator.getGamepads()` returns an empty array. But if I open a new content window in the browser, the gamepad shows up just fine. Ideas? Do you think that's a coincidence or related issue?
Worth noting that I resolved the Graphene issue - it was just an intermittent issue. But still having troubles getting this working in e10s obviously.
Ah, good, I was reading up a bit on graphene and had no idea why there'd be a problem there, so that's one less thing to debug. As for working on e10s plus console or whatever, I have a feeling there may be some IPC pipe or something that's not set up right for gamepad when in the console without an actual window/document/whatever we're missing. Will try to look at this in the next week, sooner if it's urgent.
Fixing the bug title here since gamepad /does/ work in e10s overall, just not in the web console with it.
Summary: Gamepad API does not work on e10s → Gamepad API does not work on the web console e10s
If I open a new tab to about:blank in an e10s window, then call navigator.getGamepads() in the console, then press a button on my gamepad and call navigator.getGamepads() again, I get the gamepad as expected. I had previously loaded your testcase in a different tab in the same window, so it's possible this is some sort of initialization issue when the console in about:blank is the first place to use the API? If that's the case it's probably not terribly serious, I imagine most developers will be using the console on an actual content page.
As of Nightly 32 from 2016-12-13, things seem to work in console on e10s now. I can bring up a console on an about:blank window, and getting gamepads seems to work similarly to comment 10, but without having to load a test case otherwise.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.