diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 43c8d87eab1..6ea7ee3eb43 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -2741,8 +2741,7 @@ With these rules, specified UTM parameters will be removed from any request save [AdGuard for Chrome MV3][ext-mv3] has some limitations: - Regular expressions, negation and allowlist rules are not supported. -- Generic rules are applied before specific rules, and redirection occurs only once. This may prevent subsequent or more specific redirects from applying. -- Group of similar `$removeparam` rules will be combined into one. Example: +- Each `$removeparam` rule with a named parameter gets its own declarative rule with a param-aware `urlFilter` (e.g. `^utm_source=`). Chrome DNR applies a redirect only once per navigation, so without this, only the highest-priority rule would fire and the rest would be skipped. The param-aware `urlFilter` makes each rule fire only when its target parameter is present, forming a redirect chain — one parameter stripped per hop — until all are removed. Chrome allows up to 20 hops per navigation, which is enough for real-world tracking URLs. These hops are invisible to users. Example: ```bash ||testcases.adguard.com$xmlhttprequest,removeparam=p1case1 @@ -2763,8 +2762,48 @@ With these rules, specified UTM parameters will be removed from any request save "transform": { "queryTransform": { "removeParams": [ - "p1case1", - "p2case1", + "p1case1" + ] + } + } + } + }, + "condition": { + "urlFilter": "||testcases.adguard.com*^p1case1=", + "resourceTypes": [ + "xmlhttprequest" + ] + } + }, + { + "id": 2, + "action": { + "type": "redirect", + "redirect": { + "transform": { + "queryTransform": { + "removeParams": [ + "p2case1" + ] + } + } + } + }, + "condition": { + "urlFilter": "||testcases.adguard.com*^p2case1=", + "resourceTypes": [ + "xmlhttprequest" + ] + } + }, + { + "id": 3, + "action": { + "type": "redirect", + "redirect": { + "transform": { + "queryTransform": { + "removeParams": [ "P3Case1" ] } @@ -2772,11 +2811,10 @@ With these rules, specified UTM parameters will be removed from any request save } }, "condition": { - "urlFilter": "||testcases.adguard.com", + "urlFilter": "||testcases.adguard.com*^P3Case1=", "resourceTypes": [ "xmlhttprequest" - ], - "isUrlFilterCaseSensitive": false + ] } }, { @@ -2794,10 +2832,10 @@ With these rules, specified UTM parameters will be removed from any request save } }, "condition": { + "urlFilter": "^p1case2=", "resourceTypes": [ "xmlhttprequest" - ], - "isUrlFilterCaseSensitive": false + ] } } ]