Index: pages/filter-cheatsheet.html =================================================================== --- a/pages/filter-cheatsheet.html +++ b/pages/filter-cheatsheet.html @@ -616,16 +616,23 @@
domain=
third-party
~third-party
rewrite=
$n
to insert submatches into the rewritten URL. See JavaScript own String.prototype.replace()
.}}{{s102 Less frequently used options, including
,
,
,
,
,
,
and
are explained in the full documentation.}}
{{s104 It is generally recommended that users install the Element Hiding Helper for Adblock Plus to assist them in the generation of element hiding rules.}}
Index: pages/filters.html =================================================================== --- a/pages/filters.html +++ b/pages/filters.html @@ -179,16 +179,19 @@ {{s75donottrack
— for any address matching a blocking rule with
this option and not matching any exception rules with this option a
Do-Not-Track header will be sent (requires
Adblock Plus 1.3.5 or higher).}} {{s76 For backwards compatibility it is recommended
to use this option in combination with contradicting type options, this will prevent this
filter from blocking anything in earlier Adblock Plus versions:
*$donottrack,image,~image
}}
+ rewrite=
. You may want to create a regular expression filter to perform the rewrite operation. In that case, you can use $n
in the rewrite argument, with n
being a number between 1 and 100, to insert the n-th parenthesis submatch of the filter regular expression. Anything not explicitly matched by it will be added in the rewritten string. For example /(server\.com\/assets\/file.php)\?.*$/$rewrite=$1
will strip everything that comes after ".php" and redirects the request to the resulting URL. If there is no query string (i.e. no '?'), this filter won't match. The rewrite parameter has the same syntax as JavaScript’s String.prototype.replace()
. The resulting URL must have the same origin; in case it is rewritten to a relative URL, the origin gets added back. Also, rewrite for scripts, subdocuments, objects, requests from within objects (like Flash) are not possible for security reason; even if explicitly stated by the filter. If both, a filter with/without $rewrite
option matches, the behavior is undefined, i.e. the request might either be blocked or redirected. (Adblock Plus 3.2 or higher required.)}}
+ {{s79 If you want even more control about what your filters match and what they don't match, you can use regular expressions. For example the filter
will match
and
but not
. You can check out documentation on regular expressions to learn how to write them.}}
{{s80 Note: For performance reasons it is recommended not to use regular expressions if they can be avoided.}}