Improve trusted-suppress-native-method scriptlet

As per AdGuard's documentation `/.../` is a valid matcher, to
match a string argument against a regex pattern.
This commit is contained in:
Raymond Hill 2024-12-26 08:10:13 -05:00
parent 3ae28423b9
commit cb6c11ab6f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -3313,6 +3313,9 @@ function trustedSuppressNativeMethod(
if ( /^".*"$/.test(v) ) {
return { type: 'pattern', re: safe.patternToRegex(v.slice(1, -1)) };
}
if ( /^\/.+\/$/.test(v) ) {
return { type: 'pattern', re: safe.patternToRegex(v) };
}
if ( v === 'false' ) {
return { type: 'exact', value: false };
}