I'm designing an app that utilizes input from a gamepad using the HTML5 Gamepad API. I have the app working in both Firefox and Chrome, however Firefox does not seem to allow a second Window or Tab to access the gamepad after a previous tab has accessed it. I don't need both to access the api at the same time, I only need one to be able to access the api after the other. Chrome does not have this problem. I also tested using html5gamepad.com with the same results. Does anyone have a way to release the gamepad from one window when it loses focus so it is available to another window? My customer will be using Firefox. Thanks.
来源:https://stackoverflow.com/questions/54154170/is-there-a-way-to-use-the-html5-gamepad-api-with-multiple-windows-or-tabs-in-fir