Skip to content

Commit cb6c11a

Browse files
committed
Improve trusted-suppress-native-method scriptlet
As per AdGuard's documentation `/.../` is a valid matcher, to match a string argument against a regex pattern.
1 parent 3ae2842 commit cb6c11a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/js/resources/scriptlets.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,6 +3313,9 @@ function trustedSuppressNativeMethod(
33133313
if ( /^".*"$/.test(v) ) {
33143314
return { type: 'pattern', re: safe.patternToRegex(v.slice(1, -1)) };
33153315
}
3316+
if ( /^\/.+\/$/.test(v) ) {
3317+
return { type: 'pattern', re: safe.patternToRegex(v) };
3318+
}
33163319
if ( v === 'false' ) {
33173320
return { type: 'exact', value: false };
33183321
}

0 commit comments

Comments
 (0)