From 906c6eb430b4504a37a345d7b9c36430648e345e Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 19 Oct 2023 14:08:57 -0400 Subject: [PATCH] Turns out `delay` does apply to first element Regarding `trusted-click-element`, and as per documentation and code: - https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-trusted-scriptlets.md#trusted-scriptlets - https://github.com/AdguardTeam/Scriptlets/blob/master/src/scriptlets/trusted-click-element.js --- assets/resources/scriptlets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 1c2e63afd..d764f2b88 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -3981,7 +3981,7 @@ function trustedClickElement( const clickDelay = parseInt(delay, 10) || 1; const t0 = Date.now(); const tbye = t0 + 10000; - let tnext = selectorList.length !== 1 ? t0 : t0 + clickDelay; + let tnext = clickDelay; const terminate = ( ) => { selectorList.length = 0; @@ -4000,7 +4000,7 @@ function trustedClickElement( return terminate(); } if ( notFound ) { observe(); } - const delay = Math.max(notFound ? tbye - tnow : tnext - tnow, 1); + const delay = Math.max(notFound ? tbye - tnow : tnext - tnow, 17); next.timer = setTimeout(( ) => { next.timer = undefined; process();