Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEasylist to Adblock Script #402
Closed
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rules come to us in the format:
And need to be massaged into a format that the iOS content blocking extension API wants:
e.g.
This adblockplus script does a decent job but is still shy of what is needed. More specifically, the writeup that @kylehickinson created (copied verbatim):
Library issues:
Doesn't deal with exception/ignore rules (prefixed:
@@||)Doesn't deal with items that are surrounded with quotes ("{rule}")
When no type is provided I would assume
resource-typecould be omitted instead of including most of the types. Maybe there's a reason for this?Rules with wildcard suffixes don't generate regex for it?
/0/ads/*->^[^:]+:(//)?.*/[0i]/ads/^[^:]+:(//)?.*/[0i]/ads/.+or at least^[^:]+:(//)?.*/[0i]/ads/.*. On top of that, what's with the[0i]? Isn't/0/ads/.+enough?Not sure how it handles CSS because our subset of rules doesn't include any (further testing required)
It seems to be applying case-sensitivity based on the use of a separator character?
||quantcount.com^$third-partycreates this:{ "trigger": { "url-filter": "^[^:]+:(//)?([^/]+\\.)?quantcount\\.com([^-_.%a-z0-9].*)?$", "url-filter-is-case-sensitive": true, "resource-type": [ "image", "style-sheet", "script", "font", "media", "raw", "document" ], "load-type": [ "third-party" ], "unless-top-url": [ "^[^:]+:(//)?([^/]+\\.)?quantcount\\.com([^-_.%a-z0-9].*)?$" ], "top-url-filter-is-case-sensitive": true }, "action": { "type": "block" } }Expected:
{ "trigger": { "url-filter": "^[^:]+:(//)?([^/]+\\.)?quantcount\\.com$", "load-type": [ "third-party" ], "unless-top-url": [ "[^:]+:(//)?([^/]+\\.)?quantcount\\.com" ] }, "action": { "type": "block" } }Other resources:
adblock rule format explainer
adblock static ruleset
Apple format docs