mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Updated Dynamic filtering: rule syntax (markdown)
parent
c54a34026d
commit
2894605a3b
1 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,8 @@ A dynamic filtering rule is made of four components: a source hostname, a destin
|
|||
|
||||
Source hostname always correspond to the hostname extracted from the URL of the web page in the browser. The destination hostname correspond to the hostname extracted from the URL of a remote resource which the web page is fetching (or trying to). The type is the type of the fetched resource. A request can be blocked, allowed, or ignored.
|
||||
|
||||
***
|
||||
|
||||
### Type-based rules
|
||||
|
||||
Type-based rules are used to filter specific types of request on a web page. There currently exists seven types of request which can be dynamically filtered:
|
||||
|
|
@ -28,6 +30,8 @@ Another example: `wired.com * image block`, which means "block images from all o
|
|||
|
||||
Note that with type-based rules, the destination hostname is **always** `*`, meaning "from anywhere".
|
||||
|
||||
***
|
||||
|
||||
### Hostname-based rules
|
||||
|
||||
Hostname-based rules are used to filter network resources according to their origin, i.e. according to which remote server a resource is pulled. Hostname-based rules have a higher specificity than type-based rules, and thus hostname-based rules always override type-based rules whenever a network request end up matching both a type- and a hostname-based rule.
|
||||
|
|
@ -38,6 +42,8 @@ For example, `* disqus.com * block` means "globally block all net requests to `d
|
|||
|
||||
Just like type-based rules, a hostname-based rule can apply only when visiting a specific web site, for example: `wired.com disqus.com * noop`, which means "do not apply dynamic filtering to net requests to `disqus.com` when visiting a web page on `wired.com`. Since this last rule is more specific than the previous one, it will override the global blocking of `disqus.com` everywhere.
|
||||
|
||||
***
|
||||
|
||||
### Actions
|
||||
|
||||
A matching rule can do one of three things:
|
||||
|
|
|
|||
Loading…
Reference in a new issue