Regenerate HTML docs with recent changes
[privoxy.git] / doc / webserver / user-manual / actions-file.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5   <title>Actions Files</title>
6   <meta name="GENERATOR" content=
7   "Modular DocBook HTML Stylesheet Version 1.79">
8   <link rel="HOME" title="Privoxy 3.0.26 User Manual" href="index.html">
9   <link rel="PREVIOUS" title="The Main Configuration File" href=
10   "config.html">
11   <link rel="NEXT" title="Filter Files" href="filter-file.html">
12   <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
13   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14   <link rel="STYLESHEET" type="text/css" href="p_doc.css">
15 </head>
16 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
17 "#840084" alink="#0000FF">
18   <div class="NAVHEADER">
19     <table summary="Header navigation table" width="100%" border="0"
20     cellpadding="0" cellspacing="0">
21       <tr>
22         <th colspan="3" align="center">Privoxy 3.0.26 User Manual</th>
23       </tr>
24       <tr>
25         <td width="10%" align="left" valign="bottom"><a href="config.html"
26         accesskey="P">Prev</a></td>
27         <td width="80%" align="center" valign="bottom"></td>
28         <td width="10%" align="right" valign="bottom"><a href=
29         "filter-file.html" accesskey="N">Next</a></td>
30       </tr>
31     </table>
32     <hr align="left" width="100%">
33   </div>
34   <div class="SECT1">
35     <h1 class="SECT1"><a name="ACTIONS-FILE" id="ACTIONS-FILE">8. Actions
36     Files</a></h1>
37     <p>The actions files are used to define what <span class=
38     "emphasis"><i class="EMPHASIS">actions</i></span> <span class=
39     "APPLICATION">Privoxy</span> takes for which URLs, and thus determines
40     how ad images, cookies and various other aspects of HTTP content and
41     transactions are handled, and on which sites (or even parts thereof).
42     There are a number of such actions, with a wide range of functionality.
43     Each action does something a little different. These actions give us a
44     veritable arsenal of tools with which to exert our control, preferences
45     and independence. Actions can be combined so that their effects are
46     aggregated when applied against a given set of URLs.</p>
47     <p>There are three action files included with <span class=
48     "APPLICATION">Privoxy</span> with differing purposes:</p>
49     <ul>
50       <li>
51         <p><tt class="FILENAME">match-all.action</tt> - is used to define
52         which <span class="QUOTE">"actions"</span> relating to
53         banner-blocking, images, pop-ups, content modification, cookie
54         handling etc should be applied by default. It should be the first
55         actions file loaded</p>
56       </li>
57       <li>
58         <p><tt class="FILENAME">default.action</tt> - defines many exceptions
59         (both positive and negative) from the default set of actions that's
60         configured in <tt class="FILENAME">match-all.action</tt>. It is a set
61         of rules that should work reasonably well as-is for most users. This
62         file is only supposed to be edited by the developers. It should be
63         the second actions file loaded.</p>
64       </li>
65       <li>
66         <p><tt class="FILENAME">user.action</tt> - is intended to be for
67         local site preferences and exceptions. As an example, if your ISP or
68         your bank has specific requirements, and need special handling, this
69         kind of thing should go here. This file will not be upgraded.</p>
70       </li>
71       <li>
72         <p><span class="GUIBUTTON">Edit</span> <span class="GUIBUTTON">Set to
73         Cautious</span> <span class="GUIBUTTON">Set to Medium</span>
74         <span class="GUIBUTTON">Set to Advanced</span></p>
75         <p>These have increasing levels of aggressiveness <span class=
76         "emphasis"><i class="EMPHASIS">and have no influence on your browsing
77         unless you select them explicitly in the editor</i></span>. A default
78         installation should be pre-set to <tt class="LITERAL">Cautious</tt>.
79         New users should try this for a while before adjusting the settings
80         to more aggressive levels. The more aggressive the settings, then the
81         more likelihood there is of problems such as sites not working as
82         they should.</p>
83         <p>The <span class="GUIBUTTON">Edit</span> button allows you to turn
84         each action on/off individually for fine-tuning. The <span class=
85         "GUIBUTTON">Cautious</span> button changes the actions list to
86         low/safe settings which will activate ad blocking and a minimal set
87         of <span class="APPLICATION">Privoxy</span>'s features, and
88         subsequently there will be less of a chance for accidental problems.
89         The <span class="GUIBUTTON">Medium</span> button sets the list to a
90         medium level of other features and a low level set of privacy
91         features. The <span class="GUIBUTTON">Advanced</span> button sets the
92         list to a high level of ad blocking and medium level of privacy. See
93         the chart below. The latter three buttons over-ride any changes via
94         with the <span class="GUIBUTTON">Edit</span> button. More fine-tuning
95         can be done in the lower sections of this internal page.</p>
96         <p>While the actions file editor allows to enable these settings in
97         all actions files, they are only supposed to be enabled in the first
98         one to make sure you don't unintentionally overrule earlier
99         rules.</p>
100         <p>The default profiles, and their associated actions, as pre-defined
101         in <tt class="FILENAME">default.action</tt> are:</p>
102         <div class="TABLE">
103           <a name="AEN2791" id="AEN2791"></a>
104           <p><b>Table 1. Default Configurations</b></p>
105           <table border="1" frame="border" rules="all" class="CALSTABLE">
106             <col width="1*" title="C1">
107             <col width="1*" title="C2">
108             <col width="1*" title="C3">
109             <col width="1*" title="C4">
110             <thead>
111               <tr>
112                 <th>Feature</th>
113                 <th>Cautious</th>
114                 <th>Medium</th>
115                 <th>Advanced</th>
116               </tr>
117             </thead>
118             <tbody>
119               <tr>
120                 <td>Ad-blocking Aggressiveness</td>
121                 <td>medium</td>
122                 <td>high</td>
123                 <td>high</td>
124               </tr>
125               <tr>
126                 <td>Ad-filtering by size</td>
127                 <td>no</td>
128                 <td>yes</td>
129                 <td>yes</td>
130               </tr>
131               <tr>
132                 <td>Ad-filtering by link</td>
133                 <td>no</td>
134                 <td>no</td>
135                 <td>yes</td>
136               </tr>
137               <tr>
138                 <td>Pop-up killing</td>
139                 <td>blocks only</td>
140                 <td>blocks only</td>
141                 <td>blocks only</td>
142               </tr>
143               <tr>
144                 <td>Privacy Features</td>
145                 <td>low</td>
146                 <td>medium</td>
147                 <td>medium/high</td>
148               </tr>
149               <tr>
150                 <td>Cookie handling</td>
151                 <td>none</td>
152                 <td>session-only</td>
153                 <td>kill</td>
154               </tr>
155               <tr>
156                 <td>Referer forging</td>
157                 <td>no</td>
158                 <td>yes</td>
159                 <td>yes</td>
160               </tr>
161               <tr>
162                 <td>GIF de-animation</td>
163                 <td>no</td>
164                 <td>yes</td>
165                 <td>yes</td>
166               </tr>
167               <tr>
168                 <td>Fast redirects</td>
169                 <td>no</td>
170                 <td>no</td>
171                 <td>yes</td>
172               </tr>
173               <tr>
174                 <td>HTML taming</td>
175                 <td>no</td>
176                 <td>no</td>
177                 <td>yes</td>
178               </tr>
179               <tr>
180                 <td>JavaScript taming</td>
181                 <td>no</td>
182                 <td>no</td>
183                 <td>yes</td>
184               </tr>
185               <tr>
186                 <td>Web-bug killing</td>
187                 <td>no</td>
188                 <td>yes</td>
189                 <td>yes</td>
190               </tr>
191               <tr>
192                 <td>Image tag reordering</td>
193                 <td>no</td>
194                 <td>yes</td>
195                 <td>yes</td>
196               </tr>
197             </tbody>
198           </table>
199         </div>
200       </li>
201     </ul>
202     <p>The list of actions files to be used are defined in the main
203     configuration file, and are processed in the order they are defined (e.g.
204     <tt class="FILENAME">default.action</tt> is typically processed before
205     <tt class="FILENAME">user.action</tt>). The content of these can all be
206     viewed and edited from <a href="http://config.privoxy.org/show-status"
207     target="_top">http://config.privoxy.org/show-status</a>. The over-riding
208     principle when applying actions, is that the last action that matches a
209     given URL wins. The broadest, most general rules go first (defined in
210     <tt class="FILENAME">default.action</tt>), followed by any exceptions
211     (typically also in <tt class="FILENAME">default.action</tt>), which are
212     then followed lastly by any local preferences (typically in <span class=
213     "emphasis"><i class="EMPHASIS">user</i></span><tt class=
214     "FILENAME">.action</tt>). Generally, <tt class=
215     "FILENAME">user.action</tt> has the last word.</p>
216     <p>An actions file typically has multiple sections. If you want to use
217     <span class="QUOTE">"aliases"</span> in an actions file, you have to
218     place the (optional) <a href="actions-file.html#ALIASES">alias
219     section</a> at the top of that file. Then comes the default set of rules
220     which will apply universally to all sites and pages (be <span class=
221     "emphasis"><i class="EMPHASIS">very careful</i></span> with using such a
222     universal set in <tt class="FILENAME">user.action</tt> or any other
223     actions file after <tt class="FILENAME">default.action</tt>, because it
224     will override the result from consulting any previous file). And then
225     below that, exceptions to the defined universal policies. You can regard
226     <tt class="FILENAME">user.action</tt> as an appendix to <tt class=
227     "FILENAME">default.action</tt>, with the advantage that it is a separate
228     file, which makes preserving your personal settings across <span class=
229     "APPLICATION">Privoxy</span> upgrades easier.</p>
230     <p>Actions can be used to block anything you want, including ads,
231     banners, or just some obnoxious URL whose content you would rather not
232     see. Cookies can be accepted or rejected, or accepted only during the
233     current browser session (i.e. not written to disk), content can be
234     modified, some JavaScripts tamed, user-tracking fooled, and much more.
235     See below for a <a href="actions-file.html#ACTIONS">complete list of
236     actions</a>.</p>
237     <div class="SECT2">
238       <h2 class="SECT2"><a name="RIGHT-MIX" id="RIGHT-MIX">8.1. Finding the
239       Right Mix</a></h2>
240       <p>Note that some <a href="actions-file.html#ACTIONS">actions</a>, like
241       cookie suppression or script disabling, may render some sites unusable
242       that rely on these techniques to work properly. Finding the right mix
243       of actions is not always easy and certainly a matter of personal taste.
244       And, things can always change, requiring refinements in the
245       configuration. In general, it can be said that the more <span class=
246       "QUOTE">"aggressive"</span> your default settings (in the top section
247       of the actions file) are, the more exceptions for <span class=
248       "QUOTE">"trusted"</span> sites you will have to make later. If, for
249       example, you want to crunch all cookies per default, you'll have to
250       make exceptions from that rule for sites that you regularly use and
251       that require cookies for actually useful purposes, like maybe your
252       bank, favorite shop, or newspaper.</p>
253       <p>We have tried to provide you with reasonable rules to start from in
254       the distribution actions files. But there is no general rule of thumb
255       on these things. There just are too many variables, and sites are
256       constantly changing. Sooner or later you will want to change the rules
257       (and read this chapter again :).</p>
258     </div>
259     <div class="SECT2">
260       <h2 class="SECT2"><a name="HOW-TO-EDIT" id="HOW-TO-EDIT">8.2. How to
261       Edit</a></h2>
262       <p>The easiest way to edit the actions files is with a browser by using
263       our browser-based editor, which can be reached from <a href=
264       "http://config.privoxy.org/show-status" target=
265       "_top">http://config.privoxy.org/show-status</a>. Note: the config file
266       option <a href=
267       "config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions</a> must be
268       enabled for this to work. The editor allows both fine-grained control
269       over every single feature on a per-URL basis, and easy choosing from
270       wholesale sets of defaults like <span class="QUOTE">"Cautious"</span>,
271       <span class="QUOTE">"Medium"</span> or <span class=
272       "QUOTE">"Advanced"</span>. Warning: the <span class=
273       "QUOTE">"Advanced"</span> setting is more aggressive, and will be more
274       likely to cause problems for some sites. Experienced users only!</p>
275       <p>If you prefer plain text editing to GUIs, you can of course also
276       directly edit the the actions files with your favorite text editor.
277       Look at <tt class="FILENAME">default.action</tt> which is richly
278       commented with many good examples.</p>
279     </div>
280     <div class="SECT2">
281       <h2 class="SECT2"><a name="ACTIONS-APPLY" id="ACTIONS-APPLY">8.3. How
282       Actions are Applied to Requests</a></h2>
283       <p>Actions files are divided into sections. There are special sections,
284       like the <span class="QUOTE">"<a href=
285       "actions-file.html#ALIASES">alias</a>"</span> sections which will be
286       discussed later. For now let's concentrate on regular sections: They
287       have a heading line (often split up to multiple lines for readability)
288       which consist of a list of actions, separated by whitespace and
289       enclosed in curly braces. Below that, there is a list of URL and tag
290       patterns, each on a separate line.</p>
291       <p>To determine which actions apply to a request, the URL of the
292       request is compared to all URL patterns in each <span class=
293       "QUOTE">"action file"</span>. Every time it matches, the list of
294       applicable actions for the request is incrementally updated, using the
295       heading of the section in which the pattern is located. The same is
296       done again for tags and tag patterns later on.</p>
297       <p>If multiple applying sections set the same action differently, the
298       last match wins. If not, the effects are aggregated. E.g. a URL might
299       match a regular section with a heading line of <tt class="LITERAL">{
300       +<a href="actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a>
301       }</tt>, then later another one with just <tt class="LITERAL">{
302       +<a href="actions-file.html#BLOCK">block</a> }</tt>, resulting in
303       <span class="emphasis"><i class="EMPHASIS">both</i></span> actions to
304       apply. And there may well be cases where you will want to combine
305       actions together. Such a section then might look like:</p>
306       <table border="0" bgcolor="#E0E0E0" width="100%">
307         <tr>
308           <td>
309             <pre class="SCREEN">  { +<tt class=
310             "LITERAL">handle-as-image</tt>  +<tt class=
311             "LITERAL">block{Banner ads.}</tt> }
312   # Block these as if they were images. Send no block page.
313    banners.example.com
314    media.example.com/.*banners
315    .example.com/images/ads/</pre>
316           </td>
317         </tr>
318       </table>
319       <p>You can trace this process for URL patterns and any given URL by
320       visiting <a href="http://config.privoxy.org/show-url-info" target=
321       "_top">http://config.privoxy.org/show-url-info</a>.</p>
322       <p>Examples and more detail on this is provided in the Appendix,
323       <a href="appendix.html#ACTIONSANAT">Troubleshooting: Anatomy of an
324       Action</a> section.</p>
325     </div>
326     <div class="SECT2">
327       <h2 class="SECT2"><a name="AF-PATTERNS" id="AF-PATTERNS">8.4.
328       Patterns</a></h2>
329       <p>As mentioned, <span class="APPLICATION">Privoxy</span> uses
330       <span class="QUOTE">"patterns"</span> to determine what <span class=
331       "emphasis"><i class="EMPHASIS">actions</i></span> might apply to which
332       sites and pages your browser attempts to access. These <span class=
333       "QUOTE">"patterns"</span> use wild card type <span class=
334       "emphasis"><i class="EMPHASIS">pattern</i></span> matching to achieve a
335       high degree of flexibility. This allows one expression to be expanded
336       and potentially match against many similar patterns.</p>
337       <p>Generally, an URL pattern has the form <tt class=
338       "LITERAL">&lt;host&gt;&lt;port&gt;/&lt;path&gt;</tt>, where the
339       <tt class="LITERAL">&lt;host&gt;</tt>, the <tt class=
340       "LITERAL">&lt;port&gt;</tt> and the <tt class=
341       "LITERAL">&lt;path&gt;</tt> are optional. (This is why the special
342       <tt class="LITERAL">/</tt> pattern matches all URLs). Note that the
343       protocol portion of the URL pattern (e.g. <tt class=
344       "LITERAL">http://</tt>) should <span class="emphasis"><i class=
345       "EMPHASIS">not</i></span> be included in the pattern. This is assumed
346       already!</p>
347       <p>The pattern matching syntax is different for the host and path parts
348       of the URL. The host part uses a simple globbing type matching
349       technique, while the path part uses more flexible <a href=
350       "http://en.wikipedia.org/wiki/Regular_expressions" target=
351       "_top"><span class="QUOTE">"Regular Expressions"</span></a> (POSIX
352       1003.2).</p>
353       <p>The port part of a pattern is a decimal port number preceded by a
354       colon (<tt class="LITERAL">:</tt>). If the host part contains a
355       numerical IPv6 address, it has to be put into angle brackets
356       (<tt class="LITERAL">&lt;</tt>, <tt class="LITERAL">&gt;</tt>).</p>
357       <div class="VARIABLELIST">
358         <dl>
359           <dt><tt class="LITERAL">www.example.com/</tt></dt>
360           <dd>
361             <p>is a host-only pattern and will match any request to
362             <tt class="LITERAL">www.example.com</tt>, regardless of which
363             document on that server is requested. So ALL pages in this domain
364             would be covered by the scope of this action. Note that a simple
365             <tt class="LITERAL">example.com</tt> is different and would NOT
366             match.</p>
367           </dd>
368           <dt><tt class="LITERAL">www.example.com</tt></dt>
369           <dd>
370             <p>means exactly the same. For host-only patterns, the trailing
371             <tt class="LITERAL">/</tt> may be omitted.</p>
372           </dd>
373           <dt><tt class="LITERAL">www.example.com/index.html</tt></dt>
374           <dd>
375             <p>matches all the documents on <tt class=
376             "LITERAL">www.example.com</tt> whose name starts with <tt class=
377             "LITERAL">/index.html</tt>.</p>
378           </dd>
379           <dt><tt class="LITERAL">www.example.com/index.html$</tt></dt>
380           <dd>
381             <p>matches only the single document <tt class=
382             "LITERAL">/index.html</tt> on <tt class=
383             "LITERAL">www.example.com</tt>.</p>
384           </dd>
385           <dt><tt class="LITERAL">/index.html$</tt></dt>
386           <dd>
387             <p>matches the document <tt class="LITERAL">/index.html</tt>,
388             regardless of the domain, i.e. on <span class=
389             "emphasis"><i class="EMPHASIS">any</i></span> web server
390             anywhere.</p>
391           </dd>
392           <dt><tt class="LITERAL">/</tt></dt>
393           <dd>
394             <p>Matches any URL because there's no requirement for either the
395             domain or the path to match anything.</p>
396           </dd>
397           <dt><tt class="LITERAL">:8000/</tt></dt>
398           <dd>
399             <p>Matches any URL pointing to TCP port 8000.</p>
400           </dd>
401           <dt><tt class="LITERAL">10.0.0.1/</tt></dt>
402           <dd>
403             <p>Matches any URL with the host address <tt class=
404             "LITERAL">10.0.0.1</tt>. (Note that the real URL uses plain
405             brackets, not angle brackets.)</p>
406           </dd>
407           <dt><tt class="LITERAL">&lt;2001:db8::1&gt;/</tt></dt>
408           <dd>
409             <p>Matches any URL with the host address <tt class=
410             "LITERAL">2001:db8::1</tt>. (Note that the real URL uses plain
411             brackets, not angle brackets.)</p>
412           </dd>
413           <dt><tt class="LITERAL">index.html</tt></dt>
414           <dd>
415             <p>matches nothing, since it would be interpreted as a domain
416             name and there is no top-level domain called <tt class=
417             "LITERAL">.html</tt>. So its a mistake.</p>
418           </dd>
419         </dl>
420       </div>
421       <div class="SECT3">
422         <h3 class="SECT3"><a name="HOST-PATTERN" id="HOST-PATTERN">8.4.1. The
423         Host Pattern</a></h3>
424         <p>The matching of the host part offers some flexible options: if the
425         host pattern starts or ends with a dot, it becomes unanchored at that
426         end. The host pattern is often referred to as domain pattern as it is
427         usually used to match domain names and not IP addresses. For
428         example:</p>
429         <div class="VARIABLELIST">
430           <dl>
431             <dt><tt class="LITERAL">.example.com</tt></dt>
432             <dd>
433               <p>matches any domain with first-level domain <tt class=
434               "LITERAL">com</tt> and second-level domain <tt class=
435               "LITERAL">example</tt>. For example <tt class=
436               "LITERAL">www.example.com</tt>, <tt class=
437               "LITERAL">example.com</tt> and <tt class=
438               "LITERAL">foo.bar.baz.example.com</tt>. Note that it wouldn't
439               match if the second-level domain was <tt class=
440               "LITERAL">another-example</tt>.</p>
441             </dd>
442             <dt><tt class="LITERAL">www.</tt></dt>
443             <dd>
444               <p>matches any domain that <span class="emphasis"><i class=
445               "EMPHASIS">STARTS</i></span> with <tt class="LITERAL">www.</tt>
446               (It also matches the domain <tt class="LITERAL">www</tt> but
447               most of the time that doesn't matter.)</p>
448             </dd>
449             <dt><tt class="LITERAL">.example.</tt></dt>
450             <dd>
451               <p>matches any domain that <span class="emphasis"><i class=
452               "EMPHASIS">CONTAINS</i></span> <tt class=
453               "LITERAL">.example.</tt>. And, by the way, also included would
454               be any files or documents that exist within that domain since
455               no path limitations are specified. (Correctly speaking: It
456               matches any FQDN that contains <tt class="LITERAL">example</tt>
457               as a domain.) This might be <tt class=
458               "LITERAL">www.example.com</tt>, <tt class=
459               "LITERAL">news.example.de</tt>, or <tt class=
460               "LITERAL">www.example.net/cgi/testing.pl</tt> for instance. All
461               these cases are matched.</p>
462             </dd>
463           </dl>
464         </div>
465         <p>Additionally, there are wild-cards that you can use in the domain
466         names themselves. These work similarly to shell globbing type
467         wild-cards: <span class="QUOTE">"*"</span> represents zero or more
468         arbitrary characters (this is equivalent to the <a href=
469         "http://en.wikipedia.org/wiki/Regular_expressions" target=
470         "_top"><span class="QUOTE">"Regular Expression"</span></a> based
471         syntax of <span class="QUOTE">".*"</span>), <span class=
472         "QUOTE">"?"</span> represents any single character (this is
473         equivalent to the regular expression syntax of a simple <span class=
474         "QUOTE">"."</span>), and you can define <span class=
475         "QUOTE">"character classes"</span> in square brackets which is
476         similar to the same regular expression technique. All of this can be
477         freely mixed:</p>
478         <div class="VARIABLELIST">
479           <dl>
480             <dt><tt class="LITERAL">ad*.example.com</tt></dt>
481             <dd>
482               <p>matches <span class="QUOTE">"adserver.example.com"</span>,
483               <span class="QUOTE">"ads.example.com"</span>, etc but not
484               <span class="QUOTE">"sfads.example.com"</span></p>
485             </dd>
486             <dt><tt class="LITERAL">*ad*.example.com</tt></dt>
487             <dd>
488               <p>matches all of the above, and then some.</p>
489             </dd>
490             <dt><tt class="LITERAL">.?pix.com</tt></dt>
491             <dd>
492               <p>matches <tt class="LITERAL">www.ipix.com</tt>, <tt class=
493               "LITERAL">pictures.epix.com</tt>, <tt class=
494               "LITERAL">a.b.c.d.e.upix.com</tt> etc.</p>
495             </dd>
496             <dt><tt class="LITERAL">www[1-9a-ez].example.c*</tt></dt>
497             <dd>
498               <p>matches <tt class="LITERAL">www1.example.com</tt>,
499               <tt class="LITERAL">www4.example.cc</tt>, <tt class=
500               "LITERAL">wwwd.example.cy</tt>, <tt class=
501               "LITERAL">wwwz.example.com</tt> etc., but <span class=
502               "emphasis"><i class="EMPHASIS">not</i></span> <tt class=
503               "LITERAL">wwww.example.com</tt>.</p>
504             </dd>
505           </dl>
506         </div>
507         <p>While flexible, this is not the sophistication of full regular
508         expression based syntax.</p>
509       </div>
510       <div class="SECT3">
511         <h3 class="SECT3"><a name="PATH-PATTERN" id="PATH-PATTERN">8.4.2. The
512         Path Pattern</a></h3>
513         <p><span class="APPLICATION">Privoxy</span> uses <span class=
514         "QUOTE">"modern"</span> POSIX 1003.2 <a href=
515         "http://en.wikipedia.org/wiki/Regular_expressions" target=
516         "_top"><span class="QUOTE">"Regular Expressions"</span></a> for
517         matching the path portion (after the slash), and is thus more
518         flexible.</p>
519         <p>There is an <a href="appendix.html#REGEX">Appendix</a> with a
520         brief quick-start into regular expressions, you also might want to
521         have a look at your operating system's documentation on regular
522         expressions (try <tt class="LITERAL">man re_format</tt>).</p>
523         <p>Note that the path pattern is automatically left-anchored at the
524         <span class="QUOTE">"/"</span>, i.e. it matches as if it would start
525         with a <span class="QUOTE">"^"</span> (regular expression speak for
526         the beginning of a line).</p>
527         <p>Please also note that matching in the path is <span class=
528         "emphasis"><i class="EMPHASIS">CASE INSENSITIVE</i></span> by
529         default, but you can switch to case sensitive at any point in the
530         pattern by using the <span class="QUOTE">"(?-i)"</span> switch:
531         <tt class="LITERAL">www.example.com/(?-i)PaTtErN.*</tt> will match
532         only documents whose path starts with <tt class=
533         "LITERAL">PaTtErN</tt> in <span class="emphasis"><i class=
534         "EMPHASIS">exactly</i></span> this capitalization.</p>
535         <div class="VARIABLELIST">
536           <dl>
537             <dt><tt class="LITERAL">.example.com/.*</tt></dt>
538             <dd>
539               <p>Is equivalent to just <span class=
540               "QUOTE">".example.com"</span>, since any documents within that
541               domain are matched with or without the <span class=
542               "QUOTE">".*"</span> regular expression. This is redundant</p>
543             </dd>
544             <dt><tt class="LITERAL">.example.com/.*/index.html$</tt></dt>
545             <dd>
546               <p>Will match any page in the domain of <span class=
547               "QUOTE">"example.com"</span> that is named <span class=
548               "QUOTE">"index.html"</span>, and that is part of some path. For
549               example, it matches <span class=
550               "QUOTE">"www.example.com/testing/index.html"</span> but NOT
551               <span class="QUOTE">"www.example.com/index.html"</span> because
552               the regular expression called for at least two <span class=
553               "QUOTE">"/'s"</span>, thus the path requirement. It also would
554               match <span class=
555               "QUOTE">"www.example.com/testing/index_html"</span>, because of
556               the special meta-character <span class="QUOTE">"."</span>.</p>
557             </dd>
558             <dt><tt class="LITERAL">.example.com/(.*/)?index\.html$</tt></dt>
559             <dd>
560               <p>This regular expression is conditional so it will match any
561               page named <span class="QUOTE">"index.html"</span> regardless
562               of path which in this case can have one or more <span class=
563               "QUOTE">"/'s"</span>. And this one must contain exactly
564               <span class="QUOTE">".html"</span> (but does not have to end
565               with that!).</p>
566             </dd>
567             <dt><tt class=
568             "LITERAL">.example.com/(.*/)(ads|banners?|junk)</tt></dt>
569             <dd>
570               <p>This regular expression will match any path of <span class=
571               "QUOTE">"example.com"</span> that contains any of the words
572               <span class="QUOTE">"ads"</span>, <span class=
573               "QUOTE">"banner"</span>, <span class="QUOTE">"banners"</span>
574               (because of the <span class="QUOTE">"?"</span>) or <span class=
575               "QUOTE">"junk"</span>. The path does not have to end in these
576               words, just contain them.</p>
577             </dd>
578             <dt><tt class=
579             "LITERAL">.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</tt></dt>
580             <dd>
581               <p>This is very much the same as above, except now it must end
582               in either <span class="QUOTE">".jpg"</span>, <span class=
583               "QUOTE">".jpeg"</span>, <span class="QUOTE">".gif"</span> or
584               <span class="QUOTE">".png"</span>. So this one is limited to
585               common image formats.</p>
586             </dd>
587           </dl>
588         </div>
589         <p>There are many, many good examples to be found in <tt class=
590         "FILENAME">default.action</tt>, and more tutorials below in <a href=
591         "appendix.html#REGEX">Appendix on regular expressions</a>.</p>
592       </div>
593       <div class="SECT3">
594         <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The
595         Request Tag Pattern</a></h3>
596         <p>Request tag patterns are used to change the applying actions based
597         on the request's tags. Tags can be created based on HTTP headers with
598         either the <a href=
599         "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or
600         the <a href=
601         "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
602         action.</p>
603         <p>Request tag patterns have to start with <span class=
604         "QUOTE">"TAG:"</span>, so <span class="APPLICATION">Privoxy</span>
605         can tell them apart from other patterns. Everything after the colon
606         including white space, is interpreted as a regular expression with
607         path pattern syntax, except that tag patterns aren't left-anchored
608         automatically (<span class="APPLICATION">Privoxy</span> doesn't
609         silently add a <span class="QUOTE">"^"</span>, you have to do it
610         yourself if you need it).</p>
611         <p>To match all requests that are tagged with <span class=
612         "QUOTE">"foo"</span> your pattern line should be <span class=
613         "QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span>
614         would work as well, but it would also match requests whose tags
615         contain <span class="QUOTE">"foo"</span> somewhere. <span class=
616         "QUOTE">"TAG: foo"</span> wouldn't work as it requires white
617         space.</p>
618         <p>Sections can contain URL and request tag patterns at the same
619         time, but request tag patterns are checked after the URL patterns and
620         thus always overrule them, even if they are located before the URL
621         patterns.</p>
622         <p>Once a new request tag is added, Privoxy checks right away if it's
623         matched by one of the request tag patterns and updates the action
624         settings accordingly. As a result request tags can be used to
625         activate other tagger actions, as long as these other taggers look
626         for headers that haven't already be parsed.</p>
627         <p>For example you could tag client requests which use the <tt class=
628         "LITERAL">POST</tt> method, then use this tag to activate another
629         tagger that adds a tag if cookies are sent, and then use a block
630         action based on the cookie tag. This allows the outcome of one
631         action, to be input into a subsequent action. However if you'd
632         reverse the position of the described taggers, and activated the
633         method tagger based on the cookie tagger, no method tags would be
634         created. The method tagger would look for the request line, but at
635         the time the cookie tag is created, the request line has already been
636         parsed.</p>
637         <p>While this is a limitation you should be aware of, this kind of
638         indirection is seldom needed anyway and even the example doesn't make
639         too much sense.</p>
640       </div>
641       <div class="SECT3">
642         <h3 class="SECT3"><a name="NEGATIVE-TAG-PATTERNS" id=
643         "NEGATIVE-TAG-PATTERNS">8.4.4. The Negative Request Tag
644         Patterns</a></h3>
645         <p>To match requests that do not have a certain request tag, specify
646         a negative tag pattern by prefixing the tag pattern line with either
647         <span class="QUOTE">"NO-REQUEST-TAG:"</span> or <span class=
648         "QUOTE">"NO-RESPONSE-TAG:"</span> instead of <span class=
649         "QUOTE">"TAG:"</span>.</p>
650         <p>Negative request tag patterns created with <span class=
651         "QUOTE">"NO-REQUEST-TAG:"</span> are checked after all client headers
652         are scanned, the ones created with <span class=
653         "QUOTE">"NO-RESPONSE-TAG:"</span> are checked after all server
654         headers are scanned. In both cases all the created tags are
655         considered.</p>
656       </div>
657       <div class="SECT3">
658         <h3 class="SECT3"><a name="CLIENT-TAG-PATTERN" id=
659         "CLIENT-TAG-PATTERN">8.4.5. The Client Tag Pattern</a></h3>
660         <div class="WARNING">
661           <table class="WARNING" border="1" width="100%">
662             <tr>
663               <td align="center"><b>Warning</b></td>
664             </tr>
665             <tr>
666               <td align="left">
667                 <p>This is an experimental feature. The syntax is likely to
668                 change in future versions.</p>
669               </td>
670             </tr>
671           </table>
672         </div>
673         <p>Client tag patterns are not set based on HTTP headers but based on
674         the client's IP address. Users can enable them themselves, but the
675         Privoxy admin controls which tags are available and what their effect
676         is.</p>
677         <p>After a client-specific tag has been defined with the <a href=
678         "config.html#CLIENT-SPECIFIC-TAG">client-specific-tag</a>, directive,
679         action sections can be activated based on the tag by using a
680         CLIENT-TAG pattern. The CLIENT-TAG pattern is evaluated at the same
681         priority as URL patterns, as a result the last matching pattern wins.
682         Tags that are created based on client or server headers are evaluated
683         later on and can overrule CLIENT-TAG and URL patterns!</p>
684         <p>The tag is set for all requests that come from clients that
685         requested it to be set. Note that "clients" are differentiated by IP
686         address, if the IP address changes the tag has to be requested
687         again.</p>
688         <p>Clients can request tags to be set by using the CGI interface
689         <a href="http://config.privoxy.org/client-tags" target=
690         "_top">http://config.privoxy.org/client-tags</a>.</p>
691         <p>Example:</p>
692         <table border="0" bgcolor="#E0E0E0" width="100%">
693           <tr>
694             <td>
695               <pre class="SCREEN">
696               # If the admin defined the client-specific-tag circumvent-blocks,
697 # and the request comes from a client that previously requested
698 # the tag to be set, overrule all previous +block actions that
699 # are enabled based on URL to CLIENT-TAG patterns.
700 {-block}
701 CLIENT-TAG:^circumvent-blocks$
702
703 # This section is not overruled because it's located after
704 # the previous one.
705 {+block{Nobody is supposed to request this.}}
706 example.org/blocked-example-page</pre>
707             </td>
708           </tr>
709         </table>
710       </div>
711     </div>
712     <div class="SECT2">
713       <h2 class="SECT2"><a name="ACTIONS" id="ACTIONS">8.5. Actions</a></h2>
714       <p>All actions are disabled by default, until they are explicitly
715       enabled somewhere in an actions file. Actions are turned on if preceded
716       with a <span class="QUOTE">"+"</span>, and turned off if preceded with
717       a <span class="QUOTE">"-"</span>. So a <tt class="LITERAL">+action</tt>
718       means <span class="QUOTE">"do that action"</span>, e.g. <tt class=
719       "LITERAL">+block</tt> means <span class="QUOTE">"please block URLs that
720       match the following patterns"</span>, and <tt class=
721       "LITERAL">-block</tt> means <span class="QUOTE">"don't block URLs that
722       match the following patterns, even if <tt class="LITERAL">+block</tt>
723       previously applied."</span></p>
724       <p>Again, actions are invoked by placing them on a line, enclosed in
725       curly braces and separated by whitespace, like in <tt class=
726       "LITERAL">{+some-action -some-other-action{some-parameter}}</tt>,
727       followed by a list of URL patterns, one per line, to which they apply.
728       Together, the actions line and the following pattern lines make up a
729       section of the actions file.</p>
730       <p>Actions fall into three categories:</p>
731       <ul>
732         <li>
733           <p>Boolean, i.e the action can only be <span class=
734           "QUOTE">"enabled"</span> or <span class="QUOTE">"disabled"</span>.
735           Syntax:</p>
736           <table border="0" bgcolor="#E0E0E0" width="90%">
737             <tr>
738               <td>
739                 <pre class="SCREEN">  +<tt class=
740                 "REPLACEABLE"><i>name</i></tt>        # enable action <tt class=
741                 "REPLACEABLE"><i>name</i></tt>
742   -<tt class=
743 "REPLACEABLE"><i>name</i></tt>        # disable action <tt class="REPLACEABLE"><i>name</i></tt></pre>
744               </td>
745             </tr>
746           </table>
747           <p>Example: <tt class="LITERAL">+handle-as-image</tt></p>
748         </li>
749         <li>
750           <p>Parameterized, where some value is required in order to enable
751           this type of action. Syntax:</p>
752           <table border="0" bgcolor="#E0E0E0" width="90%">
753             <tr>
754               <td>
755                 <pre class="SCREEN">  +<tt class=
756                 "REPLACEABLE"><i>name</i></tt>{<tt class=
757                 "REPLACEABLE"><i>param</i></tt>}  # enable action and set parameter to <tt class="REPLACEABLE"><i>param</i></tt>,
758                # overwriting parameter from previous match if necessary
759   -<tt class=
760 "REPLACEABLE"><i>name</i></tt>         # disable action. The parameter can be omitted</pre>
761               </td>
762             </tr>
763           </table>
764           <p>Note that if the URL matches multiple positive forms of a
765           parameterized action, the last match wins, i.e. the params from
766           earlier matches are simply ignored.</p>
767           <p>Example: <tt class="LITERAL">+hide-user-agent{Mozilla/5.0 (X11;
768           U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602
769           Firefox/2.0.0.4}</tt></p>
770         </li>
771         <li>
772           <p>Multi-value. These look exactly like parameterized actions, but
773           they behave differently: If the action applies multiple times to
774           the same URL, but with different parameters, <span class=
775           "emphasis"><i class="EMPHASIS">all</i></span> the parameters from
776           <span class="emphasis"><i class="EMPHASIS">all</i></span> matches
777           are remembered. This is used for actions that can be executed for
778           the same request repeatedly, like adding multiple headers, or
779           filtering through multiple filters. Syntax:</p>
780           <table border="0" bgcolor="#E0E0E0" width="90%">
781             <tr>
782               <td>
783                 <pre class="SCREEN">  +<tt class=
784                 "REPLACEABLE"><i>name</i></tt>{<tt class=
785                 "REPLACEABLE"><i>param</i></tt>}   # enable action and add <tt class=
786                 "REPLACEABLE"><i>param</i></tt> to the list of parameters
787   -<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
788 "REPLACEABLE"><i>param</i></tt>}   # remove the parameter <tt class=
789 "REPLACEABLE"><i>param</i></tt> from the list of parameters
790                 # If it was the last one left, disable the action.
791   <tt class=
792 "REPLACEABLE"><i>-name</i></tt>          # disable this action completely and remove all parameters from the list</pre>
793               </td>
794             </tr>
795           </table>
796           <p>Examples: <tt class="LITERAL">+add-header{X-Fun-Header: Some
797           text}</tt> and <tt class=
798           "LITERAL">+filter{html-annoyances}</tt></p>
799         </li>
800       </ul>
801       <p>If nothing is specified in any actions file, no <span class=
802       "QUOTE">"actions"</span> are taken. So in this case <span class=
803       "APPLICATION">Privoxy</span> would just be a normal, non-blocking,
804       non-filtering proxy. You must specifically enable the privacy and
805       blocking features you need (although the provided default actions files
806       will give a good starting point).</p>
807       <p>Later defined action sections always over-ride earlier ones of the
808       same type. So exceptions to any rules you make, should come in the
809       latter part of the file (or in a file that is processed later when
810       using multiple actions files such as <tt class=
811       "FILENAME">user.action</tt>). For multi-valued actions, the actions are
812       applied in the order they are specified. Actions files are processed in
813       the order they are defined in <tt class="FILENAME">config</tt> (the
814       default installation has three actions files). It also quite possible
815       for any given URL to match more than one <span class=
816       "QUOTE">"pattern"</span> (because of wildcards and regular
817       expressions), and thus to trigger more than one set of actions! Last
818       match wins.</p>
819       <p>The list of valid <span class="APPLICATION">Privoxy</span> actions
820       are:</p>
821       <div class="SECT3">
822         <h4 class="SECT3"><a name="ADD-HEADER" id="ADD-HEADER">8.5.1.
823         add-header</a></h4>
824         <div class="VARIABLELIST">
825           <dl>
826             <dt>Typical use:</dt>
827             <dd>
828               <p>Confuse log analysis, custom applications</p>
829             </dd>
830             <dt>Effect:</dt>
831             <dd>
832               <p>Sends a user defined HTTP header to the web server.</p>
833             </dd>
834             <dt>Type:</dt>
835             <dd>
836               <p>Multi-value.</p>
837             </dd>
838             <dt>Parameter:</dt>
839             <dd>
840               <p>Any string value is possible. Validity of the defined HTTP
841               headers is not checked. It is recommended that you use the
842               <span class="QUOTE">"<tt class="LITERAL">X-</tt>"</span> prefix
843               for custom headers.</p>
844             </dd>
845             <dt>Notes:</dt>
846             <dd>
847               <p>This action may be specified multiple times, in order to
848               define multiple headers. This is rarely needed for the typical
849               user. If you don't know what <span class="QUOTE">"HTTP
850               headers"</span> are, you definitely don't need to worry about
851               this one.</p>
852               <p>Headers added by this action are not modified by other
853               actions.</p>
854             </dd>
855             <dt>Example usage:</dt>
856             <dd>
857               <table border="0" bgcolor="#E0E0E0" width="90%">
858                 <tr>
859                   <td>
860                     <pre class="SCREEN">
861                     # Add a DNT ("Do not track") header to all requests,
862 # event to those that already have one.
863 #
864 # This is just an example, not a recommendation.
865 #
866 # There is no reason to believe that user-tracking websites care
867 # about the DNT header and depending on the User-Agent, adding the
868 # header may make user-tracking easier.
869 {+add-header{DNT: 1}}
870 /</pre>
871                   </td>
872                 </tr>
873               </table>
874             </dd>
875           </dl>
876         </div>
877       </div>
878       <div class="SECT3">
879         <h4 class="SECT3"><a name="BLOCK" id="BLOCK">8.5.2. block</a></h4>
880         <div class="VARIABLELIST">
881           <dl>
882             <dt>Typical use:</dt>
883             <dd>
884               <p>Block ads or other unwanted content</p>
885             </dd>
886             <dt>Effect:</dt>
887             <dd>
888               <p>Requests for URLs to which this action applies are blocked,
889               i.e. the requests are trapped by <span class=
890               "APPLICATION">Privoxy</span> and the requested URL is never
891               retrieved, but is answered locally with a substitute page or
892               image, as determined by the <tt class="LITERAL"><a href=
893               "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
894               <tt class="LITERAL"><a href=
895               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>,
896               and <tt class="LITERAL"><a href=
897               "actions-file.html#HANDLE-AS-EMPTY-DOCUMENT">handle-as-empty-document</a></tt>
898               actions.</p>
899             </dd>
900             <dt>Type:</dt>
901             <dd>
902               <p>Parameterized.</p>
903             </dd>
904             <dt>Parameter:</dt>
905             <dd>
906               <p>A block reason that should be given to the user.</p>
907             </dd>
908             <dt>Notes:</dt>
909             <dd>
910               <p><span class="APPLICATION">Privoxy</span> sends a special
911               <span class="QUOTE">"BLOCKED"</span> page for requests to
912               blocked pages. This page contains the block reason given as
913               parameter, a link to find out why the block action applies, and
914               a click-through to the blocked content (the latter only if the
915               force feature is available and enabled).</p>
916               <p>A very important exception occurs if <span class=
917               "emphasis"><i class="EMPHASIS">both</i></span> <tt class=
918               "LITERAL">block</tt> and <tt class="LITERAL"><a href=
919               "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
920               apply to the same request: it will then be replaced by an
921               image. If <tt class="LITERAL"><a href=
922               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
923               (see below) also applies, the type of image will be determined
924               by its parameter, if not, the standard checkerboard pattern is
925               sent.</p>
926               <p>It is important to understand this process, in order to
927               understand how <span class="APPLICATION">Privoxy</span> deals
928               with ads and other unwanted content. Blocking is a core
929               feature, and one upon which various other features depend.</p>
930               <p>The <tt class="LITERAL"><a href=
931               "actions-file.html#FILTER">filter</a></tt> action can perform a
932               very similar task, by <span class="QUOTE">"blocking"</span>
933               banner images and other content through rewriting the relevant
934               URLs in the document's HTML source, so they don't get requested
935               in the first place. Note that this is a totally different
936               technique, and it's easy to confuse the two.</p>
937             </dd>
938             <dt>Example usage (section):</dt>
939             <dd>
940               <table border="0" bgcolor="#E0E0E0" width="90%">
941                 <tr>
942                   <td>
943                     <pre class="SCREEN">{+block{No nasty stuff for you.}}
944 # Block and replace with "blocked" page
945  .nasty-stuff.example.com
946
947 {+block{Doubleclick banners.} +handle-as-image}
948 # Block and replace with image
949  .ad.doubleclick.net
950  .ads.r.us/banners/
951
952 {+block{Layered ads.} +handle-as-empty-document}
953 # Block and then ignore
954  adserver.example.net/.*\.js$</pre>
955                   </td>
956                 </tr>
957               </table>
958             </dd>
959           </dl>
960         </div>
961       </div>
962       <div class="SECT3">
963         <h4 class="SECT3"><a name="CHANGE-X-FORWARDED-FOR" id=
964         "CHANGE-X-FORWARDED-FOR">8.5.3. change-x-forwarded-for</a></h4>
965         <div class="VARIABLELIST">
966           <dl>
967             <dt>Typical use:</dt>
968             <dd>
969               <p>Improve privacy by not forwarding the source of the request
970               in the HTTP headers.</p>
971             </dd>
972             <dt>Effect:</dt>
973             <dd>
974               <p>Deletes the <span class="QUOTE">"X-Forwarded-For:"</span>
975               HTTP header from the client request, or adds a new one.</p>
976             </dd>
977             <dt>Type:</dt>
978             <dd>
979               <p>Parameterized.</p>
980             </dd>
981             <dt>Parameter:</dt>
982             <dd>
983               <ul>
984                 <li>
985                   <p><span class="QUOTE">"block"</span> to delete the
986                   header.</p>
987                 </li>
988                 <li>
989                   <p><span class="QUOTE">"add"</span> to create the header
990                   (or append the client's IP address to an already existing
991                   one).</p>
992                 </li>
993               </ul>
994             </dd>
995             <dt>Notes:</dt>
996             <dd>
997               <p>It is safe and recommended to use <tt class=
998               "LITERAL">block</tt>.</p>
999               <p>Forwarding the source address of the request may make sense
1000               in some multi-user setups but is also a privacy risk.</p>
1001             </dd>
1002             <dt>Example usage:</dt>
1003             <dd>
1004               <table border="0" bgcolor="#E0E0E0" width="90%">
1005                 <tr>
1006                   <td>
1007                     <pre class="SCREEN">+change-x-forwarded-for{block}</pre>
1008                   </td>
1009                 </tr>
1010               </table>
1011             </dd>
1012           </dl>
1013         </div>
1014       </div>
1015       <div class="SECT3">
1016         <h4 class="SECT3"><a name="CLIENT-HEADER-FILTER" id=
1017         "CLIENT-HEADER-FILTER">8.5.4. client-header-filter</a></h4>
1018         <div class="VARIABLELIST">
1019           <dl>
1020             <dt>Typical use:</dt>
1021             <dd>
1022               <p>Rewrite or remove single client headers.</p>
1023             </dd>
1024             <dt>Effect:</dt>
1025             <dd>
1026               <p>All client headers to which this action applies are filtered
1027               on-the-fly through the specified regular expression based
1028               substitutions.</p>
1029             </dd>
1030             <dt>Type:</dt>
1031             <dd>
1032               <p>Multi-value.</p>
1033             </dd>
1034             <dt>Parameter:</dt>
1035             <dd>
1036               <p>The name of a client-header filter, as defined in one of the
1037               <a href="filter-file.html">filter files</a>.</p>
1038             </dd>
1039             <dt>Notes:</dt>
1040             <dd>
1041               <p>Client-header filters are applied to each header on its own,
1042               not to all at once. This makes it easier to diagnose problems,
1043               but on the downside you can't write filters that only change
1044               header x if header y's value is z. You can do that by using
1045               tags though.</p>
1046               <p>Client-header filters are executed after the other header
1047               actions have finished and use their output as input.</p>
1048               <p>If the request URI gets changed, <span class=
1049               "APPLICATION">Privoxy</span> will detect that and use the new
1050               one. This can be used to rewrite the request destination behind
1051               the client's back, for example to specify a Tor exit relay for
1052               certain requests.</p>
1053               <p>Please refer to the <a href="filter-file.html">filter file
1054               chapter</a> to learn which client-header filters are available
1055               by default, and how to create your own.</p>
1056             </dd>
1057             <dt>Example usage (section):</dt>
1058             <dd>
1059               <table border="0" bgcolor="#E0E0E0" width="90%">
1060                 <tr>
1061                   <td>
1062                     <pre class="SCREEN">
1063                     # Hide Tor exit notation in Host and Referer Headers
1064 {+client-header-filter{hide-tor-exit-notation}}
1065 /
1066     </pre>
1067                   </td>
1068                 </tr>
1069               </table>
1070             </dd>
1071           </dl>
1072         </div>
1073       </div>
1074       <div class="SECT3">
1075         <h4 class="SECT3"><a name="CLIENT-HEADER-TAGGER" id=
1076         "CLIENT-HEADER-TAGGER">8.5.5. client-header-tagger</a></h4>
1077         <div class="VARIABLELIST">
1078           <dl>
1079             <dt>Typical use:</dt>
1080             <dd>
1081               <p>Block requests based on their headers.</p>
1082             </dd>
1083             <dt>Effect:</dt>
1084             <dd>
1085               <p>Client headers to which this action applies are filtered
1086               on-the-fly through the specified regular expression based
1087               substitutions, the result is used as tag.</p>
1088             </dd>
1089             <dt>Type:</dt>
1090             <dd>
1091               <p>Multi-value.</p>
1092             </dd>
1093             <dt>Parameter:</dt>
1094             <dd>
1095               <p>The name of a client-header tagger, as defined in one of the
1096               <a href="filter-file.html">filter files</a>.</p>
1097             </dd>
1098             <dt>Notes:</dt>
1099             <dd>
1100               <p>Client-header taggers are applied to each header on its own,
1101               and as the header isn't modified, each tagger <span class=
1102               "QUOTE">"sees"</span> the original.</p>
1103               <p>Client-header taggers are the first actions that are
1104               executed and their tags can be used to control every other
1105               action.</p>
1106             </dd>
1107             <dt>Example usage (section):</dt>
1108             <dd>
1109               <table border="0" bgcolor="#E0E0E0" width="90%">
1110                 <tr>
1111                   <td>
1112                     <pre class="SCREEN">
1113                     # Tag every request with the User-Agent header
1114 {+client-header-tagger{user-agent}}
1115 /
1116
1117 # Tagging itself doesn't change the action
1118 # settings, sections with TAG patterns do:
1119 #
1120 # If it's a download agent, use a different forwarding proxy,
1121 # show the real User-Agent and make sure resume works.
1122 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
1123  -hide-if-modified-since      \
1124  -overwrite-last-modified     \
1125  -hide-user-agent             \
1126  -filter                      \
1127  -deanimate-gifs              \
1128 }
1129 TAG:^User-Agent: NetBSD-ftp/
1130 TAG:^User-Agent: Novell ZYPP Installer
1131 TAG:^User-Agent: RPM APT-HTTP/
1132 TAG:^User-Agent: fetch libfetch/
1133 TAG:^User-Agent: Ubuntu APT-HTTP/
1134 TAG:^User-Agent: MPlayer/
1135     </pre>
1136                   </td>
1137                 </tr>
1138               </table>
1139               <table border="0" bgcolor="#E0E0E0" width="90%">
1140                 <tr>
1141                   <td>
1142                     <pre class="SCREEN">
1143                     # Tag all requests with the Range header set
1144 {+client-header-tagger{range-requests}}
1145 /
1146
1147 # Disable filtering for the tagged requests.
1148 #
1149 # With filtering enabled Privoxy would remove the Range headers
1150 # to be able to filter the whole response. The downside is that
1151 # it prevents clients from resuming downloads or skipping over
1152 # parts of multimedia files.
1153 {-filter -deanimate-gifs}
1154 TAG:^RANGE-REQUEST$
1155     </pre>
1156                   </td>
1157                 </tr>
1158               </table>
1159             </dd>
1160           </dl>
1161         </div>
1162       </div>
1163       <div class="SECT3">
1164         <h4 class="SECT3"><a name="CONTENT-TYPE-OVERWRITE" id=
1165         "CONTENT-TYPE-OVERWRITE">8.5.6. content-type-overwrite</a></h4>
1166         <div class="VARIABLELIST">
1167           <dl>
1168             <dt>Typical use:</dt>
1169             <dd>
1170               <p>Stop useless download menus from popping up, or change the
1171               browser's rendering mode</p>
1172             </dd>
1173             <dt>Effect:</dt>
1174             <dd>
1175               <p>Replaces the <span class="QUOTE">"Content-Type:"</span> HTTP
1176               server header.</p>
1177             </dd>
1178             <dt>Type:</dt>
1179             <dd>
1180               <p>Parameterized.</p>
1181             </dd>
1182             <dt>Parameter:</dt>
1183             <dd>
1184               <p>Any string.</p>
1185             </dd>
1186             <dt>Notes:</dt>
1187             <dd>
1188               <p>The <span class="QUOTE">"Content-Type:"</span> HTTP server
1189               header is used by the browser to decide what to do with the
1190               document. The value of this header can cause the browser to
1191               open a download menu instead of displaying the document by
1192               itself, even if the document's format is supported by the
1193               browser.</p>
1194               <p>The declared content type can also affect which rendering
1195               mode the browser chooses. If XHTML is delivered as <span class=
1196               "QUOTE">"text/html"</span>, many browsers treat it as yet
1197               another broken HTML document. If it is send as <span class=
1198               "QUOTE">"application/xml"</span>, browsers with XHTML support
1199               will only display it, if the syntax is correct.</p>
1200               <p>If you see a web site that proudly uses XHTML buttons, but
1201               sets <span class="QUOTE">"Content-Type: text/html"</span>, you
1202               can use <span class="APPLICATION">Privoxy</span> to overwrite
1203               it with <span class="QUOTE">"application/xml"</span> and
1204               validate the web master's claim inside your XHTML-supporting
1205               browser. If the syntax is incorrect, the browser will complain
1206               loudly.</p>
1207               <p>You can also go the opposite direction: if your browser
1208               prints error messages instead of rendering a document falsely
1209               declared as XHTML, you can overwrite the content type with
1210               <span class="QUOTE">"text/html"</span> and have it rendered as
1211               broken HTML document.</p>
1212               <p>By default <tt class="LITERAL">content-type-overwrite</tt>
1213               only replaces <span class="QUOTE">"Content-Type:"</span>
1214               headers that look like some kind of text. If you want to
1215               overwrite it unconditionally, you have to combine it with
1216               <tt class="LITERAL"><a href=
1217               "actions-file.html#FORCE-TEXT-MODE">force-text-mode</a></tt>.
1218               This limitation exists for a reason, think twice before
1219               circumventing it.</p>
1220               <p>Most of the time it's easier to replace this action with a
1221               custom <tt class="LITERAL"><a href=
1222               "actions-file.html#SERVER-HEADER-FILTER">server-header
1223               filter</a></tt>. It allows you to activate it for every
1224               document of a certain site and it will still only replace the
1225               content types you aimed at.</p>
1226               <p>Of course you can apply <tt class=
1227               "LITERAL">content-type-overwrite</tt> to a whole site and then
1228               make URL based exceptions, but it's a lot more work to get the
1229               same precision.</p>
1230             </dd>
1231             <dt>Example usage (sections):</dt>
1232             <dd>
1233               <table border="0" bgcolor="#E0E0E0" width="90%">
1234                 <tr>
1235                   <td>
1236                     <pre class="SCREEN">
1237                     # Check if www.example.net/ really uses valid XHTML
1238 { +content-type-overwrite{application/xml} }
1239 www.example.net/
1240
1241 # but leave the content type unmodified if the URL looks like a style sheet
1242 {-content-type-overwrite}
1243 www.example.net/.*\.css$
1244 www.example.net/.*style</pre>
1245                   </td>
1246                 </tr>
1247               </table>
1248             </dd>
1249           </dl>
1250         </div>
1251       </div>
1252       <div class="SECT3">
1253         <h4 class="SECT3"><a name="CRUNCH-CLIENT-HEADER" id=
1254         "CRUNCH-CLIENT-HEADER">8.5.7. crunch-client-header</a></h4>
1255         <div class="VARIABLELIST">
1256           <dl>
1257             <dt>Typical use:</dt>
1258             <dd>
1259               <p>Remove a client header <span class=
1260               "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1261             </dd>
1262             <dt>Effect:</dt>
1263             <dd>
1264               <p>Deletes every header sent by the client that contains the
1265               string the user supplied as parameter.</p>
1266             </dd>
1267             <dt>Type:</dt>
1268             <dd>
1269               <p>Parameterized.</p>
1270             </dd>
1271             <dt>Parameter:</dt>
1272             <dd>
1273               <p>Any string.</p>
1274             </dd>
1275             <dt>Notes:</dt>
1276             <dd>
1277               <p>This action allows you to block client headers for which no
1278               dedicated <span class="APPLICATION">Privoxy</span> action
1279               exists. <span class="APPLICATION">Privoxy</span> will remove
1280               every client header that contains the string you supplied as
1281               parameter.</p>
1282               <p>Regular expressions are <span class="emphasis"><i class=
1283               "EMPHASIS">not supported</i></span> and you can't use this
1284               action to block different headers in the same request, unless
1285               they contain the same string.</p>
1286               <p><tt class="LITERAL">crunch-client-header</tt> is only meant
1287               for quick tests. If you have to block several different
1288               headers, or only want to modify parts of them, you should use a
1289               <tt class="LITERAL"><a href=
1290               "actions-file.html#CLIENT-HEADER-FILTER">client-header
1291               filter</a></tt>.</p>
1292               <div class="WARNING">
1293                 <table class="WARNING" border="1" width="90%">
1294                   <tr>
1295                     <td align="center"><b>Warning</b></td>
1296                   </tr>
1297                   <tr>
1298                     <td align="left">
1299                       <p>Don't block any header without understanding the
1300                       consequences.</p>
1301                     </td>
1302                   </tr>
1303                 </table>
1304               </div>
1305             </dd>
1306             <dt>Example usage (section):</dt>
1307             <dd>
1308               <table border="0" bgcolor="#E0E0E0" width="90%">
1309                 <tr>
1310                   <td>
1311                     <pre class="SCREEN">
1312                     # Block the non-existent "Privacy-Violation:" client header
1313 { +crunch-client-header{Privacy-Violation:} }
1314 /
1315     </pre>
1316                   </td>
1317                 </tr>
1318               </table>
1319             </dd>
1320           </dl>
1321         </div>
1322       </div>
1323       <div class="SECT3">
1324         <h4 class="SECT3"><a name="CRUNCH-IF-NONE-MATCH" id=
1325         "CRUNCH-IF-NONE-MATCH">8.5.8. crunch-if-none-match</a></h4>
1326         <div class="VARIABLELIST">
1327           <dl>
1328             <dt>Typical use:</dt>
1329             <dd>
1330               <p>Prevent yet another way to track the user's steps between
1331               sessions.</p>
1332             </dd>
1333             <dt>Effect:</dt>
1334             <dd>
1335               <p>Deletes the <span class="QUOTE">"If-None-Match:"</span> HTTP
1336               client header.</p>
1337             </dd>
1338             <dt>Type:</dt>
1339             <dd>
1340               <p>Boolean.</p>
1341             </dd>
1342             <dt>Parameter:</dt>
1343             <dd>
1344               <p>N/A</p>
1345             </dd>
1346             <dt>Notes:</dt>
1347             <dd>
1348               <p>Removing the <span class="QUOTE">"If-None-Match:"</span>
1349               HTTP client header is useful for filter testing, where you want
1350               to force a real reload instead of getting status code
1351               <span class="QUOTE">"304"</span> which would cause the browser
1352               to use a cached copy of the page.</p>
1353               <p>It is also useful to make sure the header isn't used as a
1354               cookie replacement (unlikely but possible).</p>
1355               <p>Blocking the <span class="QUOTE">"If-None-Match:"</span>
1356               header shouldn't cause any caching problems, as long as the
1357               <span class="QUOTE">"If-Modified-Since:"</span> header isn't
1358               blocked or missing as well.</p>
1359               <p>It is recommended to use this action together with
1360               <tt class="LITERAL"><a href=
1361               "actions-file.html#HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</a></tt>
1362               and <tt class="LITERAL"><a href=
1363               "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>.</p>
1364             </dd>
1365             <dt>Example usage (section):</dt>
1366             <dd>
1367               <table border="0" bgcolor="#E0E0E0" width="90%">
1368                 <tr>
1369                   <td>
1370                     <pre class="SCREEN">
1371                     # Let the browser revalidate cached documents but don't
1372 # allow the server to use the revalidation headers for user tracking.
1373 {+hide-if-modified-since{-60} \
1374  +overwrite-last-modified{randomize} \
1375  +crunch-if-none-match}
1376 /   </pre>
1377                   </td>
1378                 </tr>
1379               </table>
1380             </dd>
1381           </dl>
1382         </div>
1383       </div>
1384       <div class="SECT3">
1385         <h4 class="SECT3"><a name="CRUNCH-INCOMING-COOKIES" id=
1386         "CRUNCH-INCOMING-COOKIES">8.5.9. crunch-incoming-cookies</a></h4>
1387         <div class="VARIABLELIST">
1388           <dl>
1389             <dt>Typical use:</dt>
1390             <dd>
1391               <p>Prevent the web server from setting HTTP cookies on your
1392               system</p>
1393             </dd>
1394             <dt>Effect:</dt>
1395             <dd>
1396               <p>Deletes any <span class="QUOTE">"Set-Cookie:"</span> HTTP
1397               headers from server replies.</p>
1398             </dd>
1399             <dt>Type:</dt>
1400             <dd>
1401               <p>Boolean.</p>
1402             </dd>
1403             <dt>Parameter:</dt>
1404             <dd>
1405               <p>N/A</p>
1406             </dd>
1407             <dt>Notes:</dt>
1408             <dd>
1409               <p>This action is only concerned with <span class=
1410               "emphasis"><i class="EMPHASIS">incoming</i></span> HTTP
1411               cookies. For <span class="emphasis"><i class=
1412               "EMPHASIS">outgoing</i></span> HTTP cookies, use <tt class=
1413               "LITERAL"><a href=
1414               "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>.
1415               Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1416               to disable HTTP cookies completely.</p>
1417               <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1418               at all</i></span> to use this action in conjunction with the
1419               <tt class="LITERAL"><a href=
1420               "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1421               action, since it would prevent the session cookies from being
1422               set. See also <tt class="LITERAL"><a href=
1423               "actions-file.html#FILTER-CONTENT-COOKIES">filter-content-cookies</a></tt>.</p>
1424             </dd>
1425             <dt>Example usage:</dt>
1426             <dd>
1427               <table border="0" bgcolor="#E0E0E0" width="90%">
1428                 <tr>
1429                   <td>
1430                     <pre class="SCREEN">+crunch-incoming-cookies</pre>
1431                   </td>
1432                 </tr>
1433               </table>
1434             </dd>
1435           </dl>
1436         </div>
1437       </div>
1438       <div class="SECT3">
1439         <h4 class="SECT3"><a name="CRUNCH-SERVER-HEADER" id=
1440         "CRUNCH-SERVER-HEADER">8.5.10. crunch-server-header</a></h4>
1441         <div class="VARIABLELIST">
1442           <dl>
1443             <dt>Typical use:</dt>
1444             <dd>
1445               <p>Remove a server header <span class=
1446               "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1447             </dd>
1448             <dt>Effect:</dt>
1449             <dd>
1450               <p>Deletes every header sent by the server that contains the
1451               string the user supplied as parameter.</p>
1452             </dd>
1453             <dt>Type:</dt>
1454             <dd>
1455               <p>Parameterized.</p>
1456             </dd>
1457             <dt>Parameter:</dt>
1458             <dd>
1459               <p>Any string.</p>
1460             </dd>
1461             <dt>Notes:</dt>
1462             <dd>
1463               <p>This action allows you to block server headers for which no
1464               dedicated <span class="APPLICATION">Privoxy</span> action
1465               exists. <span class="APPLICATION">Privoxy</span> will remove
1466               every server header that contains the string you supplied as
1467               parameter.</p>
1468               <p>Regular expressions are <span class="emphasis"><i class=
1469               "EMPHASIS">not supported</i></span> and you can't use this
1470               action to block different headers in the same request, unless
1471               they contain the same string.</p>
1472               <p><tt class="LITERAL">crunch-server-header</tt> is only meant
1473               for quick tests. If you have to block several different
1474               headers, or only want to modify parts of them, you should use a
1475               custom <tt class="LITERAL"><a href=
1476               "actions-file.html#SERVER-HEADER-FILTER">server-header
1477               filter</a></tt>.</p>
1478               <div class="WARNING">
1479                 <table class="WARNING" border="1" width="90%">
1480                   <tr>
1481                     <td align="center"><b>Warning</b></td>
1482                   </tr>
1483                   <tr>
1484                     <td align="left">
1485                       <p>Don't block any header without understanding the
1486                       consequences.</p>
1487                     </td>
1488                   </tr>
1489                 </table>
1490               </div>
1491             </dd>
1492             <dt>Example usage (section):</dt>
1493             <dd>
1494               <table border="0" bgcolor="#E0E0E0" width="90%">
1495                 <tr>
1496                   <td>
1497                     <pre class="SCREEN">
1498                     # Crunch server headers that try to prevent caching
1499 { +crunch-server-header{no-cache} }
1500 /   </pre>
1501                   </td>
1502                 </tr>
1503               </table>
1504             </dd>
1505           </dl>
1506         </div>
1507       </div>
1508       <div class="SECT3">
1509         <h4 class="SECT3"><a name="CRUNCH-OUTGOING-COOKIES" id=
1510         "CRUNCH-OUTGOING-COOKIES">8.5.11. crunch-outgoing-cookies</a></h4>
1511         <div class="VARIABLELIST">
1512           <dl>
1513             <dt>Typical use:</dt>
1514             <dd>
1515               <p>Prevent the web server from reading any HTTP cookies from
1516               your system</p>
1517             </dd>
1518             <dt>Effect:</dt>
1519             <dd>
1520               <p>Deletes any <span class="QUOTE">"Cookie:"</span> HTTP
1521               headers from client requests.</p>
1522             </dd>
1523             <dt>Type:</dt>
1524             <dd>
1525               <p>Boolean.</p>
1526             </dd>
1527             <dt>Parameter:</dt>
1528             <dd>
1529               <p>N/A</p>
1530             </dd>
1531             <dt>Notes:</dt>
1532             <dd>
1533               <p>This action is only concerned with <span class=
1534               "emphasis"><i class="EMPHASIS">outgoing</i></span> HTTP
1535               cookies. For <span class="emphasis"><i class=
1536               "EMPHASIS">incoming</i></span> HTTP cookies, use <tt class=
1537               "LITERAL"><a href=
1538               "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>.
1539               Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1540               to disable HTTP cookies completely.</p>
1541               <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1542               at all</i></span> to use this action in conjunction with the
1543               <tt class="LITERAL"><a href=
1544               "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1545               action, since it would prevent the session cookies from being
1546               read.</p>
1547             </dd>
1548             <dt>Example usage:</dt>
1549             <dd>
1550               <table border="0" bgcolor="#E0E0E0" width="90%">
1551                 <tr>
1552                   <td>
1553                     <pre class="SCREEN">+crunch-outgoing-cookies</pre>
1554                   </td>
1555                 </tr>
1556               </table>
1557             </dd>
1558           </dl>
1559         </div>
1560       </div>
1561       <div class="SECT3">
1562         <h4 class="SECT3"><a name="DEANIMATE-GIFS" id=
1563         "DEANIMATE-GIFS">8.5.12. deanimate-gifs</a></h4>
1564         <div class="VARIABLELIST">
1565           <dl>
1566             <dt>Typical use:</dt>
1567             <dd>
1568               <p>Stop those annoying, distracting animated GIF images.</p>
1569             </dd>
1570             <dt>Effect:</dt>
1571             <dd>
1572               <p>De-animate GIF animations, i.e. reduce them to their first
1573               or last image.</p>
1574             </dd>
1575             <dt>Type:</dt>
1576             <dd>
1577               <p>Parameterized.</p>
1578             </dd>
1579             <dt>Parameter:</dt>
1580             <dd>
1581               <p><span class="QUOTE">"last"</span> or <span class=
1582               "QUOTE">"first"</span></p>
1583             </dd>
1584             <dt>Notes:</dt>
1585             <dd>
1586               <p>This will also shrink the images considerably (in bytes, not
1587               pixels!). If the option <span class="QUOTE">"first"</span> is
1588               given, the first frame of the animation is used as the
1589               replacement. If <span class="QUOTE">"last"</span> is given, the
1590               last frame of the animation is used instead, which probably
1591               makes more sense for most banner animations, but also has the
1592               risk of not showing the entire last frame (if it is only a
1593               delta to an earlier frame).</p>
1594               <p>You can safely use this action with patterns that will also
1595               match non-GIF objects, because no attempt will be made at
1596               anything that doesn't look like a GIF.</p>
1597             </dd>
1598             <dt>Example usage:</dt>
1599             <dd>
1600               <table border="0" bgcolor="#E0E0E0" width="90%">
1601                 <tr>
1602                   <td>
1603                     <pre class="SCREEN">+deanimate-gifs{last}</pre>
1604                   </td>
1605                 </tr>
1606               </table>
1607             </dd>
1608           </dl>
1609         </div>
1610       </div>
1611       <div class="SECT3">
1612         <h4 class="SECT3"><a name="DOWNGRADE-HTTP-VERSION" id=
1613         "DOWNGRADE-HTTP-VERSION">8.5.13. downgrade-http-version</a></h4>
1614         <div class="VARIABLELIST">
1615           <dl>
1616             <dt>Typical use:</dt>
1617             <dd>
1618               <p>Work around (very rare) problems with HTTP/1.1</p>
1619             </dd>
1620             <dt>Effect:</dt>
1621             <dd>
1622               <p>Downgrades HTTP/1.1 client requests and server replies to
1623               HTTP/1.0.</p>
1624             </dd>
1625             <dt>Type:</dt>
1626             <dd>
1627               <p>Boolean.</p>
1628             </dd>
1629             <dt>Parameter:</dt>
1630             <dd>
1631               <p>N/A</p>
1632             </dd>
1633             <dt>Notes:</dt>
1634             <dd>
1635               <p>This is a left-over from the time when <span class=
1636               "APPLICATION">Privoxy</span> didn't support important HTTP/1.1
1637               features well. It is left here for the unlikely case that you
1638               experience HTTP/1.1-related problems with some server out
1639               there.</p>
1640               <p>Note that enabling this action is only a workaround. It
1641               should not be enabled for sites that work without it. While it
1642               shouldn't break any pages, it has an (usually negative)
1643               performance impact.</p>
1644               <p>If you come across a site where enabling this action helps,
1645               please report it, so the cause of the problem can be analyzed.
1646               If the problem turns out to be caused by a bug in <span class=
1647               "APPLICATION">Privoxy</span> it should be fixed so the
1648               following release works without the work around.</p>
1649             </dd>
1650             <dt>Example usage (section):</dt>
1651             <dd>
1652               <table border="0" bgcolor="#E0E0E0" width="90%">
1653                 <tr>
1654                   <td>
1655                     <pre class="SCREEN">{+downgrade-http-version}
1656 problem-host.example.com</pre>
1657                   </td>
1658                 </tr>
1659               </table>
1660             </dd>
1661           </dl>
1662         </div>
1663       </div>
1664       <div class="SECT3">
1665         <h4 class="SECT3"><a name="EXTERNAL-FILTER" id=
1666         "EXTERNAL-FILTER">8.5.14. external-filter</a></h4>
1667         <div class="VARIABLELIST">
1668           <dl>
1669             <dt>Typical use:</dt>
1670             <dd>
1671               <p>Modify content using a programming language of your
1672               choice.</p>
1673             </dd>
1674             <dt>Effect:</dt>
1675             <dd>
1676               <p>All instances of text-based type, most notably HTML and
1677               JavaScript, to which this action applies, can be filtered
1678               on-the-fly through the specified external filter. By default
1679               plain text documents are exempted from filtering, because web
1680               servers often use the <tt class="LITERAL">text/plain</tt> MIME
1681               type for all files whose type they don't know.)</p>
1682             </dd>
1683             <dt>Type:</dt>
1684             <dd>
1685               <p>Multi-value.</p>
1686             </dd>
1687             <dt>Parameter:</dt>
1688             <dd>
1689               <p>The name of an external content filter, as defined in the
1690               <a href="filter-file.html">filter file</a>. External filters
1691               can be defined in one or more files as defined by the
1692               <tt class="LITERAL"><a href=
1693               "config.html#FILTERFILE">filterfile</a></tt> option in the
1694               <a href="config.html">config file</a>.</p>
1695               <p>When used in its negative form, and without parameters,
1696               <span class="emphasis"><i class="EMPHASIS">all</i></span>
1697               filtering with external filters is completely disabled.</p>
1698             </dd>
1699             <dt>Notes:</dt>
1700             <dd>
1701               <p>External filters are scripts or programs that can modify the
1702               content in case common <tt class="LITERAL"><a href=
1703               "actions-file.html#FILTER">filters</a></tt> aren't powerful
1704               enough. With the exception that this action doesn't use
1705               pcrs-based filters, the notes in the <tt class=
1706               "LITERAL"><a href="actions-file.html#FILTER">filter</a></tt>
1707               section apply.</p>
1708               <div class="WARNING">
1709                 <table class="WARNING" border="1" width="90%">
1710                   <tr>
1711                     <td align="center"><b>Warning</b></td>
1712                   </tr>
1713                   <tr>
1714                     <td align="left">
1715                       <p>Currently external filters are executed with
1716                       <span class="APPLICATION">Privoxy</span>'s privileges.
1717                       Only use external filters you understand and trust.</p>
1718                     </td>
1719                   </tr>
1720                 </table>
1721               </div>
1722               <p>This feature is experimental, the <tt class=
1723               "LITERAL"><a href=
1724               "filter-file.html#EXTERNAL-FILTER-SYNTAX">syntax</a></tt> may
1725               change in the future.</p>
1726             </dd>
1727             <dt>Example usage:</dt>
1728             <dd>
1729               <table border="0" bgcolor="#E0E0E0" width="90%">
1730                 <tr>
1731                   <td>
1732                     <pre class="SCREEN">+external-filter{fancy-filter}</pre>
1733                   </td>
1734                 </tr>
1735               </table>
1736             </dd>
1737           </dl>
1738         </div>
1739       </div>
1740       <div class="SECT3">
1741         <h4 class="SECT3"><a name="FAST-REDIRECTS" id=
1742         "FAST-REDIRECTS">8.5.15. fast-redirects</a></h4>
1743         <div class="VARIABLELIST">
1744           <dl>
1745             <dt>Typical use:</dt>
1746             <dd>
1747               <p>Fool some click-tracking scripts and speed up indirect
1748               links.</p>
1749             </dd>
1750             <dt>Effect:</dt>
1751             <dd>
1752               <p>Detects redirection URLs and redirects the browser without
1753               contacting the redirection server first.</p>
1754             </dd>
1755             <dt>Type:</dt>
1756             <dd>
1757               <p>Parameterized.</p>
1758             </dd>
1759             <dt>Parameter:</dt>
1760             <dd>
1761               <ul>
1762                 <li>
1763                   <p><span class="QUOTE">"simple-check"</span> to just search
1764                   for the string <span class="QUOTE">"http://"</span> to
1765                   detect redirection URLs.</p>
1766                 </li>
1767                 <li>
1768                   <p><span class="QUOTE">"check-decoded-url"</span> to decode
1769                   URLs (if necessary) before searching for redirection
1770                   URLs.</p>
1771                 </li>
1772               </ul>
1773             </dd>
1774             <dt>Notes:</dt>
1775             <dd>
1776               <p>Many sites, like yahoo.com, don't just link to other sites.
1777               Instead, they will link to some script on their own servers,
1778               giving the destination as a parameter, which will then redirect
1779               you to the final target. URLs resulting from this scheme
1780               typically look like: <span class=
1781               "QUOTE">"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</span>.</p>
1782               <p>Sometimes, there are even multiple consecutive redirects
1783               encoded in the URL. These redirections via scripts make your
1784               web browsing more traceable, since the server from which you
1785               follow such a link can see where you go to. Apart from that,
1786               valuable bandwidth and time is wasted, while your browser asks
1787               the server for one redirect after the other. Plus, it feeds the
1788               advertisers.</p>
1789               <p>This feature is currently not very smart and is scheduled
1790               for improvement. If it is enabled by default, you will have to
1791               create some exceptions to this action. It can lead to failures
1792               in several ways:</p>
1793               <p>Not every URLs with other URLs as parameters is evil. Some
1794               sites offer a real service that requires this information to
1795               work. For example a validation service needs to know, which
1796               document to validate. <tt class="LITERAL">fast-redirects</tt>
1797               assumes that every URL parameter that looks like another URL is
1798               a redirection target, and will always redirect to the last one.
1799               Most of the time the assumption is correct, but if it isn't,
1800               the user gets redirected anyway.</p>
1801               <p>Another failure occurs if the URL contains other parameters
1802               after the URL parameter. The URL: <span class=
1803               "QUOTE">"http://www.example.org/?redirect=http%3a//www.example.net/&amp;foo=bar"</span>.
1804               contains the redirection URL <span class=
1805               "QUOTE">"http://www.example.net/"</span>, followed by another
1806               parameter. <tt class="LITERAL">fast-redirects</tt> doesn't know
1807               that and will cause a redirect to <span class=
1808               "QUOTE">"http://www.example.net/&amp;foo=bar"</span>. Depending
1809               on the target server configuration, the parameter will be
1810               silently ignored or lead to a <span class="QUOTE">"page not
1811               found"</span> error. You can prevent this problem by first
1812               using the <tt class="LITERAL"><a href=
1813               "actions-file.html#REDIRECT">redirect</a></tt> action to remove
1814               the last part of the URL, but it requires a little effort.</p>
1815               <p>To detect a redirection URL, <tt class=
1816               "LITERAL">fast-redirects</tt> only looks for the string
1817               <span class="QUOTE">"http://"</span>, either in plain text
1818               (invalid but often used) or encoded as <span class=
1819               "QUOTE">"http%3a//"</span>. Some sites use their own URL
1820               encoding scheme, encrypt the address of the target server or
1821               replace it with a database id. In theses cases <tt class=
1822               "LITERAL">fast-redirects</tt> is fooled and the request reaches
1823               the redirection server where it probably gets logged.</p>
1824             </dd>
1825             <dt>Example usage:</dt>
1826             <dd>
1827               <table border="0" bgcolor="#E0E0E0" width="90%">
1828                 <tr>
1829                   <td>
1830                     <pre class="SCREEN"> { +fast-redirects{simple-check} }
1831    one.example.com
1832
1833  { +fast-redirects{check-decoded-url} }
1834    another.example.com/testing</pre>
1835                   </td>
1836                 </tr>
1837               </table>
1838             </dd>
1839           </dl>
1840         </div>
1841       </div>
1842       <div class="SECT3">
1843         <h4 class="SECT3"><a name="FILTER" id="FILTER">8.5.16.
1844         filter</a></h4>
1845         <div class="VARIABLELIST">
1846           <dl>
1847             <dt>Typical use:</dt>
1848             <dd>
1849               <p>Get rid of HTML and JavaScript annoyances, banner
1850               advertisements (by size), do fun text replacements, add
1851               personalized effects, etc.</p>
1852             </dd>
1853             <dt>Effect:</dt>
1854             <dd>
1855               <p>All instances of text-based type, most notably HTML and
1856               JavaScript, to which this action applies, can be filtered
1857               on-the-fly through the specified regular expression based
1858               substitutions. (Note: as of version 3.0.3 plain text documents
1859               are exempted from filtering, because web servers often use the
1860               <tt class="LITERAL">text/plain</tt> MIME type for all files
1861               whose type they don't know.)</p>
1862             </dd>
1863             <dt>Type:</dt>
1864             <dd>
1865               <p>Multi-value.</p>
1866             </dd>
1867             <dt>Parameter:</dt>
1868             <dd>
1869               <p>The name of a content filter, as defined in the <a href=
1870               "filter-file.html">filter file</a>. Filters can be defined in
1871               one or more files as defined by the <tt class=
1872               "LITERAL"><a href="config.html#FILTERFILE">filterfile</a></tt>
1873               option in the <a href="config.html">config file</a>. <tt class=
1874               "FILENAME">default.filter</tt> is the collection of filters
1875               supplied by the developers. Locally defined filters should go
1876               in their own file, such as <tt class=
1877               "FILENAME">user.filter</tt>.</p>
1878               <p>When used in its negative form, and without parameters,
1879               <span class="emphasis"><i class="EMPHASIS">all</i></span>
1880               filtering is completely disabled.</p>
1881             </dd>
1882             <dt>Notes:</dt>
1883             <dd>
1884               <p>For your convenience, there are a number of pre-defined
1885               filters available in the distribution filter file that you can
1886               use. See the examples below for a list.</p>
1887               <p>Filtering requires buffering the page content, which may
1888               appear to slow down page rendering since nothing is displayed
1889               until all content has passed the filters. (The total time until
1890               the page is completely rendered doesn't change much, but it may
1891               be perceived as slower since the page is not incrementally
1892               displayed.) This effect will be more noticeable on slower
1893               connections.</p>
1894               <p><span class="QUOTE">"Rolling your own"</span> filters
1895               requires a knowledge of <a href=
1896               "http://en.wikipedia.org/wiki/Regular_expressions" target=
1897               "_top"><span class="QUOTE">"Regular Expressions"</span></a> and
1898               <a href="http://en.wikipedia.org/wiki/Html" target=
1899               "_top"><span class="QUOTE">"HTML"</span></a>. This is very
1900               powerful feature, and potentially very intrusive. Filters
1901               should be used with caution, and where an equivalent
1902               <span class="QUOTE">"action"</span> is not available.</p>
1903               <p>The amount of data that can be filtered is limited to the
1904               <tt class="LITERAL"><a href=
1905               "config.html#BUFFER-LIMIT">buffer-limit</a></tt> option in the
1906               main <a href="config.html">config file</a>. The default is 4096
1907               KB (4 Megs). Once this limit is exceeded, the buffered data,
1908               and all pending data, is passed through unfiltered.</p>
1909               <p>Inappropriate MIME types, such as zipped files, are not
1910               filtered at all. (Again, only text-based types except plain
1911               text). Encrypted SSL data (from HTTPS servers) cannot be
1912               filtered either, since this would violate the integrity of the
1913               secure transaction. In some situations it might be necessary to
1914               protect certain text, like source code, from filtering by
1915               defining appropriate <tt class="LITERAL">-filter</tt>
1916               exceptions.</p>
1917               <p>Compressed content can't be filtered either, but if
1918               <span class="APPLICATION">Privoxy</span> is compiled with zlib
1919               support and a supported compression algorithm is used (gzip or
1920               deflate), <span class="APPLICATION">Privoxy</span> can first
1921               decompress the content and then filter it.</p>
1922               <p>If you use a <span class="APPLICATION">Privoxy</span>
1923               version without zlib support, but want filtering to work on as
1924               much documents as possible, even those that would normally be
1925               sent compressed, you must use the <tt class="LITERAL"><a href=
1926               "actions-file.html#PREVENT-COMPRESSION">prevent-compression</a></tt>
1927               action in conjunction with <tt class="LITERAL">filter</tt>.</p>
1928               <p>Content filtering can achieve some of the same effects as
1929               the <tt class="LITERAL"><a href=
1930               "actions-file.html#BLOCK">block</a></tt> action, i.e. it can be
1931               used to block ads and banners. But the mechanism works quite
1932               differently. One effective use, is to block ad banners based on
1933               their size (see below), since many of these seem to be somewhat
1934               standardized.</p>
1935               <p><a href="contact.html">Feedback</a> with suggestions for new
1936               or improved filters is particularly welcome!</p>
1937               <p>The below list has only the names and a one-line description
1938               of each predefined filter. There are <a href=
1939               "filter-file.html#PREDEFINED-FILTERS">more verbose
1940               explanations</a> of what these filters do in the <a href=
1941               "filter-file.html">filter file chapter</a>.</p>
1942             </dd>
1943             <dt>Example usage (with filters from the distribution <tt class=
1944             "FILENAME">default.filter</tt> file). See <a href=
1945             "filter-file.html#PREDEFINED-FILTERS">the Predefined Filters
1946             section</a> for more explanation on each:</dt>
1947             <dd>
1948               <p><a name="FILTER-JS-ANNOYANCES" id=
1949               "FILTER-JS-ANNOYANCES"></a></p>
1950               <table border="0" bgcolor="#E0E0E0" width="90%">
1951                 <tr>
1952                   <td>
1953                     <pre class="SCREEN">
1954                     +filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.</pre>
1955                   </td>
1956                 </tr>
1957               </table>
1958               <p><a name="FILTER-JS-EVENTS" id="FILTER-JS-EVENTS"></a></p>
1959               <table border="0" bgcolor="#E0E0E0" width="90%">
1960                 <tr>
1961                   <td>
1962                     <pre class="SCREEN">
1963                     +filter{js-events}           # Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites).</pre>
1964                   </td>
1965                 </tr>
1966               </table>
1967               <p><a name="FILTER-HTML-ANNOYANCES" id=
1968               "FILTER-HTML-ANNOYANCES"></a></p>
1969               <table border="0" bgcolor="#E0E0E0" width="90%">
1970                 <tr>
1971                   <td>
1972                     <pre class="SCREEN">
1973                     +filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.</pre>
1974                   </td>
1975                 </tr>
1976               </table>
1977               <p><a name="FILTER-CONTENT-COOKIES" id=
1978               "FILTER-CONTENT-COOKIES"></a></p>
1979               <table border="0" bgcolor="#E0E0E0" width="90%">
1980                 <tr>
1981                   <td>
1982                     <pre class="SCREEN">
1983                     +filter{content-cookies}     # Kill cookies that come in the HTML or JS content.</pre>
1984                   </td>
1985                 </tr>
1986               </table>
1987               <p><a name="FILTER-REFRESH-TAGS" id=
1988               "FILTER-REFRESH-TAGS"></a></p>
1989               <table border="0" bgcolor="#E0E0E0" width="90%">
1990                 <tr>
1991                   <td>
1992                     <pre class="SCREEN">
1993                     +filter{refresh-tags}        # Kill automatic refresh tags if refresh time is larger than 9 seconds.</pre>
1994                   </td>
1995                 </tr>
1996               </table>
1997               <p><a name="FILTER-UNSOLICITED-POPUPS" id=
1998               "FILTER-UNSOLICITED-POPUPS"></a></p>
1999               <table border="0" bgcolor="#E0E0E0" width="90%">
2000                 <tr>
2001                   <td>
2002                     <pre class="SCREEN">
2003                     +filter{unsolicited-popups}  # Disable only unsolicited pop-up windows.</pre>
2004                   </td>
2005                 </tr>
2006               </table>
2007               <p><a name="FILTER-ALL-POPUPS" id="FILTER-ALL-POPUPS"></a></p>
2008               <table border="0" bgcolor="#E0E0E0" width="90%">
2009                 <tr>
2010                   <td>
2011                     <pre class="SCREEN">
2012                     +filter{all-popups}          # Kill all popups in JavaScript and HTML.</pre>
2013                   </td>
2014                 </tr>
2015               </table>
2016               <p><a name="FILTER-IMG-REORDER" id=
2017               "FILTER-IMG-REORDER"></a></p>
2018               <table border="0" bgcolor="#E0E0E0" width="90%">
2019                 <tr>
2020                   <td>
2021                     <pre class="SCREEN">
2022                     +filter{img-reorder}         # Reorder attributes in &lt;img&gt; tags to make the banners-by-* filters more effective.</pre>
2023                   </td>
2024                 </tr>
2025               </table>
2026               <p><a name="FILTER-BANNERS-BY-SIZE" id=
2027               "FILTER-BANNERS-BY-SIZE"></a></p>
2028               <table border="0" bgcolor="#E0E0E0" width="90%">
2029                 <tr>
2030                   <td>
2031                     <pre class="SCREEN">
2032                     +filter{banners-by-size}     # Kill banners by size.</pre>
2033                   </td>
2034                 </tr>
2035               </table>
2036               <p><a name="FILTER-BANNERS-BY-LINK" id=
2037               "FILTER-BANNERS-BY-LINK"></a></p>
2038               <table border="0" bgcolor="#E0E0E0" width="90%">
2039                 <tr>
2040                   <td>
2041                     <pre class="SCREEN">
2042                     +filter{banners-by-link}     # Kill banners by their links to known clicktrackers.</pre>
2043                   </td>
2044                 </tr>
2045               </table>
2046               <p><a name="FILTER-WEBBUGS" id="FILTER-WEBBUGS"></a></p>
2047               <table border="0" bgcolor="#E0E0E0" width="90%">
2048                 <tr>
2049                   <td>
2050                     <pre class="SCREEN">
2051                     +filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).</pre>
2052                   </td>
2053                 </tr>
2054               </table>
2055               <p><a name="FILTER-TINY-TEXTFORMS" id=
2056               "FILTER-TINY-TEXTFORMS"></a></p>
2057               <table border="0" bgcolor="#E0E0E0" width="90%">
2058                 <tr>
2059                   <td>
2060                     <pre class="SCREEN">
2061                     +filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.</pre>
2062                   </td>
2063                 </tr>
2064               </table>
2065               <p><a name="FILTER-JUMPING-WINDOWS" id=
2066               "FILTER-JUMPING-WINDOWS"></a></p>
2067               <table border="0" bgcolor="#E0E0E0" width="90%">
2068                 <tr>
2069                   <td>
2070                     <pre class="SCREEN">
2071                     +filter{jumping-windows}     # Prevent windows from resizing and moving themselves.</pre>
2072                   </td>
2073                 </tr>
2074               </table>
2075               <p><a name="FILTER-FRAMESET-BORDERS" id=
2076               "FILTER-FRAMESET-BORDERS"></a></p>
2077               <table border="0" bgcolor="#E0E0E0" width="90%">
2078                 <tr>
2079                   <td>
2080                     <pre class="SCREEN">
2081                     +filter{frameset-borders}    # Give frames a border and make them resizable.</pre>
2082                   </td>
2083                 </tr>
2084               </table>
2085               <p><a name="FILTER-IFRAMES" id="FILTER-IFRAMES"></a></p>
2086               <table border="0" bgcolor="#E0E0E0" width="90%">
2087                 <tr>
2088                   <td>
2089                     <pre class="SCREEN">
2090                     +filter{iframes}             # Removes all detected iframes. Should only be enabled for individual sites.</pre>
2091                   </td>
2092                 </tr>
2093               </table>
2094               <p><a name="FILTER-DEMORONIZER" id=
2095               "FILTER-DEMORONIZER"></a></p>
2096               <table border="0" bgcolor="#E0E0E0" width="90%">
2097                 <tr>
2098                   <td>
2099                     <pre class="SCREEN">
2100                     +filter{demoronizer}         # Fix MS's non-standard use of standard charsets.</pre>
2101                   </td>
2102                 </tr>
2103               </table>
2104               <p><a name="FILTER-SHOCKWAVE-FLASH" id=
2105               "FILTER-SHOCKWAVE-FLASH"></a></p>
2106               <table border="0" bgcolor="#E0E0E0" width="90%">
2107                 <tr>
2108                   <td>
2109                     <pre class="SCREEN">
2110                     +filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.</pre>
2111                   </td>
2112                 </tr>
2113               </table>
2114               <p><a name="FILTER-QUICKTIME-KIOSKMODE" id=
2115               "FILTER-QUICKTIME-KIOSKMODE"></a></p>
2116               <table border="0" bgcolor="#E0E0E0" width="90%">
2117                 <tr>
2118                   <td>
2119                     <pre class="SCREEN">
2120                     +filter{quicktime-kioskmode} # Make Quicktime movies saveable.</pre>
2121                   </td>
2122                 </tr>
2123               </table>
2124               <p><a name="FILTER-FUN" id="FILTER-FUN"></a></p>
2125               <table border="0" bgcolor="#E0E0E0" width="90%">
2126                 <tr>
2127                   <td>
2128                     <pre class="SCREEN">
2129                     +filter{fun}                 # Text replacements for subversive browsing fun!</pre>
2130                   </td>
2131                 </tr>
2132               </table>
2133               <p><a name="FILTER-CRUDE-PARENTAL" id=
2134               "FILTER-CRUDE-PARENTAL"></a></p>
2135               <table border="0" bgcolor="#E0E0E0" width="90%">
2136                 <tr>
2137                   <td>
2138                     <pre class="SCREEN">
2139                     +filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.</pre>
2140                   </td>
2141                 </tr>
2142               </table>
2143               <p><a name="FILTER-IE-EXPLOITS" id=
2144               "FILTER-IE-EXPLOITS"></a></p>
2145               <table border="0" bgcolor="#E0E0E0" width="90%">
2146                 <tr>
2147                   <td>
2148                     <pre class="SCREEN">
2149                     +filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.</pre>
2150                   </td>
2151                 </tr>
2152               </table>
2153               <p><a name="FILTER-SITE-SPECIFICS" id=
2154               "FILTER-SITE-SPECIFICS"></a></p>
2155               <table border="0" bgcolor="#E0E0E0" width="90%">
2156                 <tr>
2157                   <td>
2158                     <pre class="SCREEN">
2159                     +filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!</pre>
2160                   </td>
2161                 </tr>
2162               </table>
2163               <p><a name="FILTER-NO-PING" id="FILTER-NO-PING"></a></p>
2164               <table border="0" bgcolor="#E0E0E0" width="90%">
2165                 <tr>
2166                   <td>
2167                     <pre class="SCREEN">
2168                     +filter{no-ping}             # Removes non-standard ping attributes in &lt;a&gt; and &lt;area&gt; tags.</pre>
2169                   </td>
2170                 </tr>
2171               </table>
2172               <p><a name="FILTER-GOOGLE" id="FILTER-GOOGLE"></a></p>
2173               <table border="0" bgcolor="#E0E0E0" width="90%">
2174                 <tr>
2175                   <td>
2176                     <pre class="SCREEN">
2177                     +filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</pre>
2178                   </td>
2179                 </tr>
2180               </table>
2181               <p><a name="FILTER-YAHOO" id="FILTER-YAHOO"></a></p>
2182               <table border="0" bgcolor="#E0E0E0" width="90%">
2183                 <tr>
2184                   <td>
2185                     <pre class="SCREEN">
2186                     +filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.</pre>
2187                   </td>
2188                 </tr>
2189               </table>
2190               <p><a name="FILTER-MSN" id="FILTER-MSN"></a></p>
2191               <table border="0" bgcolor="#E0E0E0" width="90%">
2192                 <tr>
2193                   <td>
2194                     <pre class="SCREEN">
2195                     +filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</pre>
2196                   </td>
2197                 </tr>
2198               </table>
2199               <p><a name="FILTER-BLOGSPOT" id="FILTER-BLOGSPOT"></a></p>
2200               <table border="0" bgcolor="#E0E0E0" width="90%">
2201                 <tr>
2202                   <td>
2203                     <pre class="SCREEN">
2204                     +filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.</pre>
2205                   </td>
2206                 </tr>
2207               </table>
2208             </dd>
2209           </dl>
2210         </div>
2211       </div>
2212       <div class="SECT3">
2213         <h4 class="SECT3"><a name="FORCE-TEXT-MODE" id=
2214         "FORCE-TEXT-MODE">8.5.17. force-text-mode</a></h4>
2215         <div class="VARIABLELIST">
2216           <dl>
2217             <dt>Typical use:</dt>
2218             <dd>
2219               <p>Force <span class="APPLICATION">Privoxy</span> to treat a
2220               document as if it was in some kind of <span class=
2221               "emphasis"><i class="EMPHASIS">text</i></span> format.</p>
2222             </dd>
2223             <dt>Effect:</dt>
2224             <dd>
2225               <p>Declares a document as text, even if the <span class=
2226               "QUOTE">"Content-Type:"</span> isn't detected as such.</p>
2227             </dd>
2228             <dt>Type:</dt>
2229             <dd>
2230               <p>Boolean.</p>
2231             </dd>
2232             <dt>Parameter:</dt>
2233             <dd>
2234               <p>N/A</p>
2235             </dd>
2236             <dt>Notes:</dt>
2237             <dd>
2238               <p>As explained <tt class="LITERAL"><a href=
2239               "actions-file.html#FILTER">above</a></tt>, <span class=
2240               "APPLICATION">Privoxy</span> tries to only filter files that
2241               are in some kind of text format. The same restrictions apply to
2242               <tt class="LITERAL"><a href=
2243               "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite</a></tt>.
2244               <tt class="LITERAL">force-text-mode</tt> declares a document as
2245               text, without looking at the <span class=
2246               "QUOTE">"Content-Type:"</span> first.</p>
2247               <div class="WARNING">
2248                 <table class="WARNING" border="1" width="90%">
2249                   <tr>
2250                     <td align="center"><b>Warning</b></td>
2251                   </tr>
2252                   <tr>
2253                     <td align="left">
2254                       <p>Think twice before activating this action. Filtering
2255                       binary data with regular expressions can cause file
2256                       damage.</p>
2257                     </td>
2258                   </tr>
2259                 </table>
2260               </div>
2261             </dd>
2262             <dt>Example usage:</dt>
2263             <dd>
2264               <table border="0" bgcolor="#E0E0E0" width="90%">
2265                 <tr>
2266                   <td>
2267                     <pre class="SCREEN">+force-text-mode
2268      </pre>
2269                   </td>
2270                 </tr>
2271               </table>
2272             </dd>
2273           </dl>
2274         </div>
2275       </div>
2276       <div class="SECT3">
2277         <h4 class="SECT3"><a name="FORWARD-OVERRIDE" id=
2278         "FORWARD-OVERRIDE">8.5.18. forward-override</a></h4>
2279         <div class="VARIABLELIST">
2280           <dl>
2281             <dt>Typical use:</dt>
2282             <dd>
2283               <p>Change the forwarding settings based on User-Agent or
2284               request origin</p>
2285             </dd>
2286             <dt>Effect:</dt>
2287             <dd>
2288               <p>Overrules the forward directives in the configuration
2289               file.</p>
2290             </dd>
2291             <dt>Type:</dt>
2292             <dd>
2293               <p>Parameterized.</p>
2294             </dd>
2295             <dt>Parameter:</dt>
2296             <dd>
2297               <ul>
2298                 <li>
2299                   <p><span class="QUOTE">"forward ."</span> to use a direct
2300                   connection without any additional proxies.</p>
2301                 </li>
2302                 <li>
2303                   <p><span class="QUOTE">"forward 127.0.0.1:8123"</span> to
2304                   use the HTTP proxy listening at 127.0.0.1 port 8123.</p>
2305                 </li>
2306                 <li>
2307                   <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2308                   ."</span> to use the socks4a proxy listening at 127.0.0.1
2309                   port 9050. Replace <span class=
2310                   "QUOTE">"forward-socks4a"</span> with <span class=
2311                   "QUOTE">"forward-socks4"</span> to use a socks4 connection
2312                   (with local DNS resolution) instead, use <span class=
2313                   "QUOTE">"forward-socks5"</span> for socks5 connections
2314                   (with remote DNS resolution).</p>
2315                 </li>
2316                 <li>
2317                   <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2318                   proxy.example.org:8000"</span> to use the socks4a proxy
2319                   listening at 127.0.0.1 port 9050 to reach the HTTP proxy
2320                   listening at proxy.example.org port 8000. Replace
2321                   <span class="QUOTE">"forward-socks4a"</span> with
2322                   <span class="QUOTE">"forward-socks4"</span> to use a socks4
2323                   connection (with local DNS resolution) instead, use
2324                   <span class="QUOTE">"forward-socks5"</span> for socks5
2325                   connections (with remote DNS resolution).</p>
2326                 </li>
2327                 <li>
2328                   <p><span class="QUOTE">"forward-webserver
2329                   127.0.0.1:80"</span> to use the HTTP server listening at
2330                   127.0.0.1 port 80 without adjusting the request
2331                   headers.</p>
2332                   <p>This makes it more convenient to use Privoxy to make
2333                   existing websites available as onion services as well.</p>
2334                   <p>Many websites serve content with hardcoded URLs and
2335                   can't be easily adjusted to change the domain based on the
2336                   one used by the client.</p>
2337                   <p>Putting Privoxy between Tor and the webserver (or an
2338                   stunnel that forwards to the webserver) allows to rewrite
2339                   headers and content to make client and server happy at the
2340                   same time.</p>
2341                   <p>Using Privoxy for webservers that are only reachable
2342                   through onion addresses and whose location is supposed to
2343                   be secret is not recommended and should not be necessary
2344                   anyway.</p>
2345                 </li>
2346               </ul>
2347             </dd>
2348             <dt>Notes:</dt>
2349             <dd>
2350               <p>This action takes parameters similar to the <a href=
2351               "config.html#FORWARDING">forward</a> directives in the
2352               configuration file, but without the URL pattern. It can be used
2353               as replacement, but normally it's only used in cases where
2354               matching based on the request URL isn't sufficient.</p>
2355               <div class="WARNING">
2356                 <table class="WARNING" border="1" width="90%">
2357                   <tr>
2358                     <td align="center"><b>Warning</b></td>
2359                   </tr>
2360                   <tr>
2361                     <td align="left">
2362                       <p>Please read the description for the <a href=
2363                       "config.html#FORWARDING">forward</a> directives before
2364                       using this action. Forwarding to the wrong people will
2365                       reduce your privacy and increase the chances of
2366                       man-in-the-middle attacks.</p>
2367                       <p>If the ports are missing or invalid, default values
2368                       will be used. This might change in the future and you
2369                       shouldn't rely on it. Otherwise incorrect syntax causes
2370                       Privoxy to exit. Due to design limitations, invalid
2371                       parameter syntax isn't detected until the action is
2372                       used the first time.</p>
2373                       <p>Use the <a href=
2374                       "http://config.privoxy.org/show-url-info" target=
2375                       "_top">show-url-info CGI page</a> to verify that your
2376                       forward settings do what you thought the do.</p>
2377                     </td>
2378                   </tr>
2379                 </table>
2380               </div>
2381             </dd>
2382             <dt>Example usage:</dt>
2383             <dd>
2384               <table border="0" bgcolor="#E0E0E0" width="90%">
2385                 <tr>
2386                   <td>
2387                     <pre class="SCREEN">
2388                     # Use an ssh tunnel for requests previously tagged as
2389 # <span class="QUOTE">"User-Agent: fetch libfetch/2.0"</span> and make sure
2390 # resuming downloads continues to work.
2391 #
2392 # This way you can continue to use Tor for your normal browsing,
2393 # without overloading the Tor network with your FreeBSD ports updates
2394 # or downloads of bigger files like ISOs.
2395 #
2396 # Note that HTTP headers are easy to fake and therefore their
2397 # values are as (un)trustworthy as your clients and users.
2398 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
2399  -hide-if-modified-since      \
2400  -overwrite-last-modified     \
2401 }
2402 TAG:^User-Agent: fetch libfetch/2\.0$
2403      </pre>
2404                   </td>
2405                 </tr>
2406               </table>
2407             </dd>
2408           </dl>
2409         </div>
2410       </div>
2411       <div class="SECT3">
2412         <h4 class="SECT3"><a name="HANDLE-AS-EMPTY-DOCUMENT" id=
2413         "HANDLE-AS-EMPTY-DOCUMENT">8.5.19. handle-as-empty-document</a></h4>
2414         <div class="VARIABLELIST">
2415           <dl>
2416             <dt>Typical use:</dt>
2417             <dd>
2418               <p>Mark URLs that should be replaced by empty documents
2419               <span class="emphasis"><i class="EMPHASIS">if they get
2420               blocked</i></span></p>
2421             </dd>
2422             <dt>Effect:</dt>
2423             <dd>
2424               <p>This action alone doesn't do anything noticeable. It just
2425               marks URLs. If the <tt class="LITERAL"><a href=
2426               "actions-file.html#BLOCK">block</a></tt> action <span class=
2427               "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2428               presence or absence of this mark decides whether an HTML
2429               <span class="QUOTE">"BLOCKED"</span> page, or an empty document
2430               will be sent to the client as a substitute for the blocked
2431               content. The <span class="emphasis"><i class=
2432               "EMPHASIS">empty</i></span> document isn't literally empty, but
2433               actually contains a single space.</p>
2434             </dd>
2435             <dt>Type:</dt>
2436             <dd>
2437               <p>Boolean.</p>
2438             </dd>
2439             <dt>Parameter:</dt>
2440             <dd>
2441               <p>N/A</p>
2442             </dd>
2443             <dt>Notes:</dt>
2444             <dd>
2445               <p>Some browsers complain about syntax errors if JavaScript
2446               documents are blocked with <span class=
2447               "APPLICATION">Privoxy's</span> default HTML page; this option
2448               can be used to silence them. And of course this action can also
2449               be used to eliminate the <span class=
2450               "APPLICATION">Privoxy</span> BLOCKED message in frames.</p>
2451               <p>The content type for the empty document can be specified
2452               with <tt class="LITERAL"><a href=
2453               "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite{}</a></tt>,
2454               but usually this isn't necessary.</p>
2455             </dd>
2456             <dt>Example usage:</dt>
2457             <dd>
2458               <table border="0" bgcolor="#E0E0E0" width="90%">
2459                 <tr>
2460                   <td>
2461                     <pre class="SCREEN">
2462                     # Block all documents on example.org that end with ".js",
2463 # but send an empty document instead of the usual HTML message.
2464 {+block{Blocked JavaScript} +handle-as-empty-document}
2465 example.org/.*\.js$
2466      </pre>
2467                   </td>
2468                 </tr>
2469               </table>
2470             </dd>
2471           </dl>
2472         </div>
2473       </div>
2474       <div class="SECT3">
2475         <h4 class="SECT3"><a name="HANDLE-AS-IMAGE" id=
2476         "HANDLE-AS-IMAGE">8.5.20. handle-as-image</a></h4>
2477         <div class="VARIABLELIST">
2478           <dl>
2479             <dt>Typical use:</dt>
2480             <dd>
2481               <p>Mark URLs as belonging to images (so they'll be replaced by
2482               images <span class="emphasis"><i class="EMPHASIS">if they do
2483               get blocked</i></span>, rather than HTML pages)</p>
2484             </dd>
2485             <dt>Effect:</dt>
2486             <dd>
2487               <p>This action alone doesn't do anything noticeable. It just
2488               marks URLs as images. If the <tt class="LITERAL"><a href=
2489               "actions-file.html#BLOCK">block</a></tt> action <span class=
2490               "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2491               presence or absence of this mark decides whether an HTML
2492               <span class="QUOTE">"blocked"</span> page, or a replacement
2493               image (as determined by the <tt class="LITERAL"><a href=
2494               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
2495               action) will be sent to the client as a substitute for the
2496               blocked content.</p>
2497             </dd>
2498             <dt>Type:</dt>
2499             <dd>
2500               <p>Boolean.</p>
2501             </dd>
2502             <dt>Parameter:</dt>
2503             <dd>
2504               <p>N/A</p>
2505             </dd>
2506             <dt>Notes:</dt>
2507             <dd>
2508               <p>The below generic example section is actually part of
2509               <tt class="FILENAME">default.action</tt>. It marks all URLs
2510               with well-known image file name extensions as images and should
2511               be left intact.</p>
2512               <p>Users will probably only want to use the handle-as-image
2513               action in conjunction with <tt class="LITERAL"><a href=
2514               "actions-file.html#BLOCK">block</a></tt>, to block sources of
2515               banners, whose URLs don't reflect the file type, like in the
2516               second example section.</p>
2517               <p>Note that you cannot treat HTML pages as images in most
2518               cases. For instance, (in-line) ad frames require an HTML page
2519               to be sent, or they won't display properly. Forcing <tt class=
2520               "LITERAL">handle-as-image</tt> in this situation will not
2521               replace the ad frame with an image, but lead to error
2522               messages.</p>
2523             </dd>
2524             <dt>Example usage (sections):</dt>
2525             <dd>
2526               <table border="0" bgcolor="#E0E0E0" width="90%">
2527                 <tr>
2528                   <td>
2529                     <pre class="SCREEN"># Generic image extensions:
2530 #
2531 {+handle-as-image}
2532 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2533
2534 # These don't look like images, but they're banners and should be
2535 # blocked as images:
2536 #
2537 {+block{Nasty banners.} +handle-as-image}
2538 nasty-banner-server.example.com/junk.cgi\?output=trash</pre>
2539                   </td>
2540                 </tr>
2541               </table>
2542             </dd>
2543           </dl>
2544         </div>
2545       </div>
2546       <div class="SECT3">
2547         <h4 class="SECT3"><a name="HIDE-ACCEPT-LANGUAGE" id=
2548         "HIDE-ACCEPT-LANGUAGE">8.5.21. hide-accept-language</a></h4>
2549         <div class="VARIABLELIST">
2550           <dl>
2551             <dt>Typical use:</dt>
2552             <dd>
2553               <p>Pretend to use different language settings.</p>
2554             </dd>
2555             <dt>Effect:</dt>
2556             <dd>
2557               <p>Deletes or replaces the <span class=
2558               "QUOTE">"Accept-Language:"</span> HTTP header in client
2559               requests.</p>
2560             </dd>
2561             <dt>Type:</dt>
2562             <dd>
2563               <p>Parameterized.</p>
2564             </dd>
2565             <dt>Parameter:</dt>
2566             <dd>
2567               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2568               defined value.</p>
2569             </dd>
2570             <dt>Notes:</dt>
2571             <dd>
2572               <p>Faking the browser's language settings can be useful to make
2573               a foreign User-Agent set with <tt class="LITERAL"><a href=
2574               "actions-file.html#HIDE-USER-AGENT">hide-user-agent</a></tt>
2575               more believable.</p>
2576               <p>However some sites with content in different languages check
2577               the <span class="QUOTE">"Accept-Language:"</span> to decide
2578               which one to take by default. Sometimes it isn't possible to
2579               later switch to another language without changing the
2580               <span class="QUOTE">"Accept-Language:"</span> header first.</p>
2581               <p>Therefore it's a good idea to either only change the
2582               <span class="QUOTE">"Accept-Language:"</span> header to
2583               languages you understand, or to languages that aren't wide
2584               spread.</p>
2585               <p>Before setting the <span class=
2586               "QUOTE">"Accept-Language:"</span> header to a rare language,
2587               you should consider that it helps to make your requests unique
2588               and thus easier to trace. If you don't plan to change this
2589               header frequently, you should stick to a common language.</p>
2590             </dd>
2591             <dt>Example usage (section):</dt>
2592             <dd>
2593               <table border="0" bgcolor="#E0E0E0" width="90%">
2594                 <tr>
2595                   <td>
2596                     <pre class="SCREEN">
2597                     # Pretend to use Canadian language settings.
2598 {+hide-accept-language{en-ca} \
2599 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
2600 }
2601 /   </pre>
2602                   </td>
2603                 </tr>
2604               </table>
2605             </dd>
2606           </dl>
2607         </div>
2608       </div>
2609       <div class="SECT3">
2610         <h4 class="SECT3"><a name="HIDE-CONTENT-DISPOSITION" id=
2611         "HIDE-CONTENT-DISPOSITION">8.5.22. hide-content-disposition</a></h4>
2612         <div class="VARIABLELIST">
2613           <dl>
2614             <dt>Typical use:</dt>
2615             <dd>
2616               <p>Prevent download menus for content you prefer to view inside
2617               the browser.</p>
2618             </dd>
2619             <dt>Effect:</dt>
2620             <dd>
2621               <p>Deletes or replaces the <span class=
2622               "QUOTE">"Content-Disposition:"</span> HTTP header set by some
2623               servers.</p>
2624             </dd>
2625             <dt>Type:</dt>
2626             <dd>
2627               <p>Parameterized.</p>
2628             </dd>
2629             <dt>Parameter:</dt>
2630             <dd>
2631               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2632               defined value.</p>
2633             </dd>
2634             <dt>Notes:</dt>
2635             <dd>
2636               <p>Some servers set the <span class=
2637               "QUOTE">"Content-Disposition:"</span> HTTP header for documents
2638               they assume you want to save locally before viewing them. The
2639               <span class="QUOTE">"Content-Disposition:"</span> header
2640               contains the file name the browser is supposed to use by
2641               default.</p>
2642               <p>In most browsers that understand this header, it makes it
2643               impossible to <span class="emphasis"><i class="EMPHASIS">just
2644               view</i></span> the document, without downloading it first,
2645               even if it's just a simple text file or an image.</p>
2646               <p>Removing the <span class=
2647               "QUOTE">"Content-Disposition:"</span> header helps to prevent
2648               this annoyance, but some browsers additionally check the
2649               <span class="QUOTE">"Content-Type:"</span> header, before they
2650               decide if they can display a document without saving it first.
2651               In these cases, you have to change this header as well, before
2652               the browser stops displaying download menus.</p>
2653               <p>It is also possible to change the server's file name
2654               suggestion to another one, but in most cases it isn't worth the
2655               time to set it up.</p>
2656               <p>This action will probably be removed in the future, use
2657               server-header filters instead.</p>
2658             </dd>
2659             <dt>Example usage:</dt>
2660             <dd>
2661               <table border="0" bgcolor="#E0E0E0" width="90%">
2662                 <tr>
2663                   <td>
2664                     <pre class="SCREEN">
2665                     # Disarm the download link in Sourceforge's patch tracker
2666 { -filter \
2667  +content-type-overwrite{text/plain}\
2668  +hide-content-disposition{block} }
2669  .sourceforge.net/tracker/download\.php</pre>
2670                   </td>
2671                 </tr>
2672               </table>
2673             </dd>
2674           </dl>
2675         </div>
2676       </div>
2677       <div class="SECT3">
2678         <h4 class="SECT3"><a name="HIDE-IF-MODIFIED-SINCE" id=
2679         "HIDE-IF-MODIFIED-SINCE">8.5.23. hide-if-modified-since</a></h4>
2680         <div class="VARIABLELIST">
2681           <dl>
2682             <dt>Typical use:</dt>
2683             <dd>
2684               <p>Prevent yet another way to track the user's steps between
2685               sessions.</p>
2686             </dd>
2687             <dt>Effect:</dt>
2688             <dd>
2689               <p>Deletes the <span class="QUOTE">"If-Modified-Since:"</span>
2690               HTTP client header or modifies its value.</p>
2691             </dd>
2692             <dt>Type:</dt>
2693             <dd>
2694               <p>Parameterized.</p>
2695             </dd>
2696             <dt>Parameter:</dt>
2697             <dd>
2698               <p>Keyword: <span class="QUOTE">"block"</span>, or a user
2699               defined value that specifies a range of hours.</p>
2700             </dd>
2701             <dt>Notes:</dt>
2702             <dd>
2703               <p>Removing this header is useful for filter testing, where you
2704               want to force a real reload instead of getting status code
2705               <span class="QUOTE">"304"</span>, which would cause the browser
2706               to use a cached copy of the page.</p>
2707               <p>Instead of removing the header, <tt class=
2708               "LITERAL">hide-if-modified-since</tt> can also add or subtract
2709               a random amount of time to/from the header's value. You specify
2710               a range of minutes where the random factor should be chosen
2711               from and <span class="APPLICATION">Privoxy</span> does the
2712               rest. A negative value means subtracting, a positive value
2713               adding.</p>
2714               <p>Randomizing the value of the <span class=
2715               "QUOTE">"If-Modified-Since:"</span> makes it less likely that
2716               the server can use the time as a cookie replacement, but you
2717               will run into caching problems if the random range is too
2718               high.</p>
2719               <p>It is a good idea to only use a small negative value and let
2720               <tt class="LITERAL"><a href=
2721               "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>
2722               handle the greater changes.</p>
2723               <p>It is also recommended to use this action together with
2724               <tt class="LITERAL"><a href=
2725               "actions-file.html#CRUNCH-IF-NONE-MATCH">crunch-if-none-match</a></tt>,
2726               otherwise it's more or less pointless.</p>
2727             </dd>
2728             <dt>Example usage (section):</dt>
2729             <dd>
2730               <table border="0" bgcolor="#E0E0E0" width="90%">
2731                 <tr>
2732                   <td>
2733                     <pre class="SCREEN">
2734                     # Let the browser revalidate but make tracking based on the time less likely.
2735 {+hide-if-modified-since{-60} \
2736  +overwrite-last-modified{randomize} \
2737  +crunch-if-none-match}
2738 /</pre>
2739                   </td>
2740                 </tr>
2741               </table>
2742             </dd>
2743           </dl>
2744         </div>
2745       </div>
2746       <div class="SECT3">
2747         <h4 class="SECT3"><a name="HIDE-FROM-HEADER" id=
2748         "HIDE-FROM-HEADER">8.5.24. hide-from-header</a></h4>
2749         <div class="VARIABLELIST">
2750           <dl>
2751             <dt>Typical use:</dt>
2752             <dd>
2753               <p>Keep your (old and ill) browser from telling web servers
2754               your email address</p>
2755             </dd>
2756             <dt>Effect:</dt>
2757             <dd>
2758               <p>Deletes any existing <span class="QUOTE">"From:"</span> HTTP
2759               header, or replaces it with the specified string.</p>
2760             </dd>
2761             <dt>Type:</dt>
2762             <dd>
2763               <p>Parameterized.</p>
2764             </dd>
2765             <dt>Parameter:</dt>
2766             <dd>
2767               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2768               defined value.</p>
2769             </dd>
2770             <dt>Notes:</dt>
2771             <dd>
2772               <p>The keyword <span class="QUOTE">"block"</span> will
2773               completely remove the header (not to be confused with the
2774               <tt class="LITERAL"><a href=
2775               "actions-file.html#BLOCK">block</a></tt> action).</p>
2776               <p>Alternately, you can specify any value you prefer to be sent
2777               to the web server. If you do, it is a matter of fairness not to
2778               use any address that is actually used by a real person.</p>
2779               <p>This action is rarely needed, as modern web browsers don't
2780               send <span class="QUOTE">"From:"</span> headers anymore.</p>
2781             </dd>
2782             <dt>Example usage:</dt>
2783             <dd>
2784               <table border="0" bgcolor="#E0E0E0" width="90%">
2785                 <tr>
2786                   <td>
2787                     <pre class="SCREEN">+hide-from-header{block}</pre>
2788                   </td>
2789                 </tr>
2790               </table>or
2791               <table border="0" bgcolor="#E0E0E0" width="90%">
2792                 <tr>
2793                   <td>
2794                     <pre class="SCREEN">
2795                     +hide-from-header{spam-me-senseless@sittingduck.example.com}</pre>
2796                   </td>
2797                 </tr>
2798               </table>
2799             </dd>
2800           </dl>
2801         </div>
2802       </div>
2803       <div class="SECT3">
2804         <h4 class="SECT3"><a name="HIDE-REFERRER" id="HIDE-REFERRER">8.5.25.
2805         hide-referrer</a></h4><a name="HIDE-REFERER" id="HIDE-REFERER"></a>
2806         <div class="VARIABLELIST">
2807           <dl>
2808             <dt>Typical use:</dt>
2809             <dd>
2810               <p>Conceal which link you followed to get to a particular
2811               site</p>
2812             </dd>
2813             <dt>Effect:</dt>
2814             <dd>
2815               <p>Deletes the <span class="QUOTE">"Referer:"</span> (sic) HTTP
2816               header from the client request, or replaces it with a forged
2817               one.</p>
2818             </dd>
2819             <dt>Type:</dt>
2820             <dd>
2821               <p>Parameterized.</p>
2822             </dd>
2823             <dt>Parameter:</dt>
2824             <dd>
2825               <ul>
2826                 <li>
2827                   <p><span class="QUOTE">"conditional-block"</span> to delete
2828                   the header completely if the host has changed.</p>
2829                 </li>
2830                 <li>
2831                   <p><span class="QUOTE">"conditional-forge"</span> to forge
2832                   the header if the host has changed.</p>
2833                 </li>
2834                 <li>
2835                   <p><span class="QUOTE">"block"</span> to delete the header
2836                   unconditionally.</p>
2837                 </li>
2838                 <li>
2839                   <p><span class="QUOTE">"forge"</span> to pretend to be
2840                   coming from the homepage of the server we are talking
2841                   to.</p>
2842                 </li>
2843                 <li>
2844                   <p>Any other string to set a user defined referrer.</p>
2845                 </li>
2846               </ul>
2847             </dd>
2848             <dt>Notes:</dt>
2849             <dd>
2850               <p><tt class="LITERAL">conditional-block</tt> is the only
2851               parameter, that isn't easily detected in the server's log file.
2852               If it blocks the referrer, the request will look like the
2853               visitor used a bookmark or typed in the address directly.</p>
2854               <p>Leaving the referrer unmodified for requests on the same
2855               host allows the server owner to see the visitor's <span class=
2856               "QUOTE">"click path"</span>, but in most cases she could also
2857               get that information by comparing other parts of the log file:
2858               for example the User-Agent if it isn't a very common one, or
2859               the user's IP address if it doesn't change between different
2860               requests.</p>
2861               <p>Always blocking the referrer, or using a custom one, can
2862               lead to failures on servers that check the referrer before they
2863               answer any requests, in an attempt to prevent their content
2864               from being embedded or linked to elsewhere.</p>
2865               <p>Both <tt class="LITERAL">conditional-block</tt> and
2866               <tt class="LITERAL">forge</tt> will work with referrer checks,
2867               as long as content and valid referring page are on the same
2868               host. Most of the time that's the case.</p>
2869               <p><tt class="LITERAL">hide-referer</tt> is an alternate
2870               spelling of <tt class="LITERAL">hide-referrer</tt> and the two
2871               can be can be freely substituted with each other. (<span class=
2872               "QUOTE">"referrer"</span> is the correct English spelling,
2873               however the HTTP specification has a bug - it requires it to be
2874               spelled as <span class="QUOTE">"referer"</span>.)</p>
2875             </dd>
2876             <dt>Example usage:</dt>
2877             <dd>
2878               <table border="0" bgcolor="#E0E0E0" width="90%">
2879                 <tr>
2880                   <td>
2881                     <pre class="SCREEN">+hide-referrer{forge}</pre>
2882                   </td>
2883                 </tr>
2884               </table>or
2885               <table border="0" bgcolor="#E0E0E0" width="90%">
2886                 <tr>
2887                   <td>
2888                     <pre class="SCREEN">
2889                     +hide-referrer{http://www.yahoo.com/}</pre>
2890                   </td>
2891                 </tr>
2892               </table>
2893             </dd>
2894           </dl>
2895         </div>
2896       </div>
2897       <div class="SECT3">
2898         <h4 class="SECT3"><a name="HIDE-USER-AGENT" id=
2899         "HIDE-USER-AGENT">8.5.26. hide-user-agent</a></h4>
2900         <div class="VARIABLELIST">
2901           <dl>
2902             <dt>Typical use:</dt>
2903             <dd>
2904               <p>Try to conceal your type of browser and client operating
2905               system</p>
2906             </dd>
2907             <dt>Effect:</dt>
2908             <dd>
2909               <p>Replaces the value of the <span class=
2910               "QUOTE">"User-Agent:"</span> HTTP header in client requests
2911               with the specified value.</p>
2912             </dd>
2913             <dt>Type:</dt>
2914             <dd>
2915               <p>Parameterized.</p>
2916             </dd>
2917             <dt>Parameter:</dt>
2918             <dd>
2919               <p>Any user-defined string.</p>
2920             </dd>
2921             <dt>Notes:</dt>
2922             <dd>
2923               <div class="WARNING">
2924                 <table class="WARNING" border="1" width="90%">
2925                   <tr>
2926                     <td align="center"><b>Warning</b></td>
2927                   </tr>
2928                   <tr>
2929                     <td align="left">
2930                       <p>This can lead to problems on web sites that depend
2931                       on looking at this header in order to customize their
2932                       content for different browsers (which, by the way, is
2933                       <span class="emphasis"><i class=
2934                       "EMPHASIS">NOT</i></span> the right thing to do: good
2935                       web sites work browser-independently).</p>
2936                     </td>
2937                   </tr>
2938                 </table>
2939               </div>
2940               <p>Using this action in multi-user setups or wherever different
2941               types of browsers will access the same <span class=
2942               "APPLICATION">Privoxy</span> is <span class=
2943               "emphasis"><i class="EMPHASIS">not recommended</i></span>. In
2944               single-user, single-browser setups, you might use it to delete
2945               your OS version information from the headers, because it is an
2946               invitation to exploit known bugs for your OS. It is also
2947               occasionally useful to forge this in order to access sites that
2948               won't let you in otherwise (though there may be a good reason
2949               in some cases).</p>
2950               <p>More information on known user-agent strings can be found at
2951               <a href="http://www.user-agents.org/" target=
2952               "_top">http://www.user-agents.org/</a> and <a href=
2953               "http://en.wikipedia.org/wiki/User_agent" target=
2954               "_top">http://en.wikipedia.org/wiki/User_agent</a>.</p>
2955             </dd>
2956             <dt>Example usage:</dt>
2957             <dd>
2958               <table border="0" bgcolor="#E0E0E0" width="90%">
2959                 <tr>
2960                   <td>
2961                     <pre class="SCREEN">
2962                     +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</pre>
2963                   </td>
2964                 </tr>
2965               </table>
2966             </dd>
2967           </dl>
2968         </div>
2969       </div>
2970       <div class="SECT3">
2971         <h4 class="SECT3"><a name="LIMIT-CONNECT" id="LIMIT-CONNECT">8.5.27.
2972         limit-connect</a></h4>
2973         <div class="VARIABLELIST">
2974           <dl>
2975             <dt>Typical use:</dt>
2976             <dd>
2977               <p>Prevent abuse of <span class="APPLICATION">Privoxy</span> as
2978               a TCP proxy relay or disable SSL for untrusted sites</p>
2979             </dd>
2980             <dt>Effect:</dt>
2981             <dd>
2982               <p>Specifies to which ports HTTP CONNECT requests are
2983               allowable.</p>
2984             </dd>
2985             <dt>Type:</dt>
2986             <dd>
2987               <p>Parameterized.</p>
2988             </dd>
2989             <dt>Parameter:</dt>
2990             <dd>
2991               <p>A comma-separated list of ports or port ranges (the latter
2992               using dashes, with the minimum defaulting to 0 and the maximum
2993               to 65K).</p>
2994             </dd>
2995             <dt>Notes:</dt>
2996             <dd>
2997               <p>By default, i.e. if no <tt class=
2998               "LITERAL">limit-connect</tt> action applies, <span class=
2999               "APPLICATION">Privoxy</span> allows HTTP CONNECT requests to
3000               all ports. Use <tt class="LITERAL">limit-connect</tt> if
3001               fine-grained control is desired for some or all
3002               destinations.</p>
3003               <p>The CONNECT methods exists in HTTP to allow access to secure
3004               websites (<span class="QUOTE">"https://"</span> URLs) through
3005               proxies. It works very simply: the proxy connects to the server
3006               on the specified port, and then short-circuits its connections
3007               to the client and to the remote server. This means
3008               CONNECT-enabled proxies can be used as TCP relays very
3009               easily.</p>
3010               <p><span class="APPLICATION">Privoxy</span> relays HTTPS
3011               traffic without seeing the decoded content. Websites can
3012               leverage this limitation to circumvent <span class=
3013               "APPLICATION">Privoxy</span>'s filters. By specifying an
3014               invalid port range you can disable HTTPS entirely.</p>
3015             </dd>
3016             <dt>Example usages:</dt>
3017             <dd>
3018               <table border="0" bgcolor="#E0E0E0" width="90%">
3019                 <tr>
3020                   <td>
3021                     <pre class="SCREEN">
3022                     +limit-connect{443}                   # Port 443 is OK.
3023 +limit-connect{80,443}                # Ports 80 and 443 are OK.
3024 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
3025 +limit-connect{-}                     # All ports are OK
3026 +limit-connect{,}                     # No HTTPS/SSL traffic is allowed</pre>
3027                   </td>
3028                 </tr>
3029               </table>
3030             </dd>
3031           </dl>
3032         </div>
3033       </div>
3034       <div class="SECT3">
3035         <h4 class="SECT3"><a name="LIMIT-COOKIE-LIFETIME" id=
3036         "LIMIT-COOKIE-LIFETIME">8.5.28. limit-cookie-lifetime</a></h4>
3037         <div class="VARIABLELIST">
3038           <dl>
3039             <dt>Typical use:</dt>
3040             <dd>
3041               <p>Limit the lifetime of HTTP cookies to a couple of minutes or
3042               hours.</p>
3043             </dd>
3044             <dt>Effect:</dt>
3045             <dd>
3046               <p>Overwrites the expires field in Set-Cookie server headers if
3047               it's above the specified limit.</p>
3048             </dd>
3049             <dt>Type:</dt>
3050             <dd>
3051               <p>Parameterized.</p>
3052             </dd>
3053             <dt>Parameter:</dt>
3054             <dd>
3055               <p>The lifetime limit in minutes, or 0.</p>
3056             </dd>
3057             <dt>Notes:</dt>
3058             <dd>
3059               <p>This action reduces the lifetime of HTTP cookies coming from
3060               the server to the specified number of minutes, starting from
3061               the time the cookie passes Privoxy.</p>
3062               <p>Cookies with a lifetime below the limit are not modified.
3063               The lifetime of session cookies is set to the specified
3064               limit.</p>
3065               <p>The effect of this action depends on the server.</p>
3066               <p>In case of servers which refresh their cookies with each
3067               response (or at least frequently), the lifetime limit set by
3068               this action is updated as well. Thus, a session associated with
3069               the cookie continues to work with this action enabled, as long
3070               as a new request is made before the last limit set is
3071               reached.</p>
3072               <p>However, some servers send their cookies once, with a
3073               lifetime of several years (the year 2037 is a popular choice),
3074               and do not refresh them until a certain event in the future,
3075               for example the user logging out. In this case this action may
3076               limit the absolute lifetime of the session, even if requests
3077               are made frequently.</p>
3078               <p>If the parameter is <span class="QUOTE">"0"</span>, this
3079               action behaves like <tt class="LITERAL"><a href=
3080               "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>.</p>
3081             </dd>
3082             <dt>Example usages:</dt>
3083             <dd>
3084               <table border="0" bgcolor="#E0E0E0" width="90%">
3085                 <tr>
3086                   <td>
3087                     <pre class="SCREEN">+limit-cookie-lifetime{60}
3088        </pre>
3089                   </td>
3090                 </tr>
3091               </table>
3092             </dd>
3093           </dl>
3094         </div>
3095       </div>
3096       <div class="SECT3">
3097         <h4 class="SECT3"><a name="PREVENT-COMPRESSION" id=
3098         "PREVENT-COMPRESSION">8.5.29. prevent-compression</a></h4>
3099         <div class="VARIABLELIST">
3100           <dl>
3101             <dt>Typical use:</dt>
3102             <dd>
3103               <p>Ensure that servers send the content uncompressed, so it can
3104               be passed through <tt class="LITERAL"><a href=
3105               "actions-file.html#FILTER">filter</a></tt>s.</p>
3106             </dd>
3107             <dt>Effect:</dt>
3108             <dd>
3109               <p>Removes the Accept-Encoding header which can be used to ask
3110               for compressed transfer.</p>
3111             </dd>
3112             <dt>Type:</dt>
3113             <dd>
3114               <p>Boolean.</p>
3115             </dd>
3116             <dt>Parameter:</dt>
3117             <dd>
3118               <p>N/A</p>
3119             </dd>
3120             <dt>Notes:</dt>
3121             <dd>
3122               <p>More and more websites send their content compressed by
3123               default, which is generally a good idea and saves bandwidth.
3124               But the <tt class="LITERAL"><a href=
3125               "actions-file.html#FILTER">filter</a></tt> and <tt class=
3126               "LITERAL"><a href=
3127               "actions-file.html#DEANIMATE-GIFS">deanimate-gifs</a></tt>
3128               actions need access to the uncompressed data.</p>
3129               <p>When compiled with zlib support (available since
3130               <span class="APPLICATION">Privoxy</span> 3.0.7), content that
3131               should be filtered is decompressed on-the-fly and you don't
3132               have to worry about this action. If you are using an older
3133               <span class="APPLICATION">Privoxy</span> version, or one that
3134               hasn't been compiled with zlib support, this action can be used
3135               to convince the server to send the content uncompressed.</p>
3136               <p>Most text-based instances compress very well, the size is
3137               seldom decreased by less than 50%, for markup-heavy instances
3138               like news feeds saving more than 90% of the original size isn't
3139               unusual.</p>
3140               <p>Not using compression will therefore slow down the transfer,
3141               and you should only enable this action if you really need it.
3142               As of <span class="APPLICATION">Privoxy</span> 3.0.7 it's
3143               disabled in all predefined action settings.</p>
3144               <p>Note that some (rare) ill-configured sites don't handle
3145               requests for uncompressed documents correctly. Broken PHP
3146               applications tend to send an empty document body, some IIS
3147               versions only send the beginning of the content. If you enable
3148               <tt class="LITERAL">prevent-compression</tt> per default, you
3149               might want to add exceptions for those sites. See the example
3150               for how to do that.</p>
3151             </dd>
3152             <dt>Example usage (sections):</dt>
3153             <dd>
3154               <table border="0" bgcolor="#E0E0E0" width="90%">
3155                 <tr>
3156                   <td>
3157                     <pre class="SCREEN">
3158                     # Selectively turn off compression, and enable a filter
3159 #
3160 { +filter{tiny-textforms} +prevent-compression }
3161 # Match only these sites
3162  .google.
3163  sourceforge.net
3164  sf.net
3165
3166 # Or instead, we could set a universal default:
3167 #
3168 { +prevent-compression }
3169  / # Match all sites
3170
3171 # Then maybe make exceptions for broken sites:
3172 #
3173 { -prevent-compression }
3174 .compusa.com/</pre>
3175                   </td>
3176                 </tr>
3177               </table>
3178             </dd>
3179           </dl>
3180         </div>
3181       </div>
3182       <div class="SECT3">
3183         <h4 class="SECT3"><a name="OVERWRITE-LAST-MODIFIED" id=
3184         "OVERWRITE-LAST-MODIFIED">8.5.30. overwrite-last-modified</a></h4>
3185         <div class="VARIABLELIST">
3186           <dl>
3187             <dt>Typical use:</dt>
3188             <dd>
3189               <p>Prevent yet another way to track the user's steps between
3190               sessions.</p>
3191             </dd>
3192             <dt>Effect:</dt>
3193             <dd>
3194               <p>Deletes the <span class="QUOTE">"Last-Modified:"</span> HTTP
3195               server header or modifies its value.</p>
3196             </dd>
3197             <dt>Type:</dt>
3198             <dd>
3199               <p>Parameterized.</p>
3200             </dd>
3201             <dt>Parameter:</dt>
3202             <dd>
3203               <p>One of the keywords: <span class="QUOTE">"block"</span>,
3204               <span class="QUOTE">"reset-to-request-time"</span> and
3205               <span class="QUOTE">"randomize"</span></p>
3206             </dd>
3207             <dt>Notes:</dt>
3208             <dd>
3209               <p>Removing the <span class="QUOTE">"Last-Modified:"</span>
3210               header is useful for filter testing, where you want to force a
3211               real reload instead of getting status code <span class=
3212               "QUOTE">"304"</span>, which would cause the browser to reuse
3213               the old version of the page.</p>
3214               <p>The <span class="QUOTE">"randomize"</span> option overwrites
3215               the value of the <span class="QUOTE">"Last-Modified:"</span>
3216               header with a randomly chosen time between the original value
3217               and the current time. In theory the server could send each
3218               document with a different <span class=
3219               "QUOTE">"Last-Modified:"</span> header to track visits without
3220               using cookies. <span class="QUOTE">"Randomize"</span> makes it
3221               impossible and the browser can still revalidate cached
3222               documents.</p>
3223               <p><span class="QUOTE">"reset-to-request-time"</span>
3224               overwrites the value of the <span class=
3225               "QUOTE">"Last-Modified:"</span> header with the current time.
3226               You could use this option together with <tt class=
3227               "LITERAL"><a href=
3228               "actions-file.html#HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</a></tt>
3229               to further customize your random range.</p>
3230               <p>The preferred parameter here is <span class=
3231               "QUOTE">"randomize"</span>. It is safe to use, as long as the
3232               time settings are more or less correct. If the server sets the
3233               <span class="QUOTE">"Last-Modified:"</span> header to the time
3234               of the request, the random range becomes zero and the value
3235               stays the same. Therefore you should later randomize it a
3236               second time with <tt class="LITERAL"><a href=
3237               "actions-file.html#HIDE-IF-MODIFIED-SINCE">hided-if-modified-since</a></tt>,
3238               just to be sure.</p>
3239               <p>It is also recommended to use this action together with
3240               <tt class="LITERAL"><a href=
3241               "actions-file.html#CRUNCH-IF-NONE-MATCH">crunch-if-none-match</a></tt>.</p>
3242             </dd>
3243             <dt>Example usage:</dt>
3244             <dd>
3245               <table border="0" bgcolor="#E0E0E0" width="90%">
3246                 <tr>
3247                   <td>
3248                     <pre class="SCREEN">
3249                     # Let the browser revalidate without being tracked across sessions
3250 { +hide-if-modified-since{-60} \
3251  +overwrite-last-modified{randomize} \
3252  +crunch-if-none-match}
3253 /</pre>
3254                   </td>
3255                 </tr>
3256               </table>
3257             </dd>
3258           </dl>
3259         </div>
3260       </div>
3261       <div class="SECT3">
3262         <h4 class="SECT3"><a name="REDIRECT" id="REDIRECT">8.5.31.
3263         redirect</a></h4>
3264         <div class="VARIABLELIST">
3265           <dl>
3266             <dt>Typical use:</dt>
3267             <dd>
3268               <p>Redirect requests to other sites.</p>
3269             </dd>
3270             <dt>Effect:</dt>
3271             <dd>
3272               <p>Convinces the browser that the requested document has been
3273               moved to another location and the browser should get it from
3274               there.</p>
3275             </dd>
3276             <dt>Type:</dt>
3277             <dd>
3278               <p>Parameterized</p>
3279             </dd>
3280             <dt>Parameter:</dt>
3281             <dd>
3282               <p>An absolute URL or a single pcrs command.</p>
3283             </dd>
3284             <dt>Notes:</dt>
3285             <dd>
3286               <p>Requests to which this action applies are answered with a
3287               HTTP redirect to URLs of your choosing. The new URL is either
3288               provided as parameter, or derived by applying a single pcrs
3289               command to the original URL.</p>
3290               <p>The syntax for pcrs commands is documented in the <a href=
3291               "filter-file.html">filter file</a> section.</p>
3292               <p>Requests can't be blocked and redirected at the same time,
3293               applying this action together with <tt class="LITERAL"><a href=
3294               "actions-file.html#BLOCK">block</a></tt> is a configuration
3295               error. Currently the request is blocked and an error message
3296               logged, the behavior may change in the future and result in
3297               Privoxy rejecting the action file.</p>
3298               <p>This action can be combined with <tt class=
3299               "LITERAL"><a href="actions-file.html#FAST-REDIRECTS">fast-redirects{check-decoded-url}</a></tt>
3300               to redirect to a decoded version of a rewritten URL.</p>
3301               <p>Use this action carefully, make sure not to create
3302               redirection loops and be aware that using your own redirects
3303               might make it possible to fingerprint your requests.</p>
3304               <p>In case of problems with your redirects, or simply to watch
3305               them working, enable <a href="config.html#DEBUG">debug
3306               128</a>.</p>
3307             </dd>
3308             <dt>Example usages:</dt>
3309             <dd>
3310               <table border="0" bgcolor="#E0E0E0" width="90%">
3311                 <tr>
3312                   <td>
3313                     <pre class="SCREEN">
3314                     # Replace example.com's style sheet with another one
3315 { +redirect{http://localhost/css-replacements/example.com.css} }
3316  example.com/stylesheet\.css
3317
3318 # Create a short, easy to remember nickname for a favorite site
3319 # (relies on the browser to accept and forward invalid URLs to <span class=
3320 "APPLICATION">Privoxy</span>)
3321 { +redirect{https://www.privoxy.org/user-manual/actions-file.html} }
3322  a
3323
3324 # Always use the expanded view for Undeadly.org articles
3325 # (Note the $ at the end of the URL pattern to make sure
3326 # the request for the rewritten URL isn't redirected as well)
3327 {+redirect{s@$@&amp;mode=expanded@}}
3328 undeadly.org/cgi\?action=article&amp;sid=\d*$
3329
3330 # Redirect Google search requests to MSN
3331 {+redirect{s@^http://[^/]*/search\?q=([^&amp;]*).*@http://search.msn.com/results.aspx?q=$1@}}
3332 .google.com/search
3333
3334 # Redirect MSN search requests to Yahoo
3335 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&amp;]*).*@http://search.yahoo.com/search?p=$1@}}
3336 search.msn.com//results\.aspx\?q=
3337
3338 # Redirect http://example.com/&amp;bla=fasel&amp;toChange=foo (and any other value but "bar")
3339 # to       http://example.com/&amp;bla=fasel&amp;toChange=bar
3340 #
3341 # The URL pattern makes sure that the following request isn't redirected again.
3342 {+redirect{s@toChange=[^&amp;]+@toChange=bar@}}
3343 example.com/.*toChange=(?!bar)
3344
3345 # Add a shortcut to look up illumos bugs
3346 {+redirect{s@^http://i([0-9]+)/.*@https://www.illumos.org/issues/$1@}}
3347 # Redirected URL = http://i4974/
3348 # Redirect Destination = https://www.illumos.org/issues/4974
3349 i[0-9][0-9][0-9][0-9]*/
3350
3351 # Redirect remote requests for this manual
3352 # to the local version delivered by Privoxy
3353 {+redirect{s@^http://www@http://config@}}
3354 www.privoxy.org/user-manual/</pre>
3355                   </td>
3356                 </tr>
3357               </table>
3358             </dd>
3359           </dl>
3360         </div>
3361       </div>
3362       <div class="SECT3">
3363         <h4 class="SECT3"><a name="SERVER-HEADER-FILTER" id=
3364         "SERVER-HEADER-FILTER">8.5.32. server-header-filter</a></h4>
3365         <div class="VARIABLELIST">
3366           <dl>
3367             <dt>Typical use:</dt>
3368             <dd>
3369               <p>Rewrite or remove single server headers.</p>
3370             </dd>
3371             <dt>Effect:</dt>
3372             <dd>
3373               <p>All server headers to which this action applies are filtered
3374               on-the-fly through the specified regular expression based
3375               substitutions.</p>
3376             </dd>
3377             <dt>Type:</dt>
3378             <dd>
3379               <p>Multi-value.</p>
3380             </dd>
3381             <dt>Parameter:</dt>
3382             <dd>
3383               <p>The name of a server-header filter, as defined in one of the
3384               <a href="filter-file.html">filter files</a>.</p>
3385             </dd>
3386             <dt>Notes:</dt>
3387             <dd>
3388               <p>Server-header filters are applied to each header on its own,
3389               not to all at once. This makes it easier to diagnose problems,
3390               but on the downside you can't write filters that only change
3391               header x if header y's value is z. You can do that by using
3392               tags though.</p>
3393               <p>Server-header filters are executed after the other header
3394               actions have finished and use their output as input.</p>
3395               <p>Please refer to the <a href="filter-file.html">filter file
3396               chapter</a> to learn which server-header filters are available
3397               by default, and how to create your own.</p>
3398             </dd>
3399             <dt>Example usage (section):</dt>
3400             <dd>
3401               <table border="0" bgcolor="#E0E0E0" width="90%">
3402                 <tr>
3403                   <td>
3404                     <pre class="SCREEN">{+server-header-filter{html-to-xml}}
3405 example.org/xml-instance-that-is-delivered-as-html
3406
3407 {+server-header-filter{xml-to-html}}
3408 example.org/instance-that-is-delivered-as-xml-but-is-not
3409     </pre>
3410                   </td>
3411                 </tr>
3412               </table>
3413             </dd>
3414           </dl>
3415         </div>
3416       </div>
3417       <div class="SECT3">
3418         <h4 class="SECT3"><a name="SERVER-HEADER-TAGGER" id=
3419         "SERVER-HEADER-TAGGER">8.5.33. server-header-tagger</a></h4>
3420         <div class="VARIABLELIST">
3421           <dl>
3422             <dt>Typical use:</dt>
3423             <dd>
3424               <p>Enable or disable filters based on the Content-Type
3425               header.</p>
3426             </dd>
3427             <dt>Effect:</dt>
3428             <dd>
3429               <p>Server headers to which this action applies are filtered
3430               on-the-fly through the specified regular expression based
3431               substitutions, the result is used as tag.</p>
3432             </dd>
3433             <dt>Type:</dt>
3434             <dd>
3435               <p>Multi-value.</p>
3436             </dd>
3437             <dt>Parameter:</dt>
3438             <dd>
3439               <p>The name of a server-header tagger, as defined in one of the
3440               <a href="filter-file.html">filter files</a>.</p>
3441             </dd>
3442             <dt>Notes:</dt>
3443             <dd>
3444               <p>Server-header taggers are applied to each header on its own,
3445               and as the header isn't modified, each tagger <span class=
3446               "QUOTE">"sees"</span> the original.</p>
3447               <p>Server-header taggers are executed before all other header
3448               actions that modify server headers. Their tags can be used to
3449               control all of the other server-header actions, the content
3450               filters and the crunch actions (<a href=
3451               "actions-file.html#REDIRECT">redirect</a> and <a href=
3452               "actions-file.html#BLOCK">block</a>).</p>
3453               <p>Obviously crunching based on tags created by server-header
3454               taggers doesn't prevent the request from showing up in the
3455               server's log file.</p>
3456             </dd>
3457             <dt>Example usage (section):</dt>
3458             <dd>
3459               <table border="0" bgcolor="#E0E0E0" width="90%">
3460                 <tr>
3461                   <td>
3462                     <pre class="SCREEN">
3463                     # Tag every request with the content type declared by the server
3464 {+server-header-tagger{content-type}}
3465 /
3466
3467 # If the response has a tag starting with 'image/' enable an external
3468 # filter that only applies to images.
3469 #
3470 # Note that the filter is not available by default, it's just a
3471 # <tt class="LITERAL"><a href=
3472 "filter-file.html#EXTERNAL-FILTER-SYNTAX">silly example</a></tt>.
3473 {+external-filter{rotate-image} +force-text-mode}
3474 TAG:^image/
3475     </pre>
3476                   </td>
3477                 </tr>
3478               </table>
3479             </dd>
3480           </dl>
3481         </div>
3482       </div>
3483       <div class="SECT3">
3484         <h4 class="SECT3"><a name="SESSION-COOKIES-ONLY" id=
3485         "SESSION-COOKIES-ONLY">8.5.34. session-cookies-only</a></h4>
3486         <div class="VARIABLELIST">
3487           <dl>
3488             <dt>Typical use:</dt>
3489             <dd>
3490               <p>Allow only temporary <span class="QUOTE">"session"</span>
3491               cookies (for the current browser session <span class=
3492               "emphasis"><i class="EMPHASIS">only</i></span>).</p>
3493             </dd>
3494             <dt>Effect:</dt>
3495             <dd>
3496               <p>Deletes the <span class="QUOTE">"expires"</span> field from
3497               <span class="QUOTE">"Set-Cookie:"</span> server headers. Most
3498               browsers will not store such cookies permanently and forget
3499               them in between sessions.</p>
3500             </dd>
3501             <dt>Type:</dt>
3502             <dd>
3503               <p>Boolean.</p>
3504             </dd>
3505             <dt>Parameter:</dt>
3506             <dd>
3507               <p>N/A</p>
3508             </dd>
3509             <dt>Notes:</dt>
3510             <dd>
3511               <p>This is less strict than <tt class="LITERAL"><a href=
3512               "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>
3513               / <tt class="LITERAL"><a href=
3514               "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>
3515               and allows you to browse websites that insist or rely on
3516               setting cookies, without compromising your privacy too
3517               badly.</p>
3518               <p>Most browsers will not permanently store cookies that have
3519               been processed by <tt class="LITERAL">session-cookies-only</tt>
3520               and will forget about them between sessions. This makes
3521               profiling cookies useless, but won't break sites which require
3522               cookies so that you can log in for transactions. This is
3523               generally turned on for all sites, and is the recommended
3524               setting.</p>
3525               <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
3526               at all</i></span> to use <tt class=
3527               "LITERAL">session-cookies-only</tt> together with <tt class=
3528               "LITERAL"><a href=
3529               "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>
3530               or <tt class="LITERAL"><a href=
3531               "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>.
3532               If you do, cookies will be plainly killed.</p>
3533               <p>Note that it is up to the browser how it handles such
3534               cookies without an <span class="QUOTE">"expires"</span> field.
3535               If you use an exotic browser, you might want to try it out to
3536               be sure.</p>
3537               <p>This setting also has no effect on cookies that may have
3538               been stored previously by the browser before starting
3539               <span class="APPLICATION">Privoxy</span>. These would have to
3540               be removed manually.</p>
3541               <p><span class="APPLICATION">Privoxy</span> also uses the
3542               <a href=
3543               "actions-file.html#FILTER-CONTENT-COOKIES">content-cookies
3544               filter</a> to block some types of cookies. Content cookies are
3545               not effected by <tt class=
3546               "LITERAL">session-cookies-only</tt>.</p>
3547             </dd>
3548             <dt>Example usage:</dt>
3549             <dd>
3550               <table border="0" bgcolor="#E0E0E0" width="90%">
3551                 <tr>
3552                   <td>
3553                     <pre class="SCREEN">+session-cookies-only</pre>
3554                   </td>
3555                 </tr>
3556               </table>
3557             </dd>
3558           </dl>
3559         </div>
3560       </div>
3561       <div class="SECT3">
3562         <h4 class="SECT3"><a name="SET-IMAGE-BLOCKER" id=
3563         "SET-IMAGE-BLOCKER">8.5.35. set-image-blocker</a></h4>
3564         <div class="VARIABLELIST">
3565           <dl>
3566             <dt>Typical use:</dt>
3567             <dd>
3568               <p>Choose the replacement for blocked images</p>
3569             </dd>
3570             <dt>Effect:</dt>
3571             <dd>
3572               <p>This action alone doesn't do anything noticeable. If
3573               <span class="emphasis"><i class="EMPHASIS">both</i></span>
3574               <tt class="LITERAL"><a href=
3575               "actions-file.html#BLOCK">block</a></tt> <span class=
3576               "emphasis"><i class="EMPHASIS">and</i></span> <tt class=
3577               "LITERAL"><a href=
3578               "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>
3579               <span class="emphasis"><i class="EMPHASIS">also</i></span>
3580               apply, i.e. if the request is to be blocked as an image,
3581               <span class="emphasis"><i class="EMPHASIS">then</i></span> the
3582               parameter of this action decides what will be sent as a
3583               replacement.</p>
3584             </dd>
3585             <dt>Type:</dt>
3586             <dd>
3587               <p>Parameterized.</p>
3588             </dd>
3589             <dt>Parameter:</dt>
3590             <dd>
3591               <ul>
3592                 <li>
3593                   <p><span class="QUOTE">"pattern"</span> to send a built-in
3594                   checkerboard pattern image. The image is visually decent,
3595                   scales very well, and makes it obvious where banners were
3596                   busted.</p>
3597                 </li>
3598                 <li>
3599                   <p><span class="QUOTE">"blank"</span> to send a built-in
3600                   transparent image. This makes banners disappear completely,
3601                   but makes it hard to detect where <span class=
3602                   "APPLICATION">Privoxy</span> has blocked images on a given
3603                   page and complicates troubleshooting if <span class=
3604                   "APPLICATION">Privoxy</span> has blocked innocent images,
3605                   like navigation icons.</p>
3606                 </li>
3607                 <li>
3608                   <p><span class="QUOTE">"<tt class=
3609                   "REPLACEABLE"><i>target-url</i></tt>"</span> to send a
3610                   redirect to <tt class="REPLACEABLE"><i>target-url</i></tt>.
3611                   You can redirect to any image anywhere, even in your local
3612                   filesystem via <span class="QUOTE">"file:///"</span> URL.
3613                   (But note that not all browsers support redirecting to a
3614                   local file system).</p>
3615                   <p>A good application of redirects is to use special
3616                   <span class="APPLICATION">Privoxy</span>-built-in URLs,
3617                   which send the built-in images, as <tt class=
3618                   "REPLACEABLE"><i>target-url</i></tt>. This has the same
3619                   visual effect as specifying <span class=
3620                   "QUOTE">"blank"</span> or <span class=
3621                   "QUOTE">"pattern"</span> in the first place, but enables
3622                   your browser to cache the replacement image, instead of
3623                   requesting it over and over again.</p>
3624                 </li>
3625               </ul>
3626             </dd>
3627             <dt>Notes:</dt>
3628             <dd>
3629               <p>The URLs for the built-in images are <span class=
3630               "QUOTE">"http://config.privoxy.org/send-banner?type=<tt class=
3631               "REPLACEABLE"><i>type</i></tt>"</span>, where <tt class=
3632               "REPLACEABLE"><i>type</i></tt> is either <span class=
3633               "QUOTE">"blank"</span> or <span class=
3634               "QUOTE">"pattern"</span>.</p>
3635               <p>There is a third (advanced) type, called <span class=
3636               "QUOTE">"auto"</span>. It is <span class="emphasis"><i class=
3637               "EMPHASIS">NOT</i></span> to be used in <tt class=
3638               "LITERAL">set-image-blocker</tt>, but meant for use from
3639               <a href="filter-file.html">filters</a>. Auto will select the
3640               type of image that would have applied to the referring page,
3641               had it been an image.</p>
3642             </dd>
3643             <dt>Example usage:</dt>
3644             <dd>
3645               <p>Built-in pattern:</p>
3646               <table border="0" bgcolor="#E0E0E0" width="90%">
3647                 <tr>
3648                   <td>
3649                     <pre class="SCREEN">+set-image-blocker{pattern}</pre>
3650                   </td>
3651                 </tr>
3652               </table>
3653               <p>Redirect to the BSD daemon:</p>
3654               <table border="0" bgcolor="#E0E0E0" width="90%">
3655                 <tr>
3656                   <td>
3657                     <pre class="SCREEN">
3658                     +set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</pre>
3659                   </td>
3660                 </tr>
3661               </table>
3662               <p>Redirect to the built-in pattern for better caching:</p>
3663               <table border="0" bgcolor="#E0E0E0" width="90%">
3664                 <tr>
3665                   <td>
3666                     <pre class="SCREEN">
3667                     +set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</pre>
3668                   </td>
3669                 </tr>
3670               </table>
3671             </dd>
3672           </dl>
3673         </div>
3674       </div>
3675       <div class="SECT3">
3676         <h3 class="SECT3"><a name="SUMMARY" id="SUMMARY">8.5.36.
3677         Summary</a></h3>
3678         <p>Note that many of these actions have the potential to cause a page
3679         to misbehave, possibly even not to display at all. There are many
3680         ways a site designer may choose to design his site, and what HTTP
3681         header content, and other criteria, he may depend on. There is no way
3682         to have hard and fast rules for all sites. See the <a href=
3683         "appendix.html#ACTIONSANAT">Appendix</a> for a brief example on
3684         troubleshooting actions.</p>
3685       </div>
3686     </div>
3687     <div class="SECT2">
3688       <h2 class="SECT2"><a name="ALIASES" id="ALIASES">8.6. Aliases</a></h2>
3689       <p>Custom <span class="QUOTE">"actions"</span>, known to <span class=
3690       "APPLICATION">Privoxy</span> as <span class="QUOTE">"aliases"</span>,
3691       can be defined by combining other actions. These can in turn be invoked
3692       just like the built-in actions. Currently, an alias name can contain
3693       any character except space, tab, <span class="QUOTE">"="</span>,
3694       <span class="QUOTE">"{"</span> and <span class="QUOTE">"}"</span>, but
3695       we <span class="emphasis"><i class="EMPHASIS">strongly
3696       recommend</i></span> that you only use <span class="QUOTE">"a"</span>
3697       to <span class="QUOTE">"z"</span>, <span class="QUOTE">"0"</span> to
3698       <span class="QUOTE">"9"</span>, <span class="QUOTE">"+"</span>, and
3699       <span class="QUOTE">"-"</span>. Alias names are not case sensitive, and
3700       are not required to start with a <span class="QUOTE">"+"</span> or
3701       <span class="QUOTE">"-"</span> sign, since they are merely textually
3702       expanded.</p>
3703       <p>Aliases can be used throughout the actions file, but they
3704       <span class="emphasis"><i class="EMPHASIS">must be defined in a special
3705       section at the top of the file!</i></span> And there can only be one
3706       such section per actions file. Each actions file may have its own alias
3707       section, and the aliases defined in it are only visible within that
3708       file.</p>
3709       <p>There are two main reasons to use aliases: One is to save typing for
3710       frequently used combinations of actions, the other one is a gain in
3711       flexibility: If you decide once how you want to handle shops by
3712       defining an alias called <span class="QUOTE">"shop"</span>, you can
3713       later change your policy on shops in <span class="emphasis"><i class=
3714       "EMPHASIS">one</i></span> place, and your changes will take effect
3715       everywhere in the actions file where the <span class=
3716       "QUOTE">"shop"</span> alias is used. Calling aliases by their purpose
3717       also makes your actions files more readable.</p>
3718       <p>Currently, there is one big drawback to using aliases, though:
3719       <span class="APPLICATION">Privoxy</span>'s built-in web-based action
3720       file editor honors aliases when reading the actions files, but it
3721       expands them before writing. So the effects of your aliases are of
3722       course preserved, but the aliases themselves are lost when you edit
3723       sections that use aliases with it.</p>
3724       <p>Now let's define some aliases...</p>
3725       <table border="0" bgcolor="#E0E0E0" width="100%">
3726         <tr>
3727           <td>
3728             <pre class="SCREEN"> # Useful custom aliases we can use later.
3729  #
3730  # Note the (required!) section header line and that this section
3731  # must be at the top of the actions file!
3732  #
3733  {{alias}}
3734
3735  # These aliases just save typing later:
3736  # (Note that some already use other aliases!)
3737  #
3738  +crunch-all-cookies = +<a href=
3739 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a> +<a href="actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a>
3740  -crunch-all-cookies = -<a href=
3741 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a> -<a href="actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a>
3742  +block-as-image      = +block{Blocked image.} +handle-as-image
3743  allow-all-cookies   = -crunch-all-cookies -<a href=
3744 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a> -<a href=
3745 "actions-file.html#FILTER-CONTENT-COOKIES">filter{content-cookies}</a>
3746
3747  # These aliases define combinations of actions
3748  # that are useful for certain types of sites:
3749  #
3750  fragile     = -<a href="actions-file.html#BLOCK">block</a> -<a href=
3751 "actions-file.html#FILTER">filter</a> -crunch-all-cookies -<a href=
3752 "actions-file.html#FAST-REDIRECTS">fast-redirects</a> -<a href=
3753 "actions-file.html#HIDE-REFERER">hide-referrer</a> -<a href=
3754 "actions-file.html#PREVENT-COMPRESSION">prevent-compression</a>
3755
3756  shop        = -crunch-all-cookies -<a href=
3757 "actions-file.html#FILTER-ALL-POPUPS">filter{all-popups}</a>
3758
3759  # Short names for other aliases, for really lazy people ;-)
3760  #
3761  c0 = +crunch-all-cookies
3762  c1 = -crunch-all-cookies</pre>
3763           </td>
3764         </tr>
3765       </table>
3766       <p>...and put them to use. These sections would appear in the lower
3767       part of an actions file and define exceptions to the default actions
3768       (as specified further up for the <span class="QUOTE">"/"</span>
3769       pattern):</p>
3770       <table border="0" bgcolor="#E0E0E0" width="100%">
3771         <tr>
3772           <td>
3773             <pre class="SCREEN">
3774             # These sites are either very complex or very keen on
3775  # user data and require minimal interference to work:
3776  #
3777  {fragile}
3778  .office.microsoft.com
3779  .windowsupdate.microsoft.com
3780  # Gmail is really mail.google.com, not gmail.com
3781  mail.google.com
3782
3783  # Shopping sites:
3784  # Allow cookies (for setting and retrieving your customer data)
3785  #
3786  {shop}
3787  .quietpc.com
3788  .worldpay.com   # for quietpc.com
3789  mybank.example.com
3790
3791  # These shops require pop-ups:
3792  #
3793  {-filter{all-popups} -filter{unsolicited-popups}}
3794   .dabs.com
3795   .overclockers.co.uk</pre>
3796           </td>
3797         </tr>
3798       </table>
3799       <p>Aliases like <span class="QUOTE">"shop"</span> and <span class=
3800       "QUOTE">"fragile"</span> are typically used for <span class=
3801       "QUOTE">"problem"</span> sites that require more than one action to be
3802       disabled in order to function properly.</p>
3803     </div>
3804     <div class="SECT2">
3805       <h2 class="SECT2"><a name="ACT-EXAMPLES" id="ACT-EXAMPLES">8.7. Actions
3806       Files Tutorial</a></h2>
3807       <p>The above chapters have shown <a href="actions-file.html">which
3808       actions files there are and how they are organized</a>, how actions are
3809       <a href="actions-file.html#ACTIONS">specified</a> and <a href=
3810       "actions-file.html#ACTIONS-APPLY">applied to URLs</a>, how <a href=
3811       "actions-file.html#AF-PATTERNS">patterns</a> work, and how to define
3812       and use <a href="actions-file.html#ALIASES">aliases</a>. Now, let's
3813       look at an example <tt class="FILENAME">match-all.action</tt>,
3814       <tt class="FILENAME">default.action</tt> and <tt class=
3815       "FILENAME">user.action</tt> file and see how all these pieces come
3816       together:</p>
3817       <div class="SECT3">
3818         <h3 class="SECT3"><a name="MATCH-ALL" id="MATCH-ALL">8.7.1.
3819         match-all.action</a></h3>
3820         <p>Remember <span class="emphasis"><i class="EMPHASIS">all actions
3821         are disabled when matching starts</i></span>, so we have to
3822         explicitly enable the ones we want.</p>
3823         <p>While the <tt class="FILENAME">match-all.action</tt> file only
3824         contains a single section, it is probably the most important one. It
3825         has only one pattern, <span class="QUOTE">"<tt class=
3826         "LITERAL">/</tt>"</span>, but this pattern <a href=
3827         "actions-file.html#AF-PATTERNS">matches all URLs</a>. Therefore, the
3828         set of actions used in this <span class="QUOTE">"default"</span>
3829         section <span class="emphasis"><i class="EMPHASIS">will be applied to
3830         all requests as a start</i></span>. It can be partly or wholly
3831         overridden by other actions files like <tt class=
3832         "FILENAME">default.action</tt> and <tt class=
3833         "FILENAME">user.action</tt>, but it will still be largely responsible
3834         for your overall browsing experience.</p>
3835         <p>Again, at the start of matching, all actions are disabled, so
3836         there is no need to disable any actions here. (Remember: a
3837         <span class="QUOTE">"+"</span> preceding the action name enables the
3838         action, a <span class="QUOTE">"-"</span> disables!). Also note how
3839         this long line has been made more readable by splitting it into
3840         multiple lines with line continuation.</p>
3841         <table border="0" bgcolor="#E0E0E0" width="100%">
3842           <tr>
3843             <td>
3844               <pre class="SCREEN">{ \
3845  +<a href=
3846 "actions-file.html#CHANGE-X-FORWARDED-FOR">change-x-forwarded-for{block}</a> \
3847  +<a href="actions-file.html#HIDE-FROM-HEADER">hide-from-header{block}</a> \
3848  +<a href=
3849 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker{pattern}</a> \
3850 }
3851 / # Match all URLs
3852  </pre>
3853             </td>
3854           </tr>
3855         </table>
3856         <p>The default behavior is now set.</p>
3857       </div>
3858       <div class="SECT3">
3859         <h3 class="SECT3"><a name="DEFAULT-ACTION" id="DEFAULT-ACTION">8.7.2.
3860         default.action</a></h3>
3861         <p>If you aren't a developer, there's no need for you to edit the
3862         <tt class="FILENAME">default.action</tt> file. It is maintained by
3863         the <span class="APPLICATION">Privoxy</span> developers and if you
3864         disagree with some of the sections, you should overrule them in your
3865         <tt class="FILENAME">user.action</tt>.</p>
3866         <p>Understanding the <tt class="FILENAME">default.action</tt> file
3867         can help you with your <tt class="FILENAME">user.action</tt>,
3868         though.</p>
3869         <p>The first section in this file is a special section for internal
3870         use that prevents older <span class="APPLICATION">Privoxy</span>
3871         versions from reading the file:</p>
3872         <table border="0" bgcolor="#E0E0E0" width="100%">
3873           <tr>
3874             <td>
3875               <pre class="SCREEN">
3876               ##########################################################################
3877 # Settings -- Don't change! For internal Privoxy use ONLY.
3878 ##########################################################################
3879 {{settings}}
3880 for-privoxy-version=3.0.11</pre>
3881             </td>
3882           </tr>
3883         </table>
3884         <p>After that comes the (optional) alias section. We'll use the
3885         example section from the above <a href=
3886         "actions-file.html#ALIASES">chapter on aliases</a>, that also
3887         explains why and how aliases are used:</p>
3888         <table border="0" bgcolor="#E0E0E0" width="100%">
3889           <tr>
3890             <td>
3891               <pre class="SCREEN">
3892               ##########################################################################
3893 # Aliases
3894 ##########################################################################
3895 {{alias}}
3896
3897  # These aliases just save typing later:
3898  # (Note that some already use other aliases!)
3899  #
3900  +crunch-all-cookies = +<a href=
3901 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a> +<a href="actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a>
3902  -crunch-all-cookies = -<a href=
3903 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a> -<a href="actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a>
3904  +block-as-image      = +block{Blocked image.} +handle-as-image
3905  mercy-for-cookies   = -crunch-all-cookies -<a href=
3906 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a> -<a href=
3907 "actions-file.html#FILTER-CONTENT-COOKIES">filter{content-cookies}</a>
3908
3909  # These aliases define combinations of actions
3910  # that are useful for certain types of sites:
3911  #
3912  fragile     = -<a href="actions-file.html#BLOCK">block</a> -<a href=
3913 "actions-file.html#FILTER">filter</a> -crunch-all-cookies -<a href=
3914 "actions-file.html#FAST-REDIRECTS">fast-redirects</a> -<a href=
3915 "actions-file.html#HIDE-REFERER">hide-referrer</a>
3916  shop        = -crunch-all-cookies -<a href=
3917 "actions-file.html#FILTER-ALL-POPUPS">filter{all-popups}</a></pre>
3918             </td>
3919           </tr>
3920         </table>
3921         <p>The first of our specialized sections is concerned with
3922         <span class="QUOTE">"fragile"</span> sites, i.e. sites that require
3923         minimum interference, because they are either very complex or very
3924         keen on tracking you (and have mechanisms in place that make them
3925         unusable for people who avoid being tracked). We will simply use our
3926         pre-defined <tt class="LITERAL">fragile</tt> alias instead of stating
3927         the list of actions explicitly:</p>
3928         <table border="0" bgcolor="#E0E0E0" width="100%">
3929           <tr>
3930             <td>
3931               <pre class="SCREEN">
3932               ##########################################################################
3933 # Exceptions for sites that'll break under the default action set:
3934 ##########################################################################
3935
3936 # "Fragile" Use a minimum set of actions for these sites (see alias above):
3937 #
3938 { fragile }
3939 .office.microsoft.com           # surprise, surprise!
3940 .windowsupdate.microsoft.com
3941 mail.google.com</pre>
3942             </td>
3943           </tr>
3944         </table>
3945         <p>Shopping sites are not as fragile, but they typically require
3946         cookies to log in, and pop-up windows for shopping carts or item
3947         details. Again, we'll use a pre-defined alias:</p>
3948         <table border="0" bgcolor="#E0E0E0" width="100%">
3949           <tr>
3950             <td>
3951               <pre class="SCREEN"># Shopping sites:
3952 #
3953 { shop }
3954 .quietpc.com
3955 .worldpay.com   # for quietpc.com
3956 .jungle.com
3957 .scan.co.uk</pre>
3958             </td>
3959           </tr>
3960         </table>
3961         <p>The <tt class="LITERAL"><a href=
3962         "actions-file.html#FAST-REDIRECTS">fast-redirects</a></tt> action,
3963         which may have been enabled in <tt class=
3964         "FILENAME">match-all.action</tt>, breaks some sites. So disable it
3965         for popular sites where we know it misbehaves:</p>
3966         <table border="0" bgcolor="#E0E0E0" width="100%">
3967           <tr>
3968             <td>
3969               <pre class="SCREEN">{ -<a href=
3970               "actions-file.html#FAST-REDIRECTS">fast-redirects</a> }
3971 login.yahoo.com
3972 edit.*.yahoo.com
3973 .google.com
3974 .altavista.com/.*(like|url|link):http
3975 .altavista.com/trans.*urltext=http
3976 .nytimes.com</pre>
3977             </td>
3978           </tr>
3979         </table>
3980         <p>It is important that <span class="APPLICATION">Privoxy</span>
3981         knows which URLs belong to images, so that <span class=
3982         "emphasis"><i class="EMPHASIS">if</i></span> they are to be blocked,
3983         a substitute image can be sent, rather than an HTML page. Contacting
3984         the remote site to find out is not an option, since it would destroy
3985         the loading time advantage of banner blocking, and it would feed the
3986         advertisers information about you. We can mark any URL as an image
3987         with the <tt class="LITERAL"><a href=
3988         "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt> action,
3989         and marking all URLs that end in a known image file extension is a
3990         good start:</p>
3991         <table border="0" bgcolor="#E0E0E0" width="100%">
3992           <tr>
3993             <td>
3994               <pre class="SCREEN">
3995               ##########################################################################
3996 # Images:
3997 ##########################################################################
3998
3999 # Define which file types will be treated as images, in case they get
4000 # blocked further down this file:
4001 #
4002 { +<a href="actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a> }
4003 /.*\.(gif|jpe?g|png|bmp|ico)$</pre>
4004             </td>
4005           </tr>
4006         </table>
4007         <p>And then there are known banner sources. They often use scripts to
4008         generate the banners, so it won't be visible from the URL that the
4009         request is for an image. Hence we block them <span class=
4010         "emphasis"><i class="EMPHASIS">and</i></span> mark them as images in
4011         one go, with the help of our <tt class="LITERAL">+block-as-image</tt>
4012         alias defined above. (We could of course just as well use <tt class=
4013         "LITERAL">+<a href="actions-file.html#BLOCK">block</a> +<a href=
4014         "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt> here.)
4015         Remember that the type of the replacement image is chosen by the
4016         <tt class="LITERAL"><a href=
4017         "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
4018         action. Since all URLs have matched the default section with its
4019         <tt class="LITERAL">+<a href=
4020         "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a>{pattern}</tt>
4021         action before, it still applies and needn't be repeated:</p>
4022         <table border="0" bgcolor="#E0E0E0" width="100%">
4023           <tr>
4024             <td>
4025               <pre class="SCREEN"># Known ad generators:
4026 #
4027 { +block-as-image }
4028 ar.atwola.com
4029 .ad.doubleclick.net
4030 .ad.*.doubleclick.net
4031 .a.yimg.com/(?:(?!/i/).)*$
4032 .a[0-9].yimg.com/(?:(?!/i/).)*$
4033 bs*.gsanet.com
4034 .qkimg.net</pre>
4035             </td>
4036           </tr>
4037         </table>
4038         <p>One of the most important jobs of <span class=
4039         "APPLICATION">Privoxy</span> is to block banners. Many of these can
4040         be <span class="QUOTE">"blocked"</span> by the <tt class=
4041         "LITERAL"><a href=
4042         "actions-file.html#FILTER">filter</a>{banners-by-size}</tt> action,
4043         which we enabled above, and which deletes the references to banner
4044         images from the pages while they are loaded, so the browser doesn't
4045         request them anymore, and hence they don't need to be blocked here.
4046         But this naturally doesn't catch all banners, and some people choose
4047         not to use filters, so we need a comprehensive list of patterns for
4048         banner URLs here, and apply the <tt class="LITERAL"><a href=
4049         "actions-file.html#BLOCK">block</a></tt> action to them.</p>
4050         <p>First comes many generic patterns, which do most of the work, by
4051         matching typical domain and path name components of banners. Then
4052         comes a list of individual patterns for specific sites, which is
4053         omitted here to keep the example short:</p>
4054         <table border="0" bgcolor="#E0E0E0" width="100%">
4055           <tr>
4056             <td>
4057               <pre class="SCREEN">
4058               ##########################################################################
4059 # Block these fine banners:
4060 ##########################################################################
4061 { <a href="actions-file.html#BLOCK">+block{Banner ads.}</a> }
4062
4063 # Generic patterns:
4064 #
4065 ad*.
4066 .*ads.
4067 banner?.
4068 count*.
4069 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
4070 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
4071
4072 # Site-specific patterns (abbreviated):
4073 #
4074 .hitbox.com</pre>
4075             </td>
4076           </tr>
4077         </table>
4078         <p>It's quite remarkable how many advertisers actually call their
4079         banner servers ads.<tt class="REPLACEABLE"><i>company</i></tt>.com,
4080         or call the directory in which the banners are stored simply
4081         <span class="QUOTE">"banners"</span>. So the above generic patterns
4082         are surprisingly effective.</p>
4083         <p>But being very generic, they necessarily also catch URLs that we
4084         don't want to block. The pattern <tt class="LITERAL">.*ads.</tt> e.g.
4085         catches <span class="QUOTE">"nasty-<span class="emphasis"><i class=
4086         "EMPHASIS">ads</i></span>.nasty-corp.com"</span> as intended, but
4087         also <span class="QUOTE">"downlo<span class="emphasis"><i class=
4088         "EMPHASIS">ads</i></span>.sourcefroge.net"</span> or <span class=
4089         "QUOTE">"<span class="emphasis"><i class=
4090         "EMPHASIS">ads</i></span>l.some-provider.net."</span> So here come
4091         some well-known exceptions to the <tt class="LITERAL">+<a href=
4092         "actions-file.html#BLOCK">block</a></tt> section above.</p>
4093         <p>Note that these are exceptions to exceptions from the default!
4094         Consider the URL <span class=
4095         "QUOTE">"downloads.sourcefroge.net"</span>: Initially, all actions
4096         are deactivated, so it wouldn't get blocked. Then comes the defaults
4097         section, which matches the URL, but just deactivates the <tt class=
4098         "LITERAL"><a href="actions-file.html#BLOCK">block</a></tt> action
4099         once again. Then it matches <tt class="LITERAL">.*ads.</tt>, an
4100         exception to the general non-blocking policy, and suddenly <tt class=
4101         "LITERAL"><a href="actions-file.html#BLOCK">+block</a></tt> applies.
4102         And now, it'll match <tt class="LITERAL">.*loads.</tt>, where
4103         <tt class="LITERAL"><a href="actions-file.html#BLOCK">-block</a></tt>
4104         applies, so (unless it matches <span class="emphasis"><i class=
4105         "EMPHASIS">again</i></span> further down) it ends up with no
4106         <tt class="LITERAL"><a href="actions-file.html#BLOCK">block</a></tt>
4107         action applying.</p>
4108         <table border="0" bgcolor="#E0E0E0" width="100%">
4109           <tr>
4110             <td>
4111               <pre class="SCREEN">
4112               ##########################################################################
4113 # Save some innocent victims of the above generic block patterns:
4114 ##########################################################################
4115
4116 # By domain:
4117 #
4118 { -<a href="actions-file.html#BLOCK">block</a> }
4119 adv[io]*.  # (for advogato.org and advice.*)
4120 adsl.      # (has nothing to do with ads)
4121 adobe.     # (has nothing to do with ads either)
4122 ad[ud]*.   # (adult.* and add.*)
4123 .edu       # (universities don't host banners (yet!))
4124 .*loads.   # (downloads, uploads etc)
4125
4126 # By path:
4127 #
4128 /.*loads/
4129
4130 # Site-specific:
4131 #
4132 www.globalintersec.com/adv # (adv = advanced)
4133 www.ugu.com/sui/ugu/adv</pre>
4134             </td>
4135           </tr>
4136         </table>
4137         <p>Filtering source code can have nasty side effects, so make an
4138         exception for our friends at sourceforge.net, and all paths with
4139         <span class="QUOTE">"cvs"</span> in them. Note that <tt class=
4140         "LITERAL">-<a href="actions-file.html#FILTER">filter</a></tt>
4141         disables <span class="emphasis"><i class="EMPHASIS">all</i></span>
4142         filters in one fell swoop!</p>
4143         <table border="0" bgcolor="#E0E0E0" width="100%">
4144           <tr>
4145             <td>
4146               <pre class="SCREEN"># Don't filter code!
4147 #
4148 { -<a href="actions-file.html#FILTER">filter</a> }
4149 /(.*/)?cvs
4150 bugzilla.
4151 developer.
4152 wiki.
4153 .sourceforge.net</pre>
4154             </td>
4155           </tr>
4156         </table>
4157         <p>The actual <tt class="FILENAME">default.action</tt> is of course
4158         much more comprehensive, but we hope this example made clear how it
4159         works.</p>
4160       </div>
4161       <div class="SECT3">
4162         <h3 class="SECT3"><a name="USER-ACTION" id="USER-ACTION">8.7.3.
4163         user.action</a></h3>
4164         <p>So far we are painting with a broad brush by setting general
4165         policies, which would be a reasonable starting point for many people.
4166         Now, you might want to be more specific and have customized rules
4167         that are more suitable to your personal habits and preferences. These
4168         would be for narrowly defined situations like your ISP or your bank,
4169         and should be placed in <tt class="FILENAME">user.action</tt>, which
4170         is parsed after all other actions files and hence has the last word,
4171         over-riding any previously defined actions. <tt class=
4172         "FILENAME">user.action</tt> is also a <span class=
4173         "emphasis"><i class="EMPHASIS">safe</i></span> place for your
4174         personal settings, since <tt class="FILENAME">default.action</tt> is
4175         actively maintained by the <span class="APPLICATION">Privoxy</span>
4176         developers and you'll probably want to install updated versions from
4177         time to time.</p>
4178         <p>So let's look at a few examples of things that one might typically
4179         do in <tt class="FILENAME">user.action</tt>:</p>
4180         <table border="0" bgcolor="#E0E0E0" width="100%">
4181           <tr>
4182             <td>
4183               <pre class="SCREEN">
4184               # My user.action file. &lt;fred@example.com&gt;</pre>
4185             </td>
4186           </tr>
4187         </table>
4188         <p>As <a href="actions-file.html#ALIASES">aliases</a> are local to
4189         the actions file that they are defined in, you can't use the ones
4190         from <tt class="FILENAME">default.action</tt>, unless you repeat them
4191         here:</p>
4192         <table border="0" bgcolor="#E0E0E0" width="100%">
4193           <tr>
4194             <td>
4195               <pre class="SCREEN">
4196               # Aliases are local to the file they are defined in.
4197 # (Re-)define aliases for this file:
4198 #
4199 {{alias}}
4200 #
4201 # These aliases just save typing later, and the alias names should
4202 # be self explanatory.
4203 #
4204 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
4205 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
4206  allow-all-cookies  = -crunch-all-cookies -session-cookies-only
4207  allow-popups       = -filter{all-popups}
4208 +block-as-image     = +block{Blocked as image.} +handle-as-image
4209 -block-as-image     = -block
4210
4211 # These aliases define combinations of actions that are useful for
4212 # certain types of sites:
4213 #
4214 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer
4215 shop        = -crunch-all-cookies allow-popups
4216
4217 # Allow ads for selected useful free sites:
4218 #
4219 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
4220
4221 # Alias for specific file types that are text, but might have conflicting
4222 # MIME types. We want the browser to force these to be text documents.
4223 handle-as-text = -<a href="actions-file.html#FILTER">filter</a> +-<a href=
4224 "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite{text/plain}</a> +-<a href="actions-file.html#FORCE-TEXT-MODE">force-text-mode</a> -<a href="actions-file.html#HIDE-CONTENT-DISPOSITION">hide-content-disposition</a></pre>
4225             </td>
4226           </tr>
4227         </table>
4228         <p>Say you have accounts on some sites that you visit regularly, and
4229         you don't want to have to log in manually each time. So you'd like to
4230         allow persistent cookies for these sites. The <tt class=
4231         "LITERAL">allow-all-cookies</tt> alias defined above does exactly
4232         that, i.e. it disables crunching of cookies in any direction, and the
4233         processing of cookies to make them only temporary.</p>
4234         <table border="0" bgcolor="#E0E0E0" width="100%">
4235           <tr>
4236             <td>
4237               <pre class="SCREEN">{ allow-all-cookies }
4238  sourceforge.net
4239  .yahoo.com
4240  .msdn.microsoft.com
4241  .redhat.com</pre>
4242             </td>
4243           </tr>
4244         </table>
4245         <p>Your bank is allergic to some filter, but you don't know which, so
4246         you disable them all:</p>
4247         <table border="0" bgcolor="#E0E0E0" width="100%">
4248           <tr>
4249             <td>
4250               <pre class="SCREEN">{ -<a href=
4251               "actions-file.html#FILTER">filter</a> }
4252  .your-home-banking-site.com</pre>
4253             </td>
4254           </tr>
4255         </table>
4256         <p>Some file types you may not want to filter for various
4257         reasons:</p>
4258         <table border="0" bgcolor="#E0E0E0" width="100%">
4259           <tr>
4260             <td>
4261               <pre class="SCREEN">
4262               # Technical documentation is likely to contain strings that might
4263 # erroneously get altered by the JavaScript-oriented filters:
4264 #
4265 .tldp.org
4266 /(.*/)?selfhtml/
4267
4268 # And this stupid host sends streaming video with a wrong MIME type,
4269 # so that Privoxy thinks it is getting HTML and starts filtering:
4270 #
4271 stupid-server.example.com/</pre>
4272             </td>
4273           </tr>
4274         </table>
4275         <p>Example of a simple <a href="actions-file.html#BLOCK">block</a>
4276         action. Say you've seen an ad on your favourite page on example.com
4277         that you want to get rid of. You have right-clicked the image,
4278         selected <span class="QUOTE">"copy image location"</span> and pasted
4279         the URL below while removing the leading http://, into a <tt class=
4280         "LITERAL">{ +block{} }</tt> section. Note that <tt class="LITERAL">{
4281         +handle-as-image }</tt> need not be specified, since all URLs ending
4282         in <tt class="LITERAL">.gif</tt> will be tagged as images by the
4283         general rules as set in default.action anyway:</p>
4284         <table border="0" bgcolor="#E0E0E0" width="100%">
4285           <tr>
4286             <td>
4287               <pre class="SCREEN">{ +<a href=
4288               "actions-file.html#BLOCK">block</a>{Nasty ads.} }
4289  www.example.com/nasty-ads/sponsor\.gif
4290  another.example.net/more/junk/here/</pre>
4291             </td>
4292           </tr>
4293         </table>
4294         <p>The URLs of dynamically generated banners, especially from large
4295         banner farms, often don't use the well-known image file name
4296         extensions, which makes it impossible for <span class=
4297         "APPLICATION">Privoxy</span> to guess the file type just by looking
4298         at the URL. You can use the <tt class="LITERAL">+block-as-image</tt>
4299         alias defined above for these cases. Note that objects which match
4300         this rule but then turn out NOT to be an image are typically rendered
4301         as a <span class="QUOTE">"broken image"</span> icon by the browser.
4302         Use cautiously.</p>
4303         <table border="0" bgcolor="#E0E0E0" width="100%">
4304           <tr>
4305             <td>
4306               <pre class="SCREEN">{ +block-as-image }
4307  .doubleclick.net
4308  .fastclick.net
4309  /Realmedia/ads/
4310  ar.atwola.com/</pre>
4311             </td>
4312           </tr>
4313         </table>
4314         <p>Now you noticed that the default configuration breaks Forbes
4315         Magazine, but you were too lazy to find out which action is the
4316         culprit, and you were again too lazy to give <a href=
4317         "contact.html">feedback</a>, so you just used the <tt class=
4318         "LITERAL">fragile</tt> alias on the site, and -- <span class=
4319         "emphasis"><i class="EMPHASIS">whoa!</i></span> -- it worked. The
4320         <tt class="LITERAL">fragile</tt> aliases disables those actions that
4321         are most likely to break a site. Also, good for testing purposes to
4322         see if it is <span class="APPLICATION">Privoxy</span> that is causing
4323         the problem or not. We later find other regular sites that misbehave,
4324         and add those to our personalized list of troublemakers:</p>
4325         <table border="0" bgcolor="#E0E0E0" width="100%">
4326           <tr>
4327             <td>
4328               <pre class="SCREEN">{ fragile }
4329  .forbes.com
4330  webmail.example.com
4331  .mybank.com</pre>
4332             </td>
4333           </tr>
4334         </table>
4335         <p>You like the <span class="QUOTE">"fun"</span> text replacements in
4336         <tt class="FILENAME">default.filter</tt>, but it is disabled in the
4337         distributed actions file. So you'd like to turn it on in your
4338         private, update-safe config, once and for all:</p>
4339         <table border="0" bgcolor="#E0E0E0" width="100%">
4340           <tr>
4341             <td>
4342               <pre class="SCREEN">{ +<a href=
4343               "actions-file.html#FILTER-FUN">filter{fun}</a> }
4344  / # For ALL sites!</pre>
4345             </td>
4346           </tr>
4347         </table>
4348         <p>Note that the above is not really a good idea: There are
4349         exceptions to the filters in <tt class="FILENAME">default.action</tt>
4350         for things that really shouldn't be filtered, like code on
4351         CVS-&gt;Web interfaces. Since <tt class="FILENAME">user.action</tt>
4352         has the last word, these exceptions won't be valid for the
4353         <span class="QUOTE">"fun"</span> filtering specified here.</p>
4354         <p>You might also worry about how your favourite free websites are
4355         funded, and find that they rely on displaying banner advertisements
4356         to survive. So you might want to specifically allow banners for those
4357         sites that you feel provide value to you:</p>
4358         <table border="0" bgcolor="#E0E0E0" width="100%">
4359           <tr>
4360             <td>
4361               <pre class="SCREEN">{ allow-ads }
4362  .sourceforge.net
4363  .slashdot.org
4364  .osdn.net</pre>
4365             </td>
4366           </tr>
4367         </table>
4368         <p>Note that <tt class="LITERAL">allow-ads</tt> has been aliased to
4369         <tt class="LITERAL">-<a href=
4370         "actions-file.html#BLOCK">block</a></tt>, <tt class=
4371         "LITERAL">-<a href=
4372         "actions-file.html#FILTER-BANNERS-BY-SIZE">filter{banners-by-size}</a></tt>,
4373         and <tt class="LITERAL">-<a href=
4374         "actions-file.html#FILTER-BANNERS-BY-LINK">filter{banners-by-link}</a></tt>
4375         above.</p>
4376         <p>Invoke another alias here to force an over-ride of the MIME type
4377         <tt class="LITERAL">application/x-sh</tt> which typically would open
4378         a download type dialog. In my case, I want to look at the shell
4379         script, and then I can save it should I choose to.</p>
4380         <table border="0" bgcolor="#E0E0E0" width="100%">
4381           <tr>
4382             <td>
4383               <pre class="SCREEN">{ handle-as-text }
4384  /.*\.sh$</pre>
4385             </td>
4386           </tr>
4387         </table>
4388         <p><tt class="FILENAME">user.action</tt> is generally the best place
4389         to define exceptions and additions to the default policies of
4390         <tt class="FILENAME">default.action</tt>. Some actions are safe to
4391         have their default policies set here though. So let's set a default
4392         policy to have a <span class="QUOTE">"blank"</span> image as opposed
4393         to the checkerboard pattern for <span class="emphasis"><i class=
4394         "EMPHASIS">ALL</i></span> sites. <span class="QUOTE">"/"</span> of
4395         course matches all URL paths and patterns:</p>
4396         <table border="0" bgcolor="#E0E0E0" width="100%">
4397           <tr>
4398             <td>
4399               <pre class="SCREEN">{ +<a href=
4400               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker{blank}</a> }
4401 / # ALL sites</pre>
4402             </td>
4403           </tr>
4404         </table>
4405       </div>
4406     </div>
4407   </div>
4408   <div class="NAVFOOTER">
4409     <hr align="left" width="100%">
4410     <table summary="Footer navigation table" width="100%" border="0"
4411     cellpadding="0" cellspacing="0">
4412       <tr>
4413         <td width="33%" align="left" valign="top"><a href="config.html"
4414         accesskey="P">Prev</a></td>
4415         <td width="34%" align="center" valign="top"><a href="index.html"
4416         accesskey="H">Home</a></td>
4417         <td width="33%" align="right" valign="top"><a href="filter-file.html"
4418         accesskey="N">Next</a></td>
4419       </tr>
4420       <tr>
4421         <td width="33%" align="left" valign="top">The Main Configuration
4422         File</td>
4423         <td width="34%" align="center" valign="top">&nbsp;</td>
4424         <td width="33%" align="right" valign="top">Filter Files</td>
4425       </tr>
4426     </table>
4427   </div>
4428 </body>
4429 </html>