Skip to content

Commit d3432e7

Browse files
authored
Remove support for old mozGetGamepads/webkitGetGamepads/etc. (#24687)
See https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getGamepads
1 parent 4679796 commit d3432e7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib/libsdl.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,12 +1349,10 @@ var LibrarySDL = {
13491349
},
13501350

13511351
getGamepads() {
1352-
var fcn = navigator.getGamepads || navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads || navigator.webkitGetGamepads;
1353-
if (fcn !== undefined) {
1354-
// The function must be applied on the navigator object.
1355-
return fcn.apply(navigator);
1352+
if (!navigator.getGamepads) {
1353+
return [];
13561354
}
1357-
return [];
1355+
return navigator.getGamepads();
13581356
},
13591357

13601358
// Helper function: Returns the gamepad if available, or null if not.

0 commit comments

Comments
 (0)