AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Figured I should give a headsup about an unusual aspect of `$all` in uBlock Origin #158

Open DandelionSprout opened 2 years ago

DandelionSprout commented 2 years ago

This is a bit of a fringe scenario, although it's been tested out with success in Dandelion Sprout's Annoyances List, but it could become useful for you guys at some point in the future:

When an entry uses $all, uBlock Origin counts that entry as 5 entry points in their dashboard settings, one for each of [no $ value] + $popup + $document + $inline-script + $inline-font.

However, it turns out that this can be reduced to 3 points by changing $all to $all,~inline-script,~inline-font, especially since https://github.com/AdguardTeam/FiltersRegistry/blob/master/filters/exclusions.txt implies that AdGuard Filters was never designed with $inline-script and $inline-font in mind anyway.

For example, AdGuard Base Filter's uBO list version is currently shown in uBO as having 65,694 entries ±500. Had all its 235 $all entries been converted to $all,~inline-script,~inline-font, then the number would've gone down to circa 65,224 ±500. Though this would not be a big enough difference to make that list seem any more compact, and that it'd actually take up more filespace, it'd become a big deal if any of your lists' amount of $all entries entered the 4-digits.

krystian3w commented 1 year ago

One week later: https://github.com/AdguardTeam/FiltersRegistry/commit/c96128eb41778f3a60c13e1a75bcc0f9001b1494

It remains to be seen if the new definition of $all is extended to CSP.


AdGuard's filter counting mechanism shows much smaller (x5) numbers anyway:

Filter ID: 232
Filter name: KAD - Anti-Scam
Compiled rules: 41303
Excluded rules: 184

uBo: used 205 942 from 205 942