mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-20 01:12:38 +01:00
Reset g
regexes before use in rmnt
/rpnt
scriptlets
This commit is contained in:
parent
bf001f4796
commit
cdc3f66a6b
@ -574,8 +574,11 @@ function replaceNodeTextFn(
|
||||
let sedCount = extraArgs.sedCount || 0;
|
||||
const handleNode = node => {
|
||||
const before = node.textContent;
|
||||
if ( safe.RegExp_test.call(rePattern, before) === false ) { return true; }
|
||||
reCondition.lastIndex = 0;
|
||||
if ( safe.RegExp_test.call(reCondition, before) === false ) { return true; }
|
||||
rePattern.lastIndex = 0;
|
||||
if ( safe.RegExp_test.call(rePattern, before) === false ) { return true; }
|
||||
rePattern.lastIndex = 0;
|
||||
const after = pattern !== ''
|
||||
? before.replace(rePattern, replacement)
|
||||
: replacement;
|
||||
|
Loading…
Reference in New Issue
Block a user