From cf874ca5312d47cfe226c2f2fa30509ab8043812 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Sun, 30 May 2021 18:56:15 +0300 Subject: [PATCH] removeparam,queryprune,stealth, fix #39, fix #41 --- syntaxes/adblock.tmLanguage.json | 20 +++++++++++++++++++- test_rules.txt | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/syntaxes/adblock.tmLanguage.json b/syntaxes/adblock.tmLanguage.json index 6e49a5a..2315484 100644 --- a/syntaxes/adblock.tmLanguage.json +++ b/syntaxes/adblock.tmLanguage.json @@ -543,7 +543,25 @@ } }, { - "match": "(inline-script|inline-font|mp4|empty|badfilter|genericblock|generichide|network|popup|popunder|important|cookie|csp|replace)", + "match": "(removeparam|queryprune)(=)(~)?([^,]+)", + "name": "keyword.other.adblock", + "captures": { + "1": { + "name": "keyword.other.adblock" + }, + "2": { + "name": "keyword.operator.adblock" + }, + "3": { + "name": "keyword.other.adblock" + }, + "4": { + "name": "string.unquoted.adblock" + } + } + }, + { + "match": "(inline-script|inline-font|mp4|empty|badfilter|genericblock|generichide|network|popup|popunder|important|cookie|csp|replace|stealth|removeparam|queryprune)", "name": "keyword.other.adblock" }, { diff --git a/test_rules.txt b/test_rules.txt index c2aea68..cab3cdc 100644 --- a/test_rules.txt +++ b/test_rules.txt @@ -234,4 +234,22 @@ $cookie=test,domain=example.org ||facebook.com^$third-party,cookie=c_user @@||example.org^$cookie=/regular_expression/ ||example.org^$cookie=NAME;maxAge=3600;sameSite=lax -@@||example.org^$cookie \ No newline at end of file +@@||example.org^$cookie + +! +! $removeparam and $queryprune rules +! +||example.org^$removeparam +||example.org^$removeparam=test +||example.org^$removeparam=~test +||example.org^$removeparam=/^(test|test2)=/i +||example.org^$queryprune +||example.org^$queryprune=test +||example.org^$queryprune=~test +||example.org^$queryprune=/^(test|test2)=/i + +! +! $stealth rules +! +@@||example.org^$stealth +@@||example.org^$stealth,domain=example.org \ No newline at end of file