Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in Chrome 22 or above [patch provided] #8

Open
kg opened this issue Sep 6, 2012 · 3 comments
Open

Does not work in Chrome 22 or above [patch provided] #8

kg opened this issue Sep 6, 2012 · 3 comments

Comments

@kg
Copy link

kg commented Sep 6, 2012

Apparently Chrome 22 and above (Beta, Canary) have made some sort of changes to the GamePad API. Gamepad.js works in Chrome 21 but beta and canary show 'your browser is incompatible'.

@kg
Copy link
Author

kg commented Sep 6, 2012

Here's a fix:
https://gist.github.com/3650351

@inequation
Copy link

Sorry to spoil your fun, but you've applied the patch to the wrong file - gamepad_uncompressed.js is just an intermediate file from the build system and would be overwritten upon next rebuild. I've merged it properly into my fork (907aa96), you should do it against gamepad_no_images.js.

@konsumer
Copy link

konsumer commented Jun 6, 2013

In the interest of minimal impact to the library and simple elegance, one could also do this:

var getField = function() {
  return navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads ||
  navigator.webkitGetGamepads() || navigator.mozGetGamepads() || navigator.getGamepads();
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants