mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-20 19:28:32 +08:00
chore: disable shortcuts #1239
This commit is contained in:
1 parent
1d4388d444
commit
e66f5fe253
1 file changed
+8
-9
+8
-9
@@ -31,15 +31,14 @@ if (!container) {
|
||||
|
||||
document.addEventListener("keydown", (event) => {
|
||||
// Disable WebView keyboard shortcuts
|
||||
if (["F5", "F7"].includes(event.key)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (
|
||||
(event.ctrlKey || event.metaKey) &&
|
||||
["F", "H", "P", "Q", "R", "U"].includes(event.key.toUpperCase())
|
||||
) {
|
||||
event.preventDefault();
|
||||
}
|
||||
const disabledShortcuts =
|
||||
["F5", "F7"].includes(event.key) ||
|
||||
(event.altKey && ["ArrowLeft", "ArrowRight"].includes(event.key)) ||
|
||||
((event.ctrlKey || event.metaKey) &&
|
||||
["F", "G", "H", "J", "P", "Q", "R", "U"].includes(
|
||||
event.key.toUpperCase()
|
||||
));
|
||||
disabledShortcuts && event.preventDefault();
|
||||
});
|
||||
|
||||
const contexts = [
|
||||
|
||||
Reference in new issue
Block a user