feat: Prevent exiting full screen when pressing the ESC key (#122)

For chromium based browsers (or future browsers that add support for the keyboard api) this will keep the escape key from exiting full screen and instead require a long key press.
This commit is contained in:
debuggerx01 2025-04-15 22:23:08 +08:00 committed by GitHub
parent 2ce431a3b1
commit 5d468a3fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -1887,6 +1887,9 @@ const UI = {
} else if (document.body.msRequestFullscreen) {
document.body.msRequestFullscreen();
}
if(navigator.keyboard && navigator.keyboard.lock){
navigator.keyboard.lock(['Escape']);
}
}
UI.updateFullscreenButton();
},