From 42a6d8a52b89014f81dd16ac03ffa5825a395885 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 31 Jul 2020 13:13:30 -0500 Subject: [PATCH] Move some event handling to click instead of mousedown Fixes #21 --- inject3.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inject3.js b/inject3.js index f511b89..a208e1c 100644 --- a/inject3.js +++ b/inject3.js @@ -1465,6 +1465,7 @@ function initGUI() { bindOnce(document, 'mousemove', eventMouseMove, true); bindOnce(document, 'mousedown', eventMouseDown, true); // true to capture all mouse downs 'before' the dom events handle them + bindOnce(document, 'click', eventClick, true); bindOnce(document.getElementById('s3devDeep'), 'click', deepSearch); // bindOnce(document.getElementById('s3devCleanUp'),'click', clickCleanUp); bindOnce(document.getElementById('s3devInject'), 'click', clickInject); @@ -1791,7 +1792,11 @@ function initGUI() { }, 1); } } - } else { + } + } + + function eventClick(e) { + if (e.button === 0) { let chk = e.target; if (chk && (chk.tagName !== 'BUTTON' && chk.getAttribute && !chk.getAttribute('role'))) { chk = chk.parentNode;