From 0818cc14aacf6de76d48e121f57f35dd71ce9977 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Tue, 15 Aug 2023 17:08:04 +0300 Subject: [PATCH 01/10] Example rule fix --- docs/general/ad-filtering/create-own-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index da070d52b47..432cab275c7 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -71,7 +71,7 @@ Filtering rules support numerous modifiers that allow you to fine-tune the rule **This rule blocks:** -- `http://example.org/script.js` if this script is loaded from `example.org`. +- `http://example.org/script.js` if this script is loaded from `example.com`. **This rule does not block:** From 52dbe3914bde32eb1d9784f72e07d3016cd27c82 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Tue, 15 Aug 2023 18:48:58 +0300 Subject: [PATCH 02/10] Ignoring rules --- .../ad-filtering/create-own-filters.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 432cab275c7..ac19bd5550c 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -204,6 +204,59 @@ AdGuard Safari and AdGuard for iOS do not fully support regular expressions beca ::: +### Ignoring rules {#rules-ignore} + +Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen when the rule doesn't contain a mask, or when the mask matches any URL with a certain protocol. + +This rule will be ignored: + +```text +|http://$replace=/a/b/ +``` + +This limitation can be circumvented by using a `/.*/` regular expression inside the mask. + +This rule will not be ignored: + +```text +(/.*/$replace=/a/b/) +``` + +**Exceptions** + +This rule validation is not applied in following cases: + +- The rule contains [`$domain`](#domain-modifier) modifier that points to a specific domain list. + +These rules will not be ignored: + +```text +$domain=example.com,script +$domain=example.*,script +``` + +This rule will be ignored: + +```text +$domain=~example.com,script +``` + +- The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. + +These rule will not be ignored: + +```text +$app=curl,document +``` + +This rule will be ignored: + +```text +$domain=~curl,document +``` + +- The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). + ### Wildcard support for TLD (top-level domains) {#wildcard-for-tld} Wildcard characters are supported for TLDs of the domains in patterns of [cosmetic](#cosmetic-rules), [HTML filtering](#html-filtering-rules) and [JavaScript](#javascript-rules) rules. From f00cccda29aa4a3efb25981217832772ec446a87 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Tue, 15 Aug 2023 18:53:25 +0300 Subject: [PATCH 03/10] Added consistency to modifier headings --- docs/general/ad-filtering/create-own-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index ac19bd5550c..24d9727d3c1 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -960,7 +960,7 @@ Disables all generic [cosmetic rules](#cosmetic-rules) on pages that correspond - `@@||example.com^$generichide` disables generic cosmetic rules on any pages at `example.com` and its subdomains. -#### **`specifichide`** {#specifichide-modifier} +#### **`$specifichide`** {#specifichide-modifier} Disables all specific element hiding and CSS rules, but not general ones. Has an opposite effect to [`$generichide`](#generichide-modifier). From 53cc46e4d27f027159fc1f78486dfd0a0cb57462 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Tue, 15 Aug 2023 19:04:38 +0300 Subject: [PATCH 04/10] regexp fix --- docs/general/ad-filtering/create-own-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 24d9727d3c1..b4375e55a53 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -219,7 +219,7 @@ This limitation can be circumvented by using a `/.*/` regular expression inside This rule will not be ignored: ```text -(/.*/$replace=/a/b/) +/.*/$replace=/a/b/ ``` **Exceptions** From f4ad6086428df4a788d2047b534d237719761ff9 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Thu, 17 Aug 2023 02:58:08 +0300 Subject: [PATCH 05/10] Fixes as per reviews --- .../ad-filtering/create-own-filters.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index b4375e55a53..ef6fbaef6f7 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -204,9 +204,9 @@ AdGuard Safari and AdGuard for iOS do not fully support regular expressions beca ::: -### Ignoring rules {#rules-ignore} +### Restrictions on rules application {#rules-restrictions} -Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen when the rule doesn't contain a mask, or when the mask matches any URL with a certain protocol. +Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen if the rule doesn't contain a mask, or if the mask matches any URL with a certain protocol. This rule will be ignored: @@ -224,38 +224,38 @@ This rule will not be ignored: **Exceptions** -This rule validation is not applied in following cases: +This rule validation is not applied in the following cases: -- The rule contains [`$domain`](#domain-modifier) modifier that points to a specific domain list. +1. The rule contains [`$domain`](#domain-modifier) modifier that points to a specific domain list. -These rules will not be ignored: + These rules will not be ignored: -```text -$domain=example.com,script -$domain=example.*,script -``` + ```text + $domain=example.com,script + $domain=example.*,script + ``` -This rule will be ignored: + This rule will be ignored: -```text -$domain=~example.com,script -``` + ```text + $domain=~example.com,script + ``` -- The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. +2. The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. -These rule will not be ignored: + These rule will not be ignored: -```text -$app=curl,document -``` + ```text + $app=curl,document + ``` -This rule will be ignored: + This rule will be ignored: -```text -$domain=~curl,document -``` + ```text + $domain=~curl,document + ``` -- The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). +3. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). ### Wildcard support for TLD (top-level domains) {#wildcard-for-tld} From b1ef272a327482a3c7c58703c7bf7b17c34a319b Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Mon, 11 Sep 2023 12:42:45 +0300 Subject: [PATCH 06/10] Changes per reviews --- .../ad-filtering/create-own-filters.md | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index eae035a8b35..131e1f2ccc7 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -206,7 +206,7 @@ AdGuard Safari and AdGuard for iOS do not fully support regular expressions beca ### Restrictions on rules application {#rules-restrictions} -Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen if the rule doesn't contain a mask, or if the mask matches any URL with a certain protocol. +Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen if the rule doesn't contain a mask, or if the mask matches any URL with a certain protocol. This rule will be ignored: @@ -235,27 +235,36 @@ This rule validation is not applied in the following cases: $domain=example.*,script ``` - This rule will be ignored: + This rule will be ignored because of domain negation, which causes too wide of a rule application scope: ```text $domain=~example.com,script ``` -2. The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. +1. The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. - These rule will not be ignored: + This rule will not be ignored: ```text $app=curl,document ``` - This rule will be ignored: + This rule will be ignored because of app negation, which causes too wide of a rule application scope: ```text - $domain=~curl,document + $app=~curl,document ``` -3. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). +1. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). + + These rules will not be ignored: + + ```text + $removeparam=cx_recsWidget + $cookie=ibbid + $removeheader=location + $stealth + ``` ### Wildcard support for TLD (top-level domains) {#wildcard-for-tld} From df35f50c2bda061d2d375888c2e2a3d519c87ec6 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Mon, 11 Sep 2023 19:31:11 +0300 Subject: [PATCH 07/10] added denyallow info --- docs/general/ad-filtering/create-own-filters.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 131e1f2ccc7..c1072c4a46c 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -255,6 +255,14 @@ This rule validation is not applied in the following cases: $app=~curl,document ``` +1. The rule contains [`$denyallow](#denyallow-modifier) that points to a specific domain(s). + + This rule will not be ignore: + + ```text + $script,third-party,denyallow=example.com + ``` + 1. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). These rules will not be ignored: From bf46c72ae07f8a318982fc33bbaa4011704610e5 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Mon, 11 Sep 2023 19:45:13 +0300 Subject: [PATCH 08/10] spacing --- .../ad-filtering/create-own-filters.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 1ab2517d2d0..61a2d08baa6 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -228,51 +228,51 @@ This rule validation is not applied in the following cases: 1. The rule contains [`$domain`](#domain-modifier) modifier that points to a specific domain list. - These rules will not be ignored: + These rules will not be ignored: - ```text - $domain=example.com,script - $domain=example.*,script - ``` + ```text + $domain=example.com,script + $domain=example.*,script + ``` - This rule will be ignored because of domain negation, which causes too wide of a rule application scope: + This rule will be ignored because of domain negation, which causes too wide of a rule application scope: - ```text - $domain=~example.com,script - ``` + ```text + $domain=~example.com,script + ``` 1. The rule contains [`$app`](#app-modifier) modifier that points to a specific app list. - This rule will not be ignored: + This rule will not be ignored: - ```text - $app=curl,document - ``` + ```text + $app=curl,document + ``` - This rule will be ignored because of app negation, which causes too wide of a rule application scope: + This rule will be ignored because of app negation, which causes too wide of a rule application scope: - ```text - $app=~curl,document - ``` + ```text + $app=~curl,document + ``` 1. The rule contains [`$denyallow](#denyallow-modifier) that points to a specific domain(s). - This rule will not be ignore: + This rule will not be ignore: - ```text - $script,third-party,denyallow=example.com - ``` + ```text + $script,third-party,denyallow=example.com + ``` 1. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). - These rules will not be ignored: + These rules will not be ignored: - ```text - $removeparam=cx_recsWidget - $cookie=ibbid - $removeheader=location - $stealth - ``` + ```text + $removeparam=cx_recsWidget + $cookie=ibbid + $removeheader=location + $stealth + ``` ### Wildcard support for TLD (top-level domains) {#wildcard-for-tld} From b7e7e588625bfc4b7921717a8c36612d0f32cc88 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Mon, 11 Sep 2023 19:46:18 +0300 Subject: [PATCH 09/10] typo --- docs/general/ad-filtering/create-own-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 61a2d08baa6..aef510df222 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -263,7 +263,7 @@ This rule validation is not applied in the following cases: $script,third-party,denyallow=example.com ``` -1. The rule contains one or more modificators from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). +1. The rule contains one or more modifiers from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). These rules will not be ignored: From 8712129a43c05da899c4f47e104272cdd44bfbc9 Mon Sep 17 00:00:00 2001 From: Vasily Bagirov Date: Tue, 12 Sep 2023 12:47:47 +0300 Subject: [PATCH 10/10] removed denyallow see the discussion on the pr page --- docs/general/ad-filtering/create-own-filters.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index aef510df222..c47c89673e1 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -255,14 +255,6 @@ This rule validation is not applied in the following cases: $app=~curl,document ``` -1. The rule contains [`$denyallow](#denyallow-modifier) that points to a specific domain(s). - - This rule will not be ignore: - - ```text - $script,third-party,denyallow=example.com - ``` - 1. The rule contains one or more modifiers from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier). These rules will not be ignored: