+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="SECT3">
+ <h4 class="SECT3"><a name="FILTER" id="FILTER">8.5.17. filter</a></h4>
+ <div class="VARIABLELIST">
+ <dl>
+ <dt>Typical use:</dt>
+ <dd>
+ <p>Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements,
+ add personalized effects, etc.</p>
+ </dd>
+ <dt>Effect:</dt>
+ <dd>
+ <p>All instances of text-based type, most notably HTML and JavaScript, to which this action applies, can
+ be filtered on-the-fly through the specified regular expression based substitutions. (Note: as of version
+ 3.0.3 plain text documents are exempted from filtering, because web servers often use the <tt class=
+ "LITERAL">text/plain</tt> MIME type for all files whose type they don't know.)</p>
+ </dd>
+ <dt>Type:</dt>
+ <dd>
+ <p>Multi-value.</p>
+ </dd>
+ <dt>Parameter:</dt>
+ <dd>
+ <p>The name of a content filter, as defined in the <a href="filter-file.html">filter file</a>. Filters
+ can be defined in one or more files as defined by the <tt class="LITERAL"><a href=
+ "config.html#FILTERFILE">filterfile</a></tt> option in the <a href="config.html">config file</a>.
+ <tt class="FILENAME">default.filter</tt> is the collection of filters supplied by the developers. Locally
+ defined filters should go in their own file, such as <tt class="FILENAME">user.filter</tt>.</p>
+ <p>When used in its negative form, and without parameters, <span class="emphasis"><i class=
+ "EMPHASIS">all</i></span> filtering is completely disabled.</p>
+ </dd>
+ <dt>Notes:</dt>
+ <dd>
+ <p>For your convenience, there are a number of pre-defined filters available in the distribution filter
+ file that you can use. See the examples below for a list.</p>
+ <p>Filtering requires buffering the page content, which may appear to slow down page rendering since
+ nothing is displayed until all content has passed the filters. (The total time until the page is
+ completely rendered doesn't change much, but it may be perceived as slower since the page is not
+ incrementally displayed.) This effect will be more noticeable on slower connections.</p>
+ <p><span class="QUOTE">"Rolling your own"</span> filters requires a knowledge of <a href=
+ "http://en.wikipedia.org/wiki/Regular_expressions" target="_top"><span class="QUOTE">"Regular
+ Expressions"</span></a> and <a href="http://en.wikipedia.org/wiki/Html" target="_top"><span class=
+ "QUOTE">"HTML"</span></a>. This is very powerful feature, and potentially very intrusive. Filters should
+ be used with caution, and where an equivalent <span class="QUOTE">"action"</span> is not available.</p>
+ <p>The amount of data that can be filtered is limited to the <tt class="LITERAL"><a href=
+ "config.html#BUFFER-LIMIT">buffer-limit</a></tt> option in the main <a href="config.html">config
+ file</a>. The default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered data, and all
+ pending data, is passed through unfiltered.</p>
+ <p>Inappropriate MIME types, such as zipped files, are not filtered at all. (Again, only text-based types
+ except plain text). Encrypted SSL data (from HTTPS servers) cannot be filtered either, since this would
+ violate the integrity of the secure transaction. In some situations it might be necessary to protect
+ certain text, like source code, from filtering by defining appropriate <tt class="LITERAL">-filter</tt>
+ exceptions.</p>
+ <p>Compressed content can't be filtered either, but if <span class="APPLICATION">Privoxy</span> is
+ compiled with zlib support and a supported compression algorithm is used (gzip or deflate), <span class=
+ "APPLICATION">Privoxy</span> can first decompress the content and then filter it.</p>
+ <p>If you use a <span class="APPLICATION">Privoxy</span> version without zlib support, but want filtering
+ to work on as much documents as possible, even those that would normally be sent compressed, you must use
+ the <tt class="LITERAL"><a href="actions-file.html#PREVENT-COMPRESSION">prevent-compression</a></tt>
+ action in conjunction with <tt class="LITERAL">filter</tt>.</p>
+ <p>Content filtering can achieve some of the same effects as the <tt class="LITERAL"><a href=
+ "actions-file.html#BLOCK">block</a></tt> action, i.e. it can be used to block ads and banners. But the
+ mechanism works quite differently. One effective use, is to block ad banners based on their size (see
+ below), since many of these seem to be somewhat standardized.</p>
+ <p><a href="contact.html">Feedback</a> with suggestions for new or improved filters is particularly
+ welcome!</p>
+ <p>The below list has only the names and a one-line description of each predefined filter. There are
+ <a href="filter-file.html#PREDEFINED-FILTERS">more verbose explanations</a> of what these filters do in
+ the <a href="filter-file.html">filter file chapter</a>.</p>
+ </dd>
+ <dt>Example usage (with filters from the distribution <tt class="FILENAME">default.filter</tt> file). See
+ <a href="filter-file.html#PREDEFINED-FILTERS">the Predefined Filters section</a> for more explanation on
+ each:</dt>
+ <dd>
+ <p><a name="FILTER-JS-ANNOYANCES" id="FILTER-JS-ANNOYANCES"></a></p>
+ <table border="0" bgcolor="#E0E0E0" width="90%">