In some conditions the events might be generated even when the `gamepad` object is not accessible due to Security Context requirements. This commit adds a check to avoid firing the handler in those cases. (cherry picked from commit 91dbc288cc)
91dbc288cc
mousedown and touchstart should focus the canvas to ensure correct application lifecycle. (cherry picked from commit f13c7fc83e)
f13c7fc83e
This makes us more independent from emscripten libraries, giving us more control on the application lifecycle.