Add navigator.keyboard null check

Browser can have a null keyboard property, so we need to check for nullability.
This commit is contained in:
sergystepanov 2026-03-10 10:09:28 +03:00
parent d765de14dc
commit 42c088a0d9

View file

@ -53,7 +53,8 @@ let keyMap = {};
// special mode for changing button bindings in the options
let isKeysFilteredMode = true;
// if the browser supports Keyboard Lock API (Firefox does not)
let hasKeyboardLock = ('keyboard' in navigator) && ('lock' in navigator.keyboard)
let hasKeyboardLock = ('keyboard' in navigator)
&& navigator.keyboard && ('lock' in navigator.keyboard)
let locked = false