internal/gamepad: add a warning message when getGamepads is not available

Updates #2100
This commit is contained in:
Hajime Hoshi 2022-05-21 23:25:52 +09:00
parent 8d318fc4de
commit 8d3de6207b

View File

@ -49,6 +49,7 @@ func (g *nativeGamepads) update(gamepads *gamepads) error {
// getGamepads might not exist under a non-secure context (#2100). // getGamepads might not exist under a non-secure context (#2100).
if !nav.Get("getGamepads").Truthy() { if !nav.Get("getGamepads").Truthy() {
js.Global().Get("console").Call("warn", "navigator.getGamepads is not available. This might require a secure (HTTPS) context.")
return nil return nil
} }