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