From fb47716711fea11bdc73e11dac82cc8c3db4c5a0 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Thu, 12 Mar 2026 16:50:20 +0100 Subject: [PATCH] fix: use hasAttribute for data-no-rage and data-no-dead opt-out checks --- public/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 2794e9a..be787dd 100644 --- a/public/script.js +++ b/public/script.js @@ -483,7 +483,7 @@ // * Auto-track rage clicks (rapid repeated clicks on the same element) // * Fires rage_click when same element is clicked 3+ times within 800ms // * Opt-out: add data-no-rage to the script tag - if (!script.getAttribute('data-no-rage')) { + if (!script.hasAttribute('data-no-rage')) { var rageClickHistory = {}; // * selector -> { times: [timestamps], lastFired: 0 } var RAGE_CLICK_THRESHOLD = 3; var RAGE_CLICK_WINDOW = 800; @@ -551,7 +551,7 @@ // * Fires dead_click when an interactive element is clicked but no DOM change, navigation, // * or network request occurs within 1 second // * Opt-out: add data-no-dead to the script tag - if (!script.getAttribute('data-no-dead')) { + if (!script.hasAttribute('data-no-dead')) { var INTERACTIVE_SELECTOR = 'a,button,input,select,textarea,[role="button"],[role="link"],[role="tab"],[role="menuitem"],[onclick],[tabindex]'; var DEAD_CLICK_DEBOUNCE = 10000; var DEAD_CLEANUP_INTERVAL = 30000;