From 184596103f8d3f9cfa4ef25630ae9aa3e8e6a0a6 Mon Sep 17 00:00:00 2001 From: MasterKia Date: Thu, 29 Dec 2022 11:45:00 +0330 Subject: [PATCH] Add to= and from= network filter options --- Static-filter-syntax.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Static-filter-syntax.md b/Static-filter-syntax.md index 6779d04..3f67ea7 100644 --- a/Static-filter-syntax.md +++ b/Static-filter-syntax.md @@ -286,7 +286,9 @@ Filter list authors are discouraged from using exception filters of the `cname` *** -#### `denyallow` +#### ~~`denyallow`~~ + +**Superseded by [`to`](#to).** New in [1.26.0](https://github.com/gorhill/uBlock/commit/c3bc2c741d61db3e99b313835c2ae34a4a008359). @@ -324,6 +326,8 @@ See also: [`all`](#all) #### `domain` +Alias: [`from`](#from) + Restrict the filter to be applied only to the specified domain(s). Use the `|` symbol to join multiple domains. @@ -364,6 +368,16 @@ Equivalent to `subdocument` [option](https://help.eyeo.com/en/adblockplus/how-to *** +#### `from` + +New in [1.46.1b0](https://github.com/gorhill/uBlock/commit/19f8b30d577ac17097b8060adfc92093866e26d8). + +It is just an alias for the `domain=` option. The logger will render `domain=` network filters using the `from=` version. + +See: [`domain`](#domain) + +*** + #### `generichide` Alias: `ghide`. @@ -528,6 +542,29 @@ For example: *** +#### `to` + +New in [1.46.1b0](https://github.com/gorhill/uBlock/commit/19f8b30d577ac17097b8060adfc92093866e26d8). + +Solves [uBlockOrigin/uBlock-issues#2412](https://github.com/uBlockOrigin/uBlock-issues/discussions/2412). + +The main motivation of this option is to give uBO's static network filtering engine an equivalent of DNR's [`requestDomains`](https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#property-RuleCondition-requestDomains) and [`excludedRequestDomains`](https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#property-RuleCondition-excludedRequestDomains). + +`to=` is a superset of `denyallow=` with support for Entity-based syntax and also negated hostname. + +For now `denyallow=` won't be deprecated, which still does not support entity-based syntax and for which negated domains are not allowed. + +Examples: + +``` +||it^$3p,to=~example.it +*$script,from=beforeitsnews.com,to=google.*|gstatic.com +``` + +See also: [`denyallow`](#denyallow), [`from`](#from) + +*** + #### `xhr` Equivalent to `xmlhttprequest` [option](https://help.eyeo.com/en/adblockplus/how-to-write-filters#options). For convenience.