1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

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
This commit is contained in:
Raymond Hill 2023-10-19 14:08:57 -04:00
parent e873fd5378
commit 906c6eb430
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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();