AdguardTeam / FiltersCompiler

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

Add new `@include` directive option for adding modifiers to every filter list rule #190

Closed jellizaveta closed 10 months ago

jellizaveta commented 11 months ago

Some information

Mail has a kind of tracking - tracking pixel - that should be blocked. In filter lists this kind of tracking is blocked by such rule form:

link.pet-supermarket.co.uk$image

This type of rules was chosen because in mail clients images are loaded via proxy and the full address of such images looks like this:

ci4.googleusercontent.com/proxy/r62*-*-*#https://link.pet-supermarket.co.uk/img/*.gif

List of cname records of this tracker: https://github.com/AdguardTeam/cname-trackers/blob/master/data/clickthroughs/sailthru.txt

Problem

Creating a separate list with such rules in cname repository looks irrelevant to the topic of this repository. I would like updates from cname repository to be include into filter lists, and domains to be formatted in the right way for the blocker.

Suggestion

Add a new option for the @include directive — similar to /stripComments and /notOptimized — for adding modifiers to every rule in a filter list, i.e. adding $imagemodifier (for main tracking cname list) or some other ones for other purposes. So it could be:

@include filter-list1.txt /addModifiers="image"
@include filter-list2.txt /addModifiers="image,script"
@include filter-list3.txt /addModifiers="script,redirect=noopjs"

Related issue

https://github.com/AdguardTeam/cname-trackers/issues/85