AdguardTeam / AdguardTeam/tsurlfilter
ad filtering syntax: `removeparam` modifier doesn't help to clean junk query params that are preceded by a hash (`#`)
- 主要语言
- TypeScript
- 星标
- 81
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
描述
## Prerequisites
- [X] I checked the documentation and found no answer;
- [X] I checked to make sure that this issue has not already been filed;
- [X] This is not an ad/bug report.
## Problem description
* Be a URL with a few rather classic junk query params (`at_medium`, `at_campaign`, etc) — **_but preceded by a `#`_**:
```
https://www.france.tv/films/5606040-une-affaire-privee.html#at_medium=5&at_campaign_group=2&at_campaign=integrale&at_offre=1&at_send_date=20240106&at_recipient_id=459386-1664366309-2d5f2440
```
* Be a custom filter rule (which works all right as long as the query params are preceded by a `?` or an `&`):
```
||*$removeparam=/^(at|ul|utm)_/
```
### Expected behavior
With the aforementioned rule being set, the URL should be rendered as
```
https://www.france.tv/films/5606040-une-affaire-privee.html
```
### Actual behavior
The URL remains unchanged. On the other hand, the filter works all right as long as the query params are preceded by a `?` or an `&`.
## Proposed solution
Not sure, but probably the `^` set of separator characters (separator marks) should also include the hash (`#`).
Excerpt from the KB:
> ### [Special characters](https://adguard.com/kb/general/ad-filtering/create-own-filters/#basic-rules-special-characters)
> (...)
> - **`^`** — a separator character mark. Separator character is any character, but a letter, a digit, or one of the following: `_` `-` `.` `%`. In this example separator characters are shown in bold: `http:`**`//`**`example.com`**`/?`**`t=1`**`&`**`t2=t3`. The end of the address is also accepted as separator.
### Additional information
_No response_
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。