Skip to content

Commit

Permalink
removeparam,queryprune,stealth, fix #39, fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed May 30, 2021
1 parent ca613bc commit cf874ca
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
20 changes: 19 additions & 1 deletion syntaxes/adblock.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
20 changes: 19 additions & 1 deletion test_rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
@@||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

0 comments on commit cf874ca

Please sign in to comment.