this code will print 'gamepaddisconnected' when such a event is detected.
it tries to call navigator.getGamepads() right after page load and after that it calls navigator.getGamepads() every 10 seconds.
pay attention to the timing when gamepadconnected callback are invoked