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