Search code examples
androidgoogle-chromevirtual-keyboard

Why is window.navigator.virtualKeyboard undefined in local network?


When I try to access window.navigator.virtualKeyboard on my dev server in the local network, e.g. via 192.168.1.69 (dev server runs on desktop, accessing via mobile) it is always undefined. When deploying the app to the web it is available.

Testing with Chrome 105 on Android.


Solution

  • I think it is because your testing environment isn't considered a secure context.

    See https://w3c.github.io/editing/docs/virtualkeyboard/#hide-and-show-methods