From 99f184eac11acdb00200be07a57de810a9fb1b5d Mon Sep 17 00:00:00 2001 From: garry-ut99 <72945564+garry-ut99@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:30:21 +0000 Subject: [PATCH] Updated "removeparam". --- Static-filter-syntax.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Static-filter-syntax.md b/Static-filter-syntax.md index b4b1f2e..e7a552a 100644 --- a/Static-filter-syntax.md +++ b/Static-filter-syntax.md @@ -884,7 +884,7 @@ To remove query parameters from the URL of network requests -- see also [AG's `r `removeparam` is a modifier option (like `csp`) in that it does not cause a network request to be blocked but rather becomes modified before being emitted. -`removeparam` must be assigned a value. This value will determine which exact parameter from a query string will get removed: +`removeparam` can be assigned a value. This value will determine which exact parameter from a query string will get removed: ```adb *$removeparam=utm_source @@ -900,6 +900,12 @@ The value assigned to `removeparam` can be a literal regular expression, in whic The above filter will remove all query parameters whose name starts with `utm_`, regardless of their value. When using a literal regular expression, it gets tested against each query parameter name-value pair assembled into a single string as `name=value`. +If no values are assigned, all query parameters on a given site will be removed: + +```adb +||example.org^$removeparam +``` + Poorly crafted `removeparam` filters can have harmful effects on performance. Experienced filter authors need to understand how to create optimal filters. Cosmetically added params cannot be removed via `removeparam` (see related comment: [760#issuecomment-724703650](https://github.com/uBlockOrigin/uBlock-issues/issues/760#issuecomment-724703650) and invalid issues: [#1704](https://github.com/uBlockOrigin/uBlock-issues/issues/1704), [#1767](https://github.com/uBlockOrigin/uBlock-issues/issues/1767), [#1951](https://github.com/uBlockOrigin/uBlock-issues/issues/1951), [#2498](https://github.com/uBlockOrigin/uBlock-issues/issues/2498))