mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Fine tune trusted-click-element
scriptlet
This commit is contained in:
parent
906c6072d6
commit
c0d80ac510
@ -3898,7 +3898,6 @@ builtinScriptlets.push({
|
|||||||
world: 'ISOLATED',
|
world: 'ISOLATED',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
'run-at-html-element.fn',
|
'run-at-html-element.fn',
|
||||||
'safe-self.fn',
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
function trustedClickElement(
|
function trustedClickElement(
|
||||||
@ -3922,7 +3921,7 @@ function trustedClickElement(
|
|||||||
const clickDelay = parseInt(delay, 10) || 1;
|
const clickDelay = parseInt(delay, 10) || 1;
|
||||||
const t0 = Date.now();
|
const t0 = Date.now();
|
||||||
const tbye = t0 + 10000;
|
const tbye = t0 + 10000;
|
||||||
let tnext = t0;
|
let tnext = selectorList.length !== 1 ? t0 : t0 + clickDelay;
|
||||||
|
|
||||||
const terminate = ( ) => {
|
const terminate = ( ) => {
|
||||||
selectorList.length = 0;
|
selectorList.length = 0;
|
||||||
@ -3983,7 +3982,7 @@ function trustedClickElement(
|
|||||||
selectorList.unshift(selector);
|
selectorList.unshift(selector);
|
||||||
return next(true);
|
return next(true);
|
||||||
}
|
}
|
||||||
elem.click();
|
elem.click();
|
||||||
tnext += clickDelay;
|
tnext += clickDelay;
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user