I have my own little homemade JSFiddle website that I built mostly for fun and so far it's worked pretty well, but I develop exclusively in Chrome. I want to mention this because I think my issue may (hopefully) be able to be fixed by changing my little sandbox, but here is my main issue:
In my sandbox I developed a small Snake implementation which relies on keydown events for controlling the player. Everything works fine in Chrome and I'm pretty happy with it, but in Firefox, I am unable to control the player. You can see my setup here:
http://willseph.com/sandbox/?id=ORWx7miv
The player is supposed to be either controlled with the arrow keys or WASD, but they don't seem to work in Firefox. I saw in another post that the tabindex="0"
attribute should be added to the element which should receive focus (although I'm not sure which element that would be, I tried putting it in the element holding the render iframe within the parent document, the iframe element itself, and the container div inside the iframe).
Can anyone shed some light on this? I'd love to figure out why this is happening.
Update:
I just uploaded the same code on JSFiddle and I'm having the same problem. Keyboard controls work for Chrome but not Firefox: