From 5d468a3fe1f55daa194145b835b068660fd3e0c7 Mon Sep 17 00:00:00 2001 From: debuggerx01 Date: Tue, 15 Apr 2025 22:23:08 +0800 Subject: [PATCH] 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. --- app/ui.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/ui.js b/app/ui.js index 786c84bf..d54ab0f8 100644 --- a/app/ui.js +++ b/app/ui.js @@ -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(); },