Updated Static filter syntax (markdown)

Raymond Hill 2017-10-06 07:48:59 -04:00
parent 6e98b8d8d2
commit f49a7b49b3

@ -63,7 +63,15 @@ To block "popunders" windows/tabs. To be used in the same manner as the `popup`
#### `redirect`
To cause a blocked network request to be redirected to a local "neutered" version of the resource. (more documentation will eventually be made.)
To cause a blocked network request to be redirected to a local "neutered" version of the resource. The "neutered" resource must be referenced using a resource token. The resources are defined in [uAssets/filters/resources.txt](https://github.com/uBlockOrigin/uAssets/blob/master/filters/resources.txt).
The filter syntax for `redirect=` filter option is a subset of ABP-compatible filtering syntax, and is as follow:
||example.com^$script,redirect=noopjs,domain=github.com
||example.com/path/to/image$image,redirect=2x2-transparent.png,domain=github.com
*/$script,redirect=noopjs,first-party
Specifically, notice that the filter **must** start with `||` or `*`, otherwise no redirection directive will be created, though a blocking filter will be created. Essentially, a redirection filter must always have a destination hostname specified, or `*` if the filter is to apply to all destinations. A source hostname must always be specified, so the `domain=` option is mandatory. It is allowed to use `first-party` instead of `domain=`, in which case the source hostname will be that of the destination hostname.
### Cosmetic filters