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

Fine tune trusted-click-element scriptlet

This commit is contained in:
Raymond Hill 2023-10-15 16:14:44 -04:00
parent 906c6072d6
commit c0d80ac510
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -3898,7 +3898,6 @@ builtinScriptlets.push({
world: 'ISOLATED',
dependencies: [
'run-at-html-element.fn',
'safe-self.fn',
],
});
function trustedClickElement(
@ -3922,7 +3921,7 @@ function trustedClickElement(
const clickDelay = parseInt(delay, 10) || 1;
const t0 = Date.now();
const tbye = t0 + 10000;
let tnext = t0;
let tnext = selectorList.length !== 1 ? t0 : t0 + clickDelay;
const terminate = ( ) => {
selectorList.length = 0;
@ -3983,7 +3982,7 @@ function trustedClickElement(
selectorList.unshift(selector);
return next(true);
}
elem.click();
elem.click();
tnext += clickDelay;
next();
};