Reputation: 11
When I tried to get into full screen mode with keybinds disabled with JavaScript, I had to use navigator.keyboard.lock()
.
So that's what I did (w/o Live Server) and everything worked just fine. But when I got to use Live Server, keyboard lock API didn't work.
Why does Visual Studio Code Live Server disable it? Maybe I'm doing something wrong? And no, it's not my browser fault, I've got a new version of Chrome.
If the code is wrong, here's what it looks like:
HTML: <button onclick="document.documentElement.requestFullscreen()" id="fullscreenBtn">Fullscreen</button>
JS: document.getElementById("fullscreenBut").hidden = "true"; navigator.keyboard.lock() }
It works normally, but not in Live Server. So, is it possible for it to work there?
Upvotes: 0
Views: 24