Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions docs/general/ad-filtering/create-own-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation mentions that Chrome allows up to 20 hops per navigation for parameter removal. Could you add information about what happens if there are more than 20 parameters to remove? Would some parameters remain unprocessed?


```bash
||testcases.adguard.com$xmlhttprequest,removeparam=p1case1
Expand All @@ -2763,20 +2762,59 @@ 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"
]
}
}
}
},
"condition": {
"urlFilter": "||testcases.adguard.com",
"urlFilter": "||testcases.adguard.com*^P3Case1=",
"resourceTypes": [
"xmlhttprequest"
],
"isUrlFilterCaseSensitive": false
]
}
},
{
Expand All @@ -2794,10 +2832,10 @@ With these rules, specified UTM parameters will be removed from any request save
}
},
"condition": {
"urlFilter": "^p1case2=",
"resourceTypes": [
"xmlhttprequest"
],
"isUrlFilterCaseSensitive": false
]
}
}
]
Expand Down
Loading