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