From d00364860c0796ae4935b5b57634c991d6131bfe Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 19 Jun 2022 11:52:23 -0400 Subject: [PATCH] Ignore auto-repeat events in ctrl keydown event handler Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2145 --- src/js/popup-fenix.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/popup-fenix.js b/src/js/popup-fenix.js index 9d8e00239..2d1eb3fc8 100644 --- a/src/js/popup-fenix.js +++ b/src/js/popup-fenix.js @@ -1259,6 +1259,9 @@ const toggleHostnameSwitch = async function(ev) { */ +// https://github.com/uBlockOrigin/uBlock-issues/issues/2145 +// Ignore events from auto-repeating keys + { let eventCount = 0; let eventTime = 0; @@ -1268,6 +1271,7 @@ const toggleHostnameSwitch = async function(ev) { eventCount = 0; return; } + if ( ev.repeat ) { return; } const now = Date.now(); if ( (now - eventTime) >= 500 ) { eventCount = 0;