WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
207539
Add unsupported regular expressions in Content Blocker url-filter
https://bugs.webkit.org/show_bug.cgi?id=207539
Summary
Add unsupported regular expressions in Content Blocker url-filter
Kyle Hickinson
Reported
2020-02-11 06:31:00 PST
The Content Blocker url-filter string is very limiting in terms of available regex syntax. As seen here:
https://developer.apple.com/documentation/safariservices/creating_a_content_blocker
, it specifies that `url-filter` can be used to match more than just a specific URL, using regular expressions. However the then listed supported characters is only a very limited subset of regular expressions. The API should allow use of all or most of the regex language as seen here:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference
At Brave we use a combination of blocklists and many rules include basic regex such as logical or's. This makes it very difficult to convert rules written for AdBlock Plus or uBlock Origin without changing the underlying rule or splitting them into multiple rules.
rdar://FB7557881
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-02-11 09:26:51 PST
<
rdar://problem/59350912
>
Maciej Stachowiak
Comment 2
2020-02-19 02:09:20 PST
Which regex operators do you need? Is it specifically `|` or are there others? I'm not sure we would want to support everything in .NET regexes or even everything in JavaScript regexes here, for the sake of speed of the matcher. Specific examples of rules that don't translate directly would be helpful.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug