Bug 207539
| Summary: | Add unsupported regular expressions in Content Blocker url-filter | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kyle Hickinson <khickinson> |
| Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Enhancement | CC: | achristensen, beidson, ggaren, krzysztof.modras, mjs, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
Kyle Hickinson
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
<rdar://problem/59350912>
Maciej Stachowiak
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.