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