From 9e83d9e68c675df038374a9d7a01f5f62642a8e8 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 25 Dec 2024 16:17:51 +0100 Subject: [PATCH] fix: Disable browser ctrl + S in web build --- dist/web/source/wasm-config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/web/source/wasm-config.js b/dist/web/source/wasm-config.js index 3b63e4ad0..5dda37ad0 100644 --- a/dist/web/source/wasm-config.js +++ b/dist/web/source/wasm-config.js @@ -263,6 +263,9 @@ function js_resizeCanvas() { canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0); } -// Prevent default browser shortcuts from preventing ImHex ones to work -document.addEventListener('keydown', e => { e.preventDefault(); }) -document.addEventListener('keyup', e => { e.preventDefault(); }) \ No newline at end of file +// Prevent some default browser shortcuts from preventing ImHex ones to work +document.addEventListener('keydown', e => { + if (e.ctrlKey) { + if (e.which == 83) e.preventDefault(); + } +}) \ No newline at end of file