993e9ca557a8474c1f9db5842c7ffa1ee82cd54d
[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.22 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.22 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="AEN2891" id="AEN2891"></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="AEN2990" id="AEN2990">8.1. Finding the Right
318       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="AEN2997" id="AEN2997">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="AEN3191" id="AEN3191">8.4.2. The Path
648         Pattern</a></h3>
649
650         <p><span class="APPLICATION">Privoxy</span> uses <span class=
651         "QUOTE">"modern"</span> POSIX 1003.2 <a href=
652         "http://en.wikipedia.org/wiki/Regular_expressions" target=
653         "_top"><span class="QUOTE">"Regular Expressions"</span></a> for
654         matching the path portion (after the slash), and is thus more
655         flexible.</p>
656
657         <p>There is an <a href="appendix.html#REGEX">Appendix</a> with a
658         brief quick-start into regular expressions, you also might want to
659         have a look at your operating system's documentation on regular
660         expressions (try <tt class="LITERAL">man re_format</tt>).</p>
661
662         <p>Note that the path pattern is automatically left-anchored at the
663         <span class="QUOTE">"/"</span>, i.e. it matches as if it would start
664         with a <span class="QUOTE">"^"</span> (regular expression speak for
665         the beginning of a line).</p>
666
667         <p>Please also note that matching in the path is <span class=
668         "emphasis"><i class="EMPHASIS">CASE INSENSITIVE</i></span> by
669         default, but you can switch to case sensitive at any point in the
670         pattern by using the <span class="QUOTE">"(?-i)"</span> switch:
671         <tt class="LITERAL">www.example.com/(?-i)PaTtErN.*</tt> will match
672         only documents whose path starts with <tt class=
673         "LITERAL">PaTtErN</tt> in <span class="emphasis"><i class=
674         "EMPHASIS">exactly</i></span> this capitalization.</p>
675
676         <div class="VARIABLELIST">
677           <dl>
678             <dt><tt class="LITERAL">.example.com/.*</tt></dt>
679
680             <dd>
681               <p>Is equivalent to just <span class=
682               "QUOTE">".example.com"</span>, since any documents within that
683               domain are matched with or without the <span class=
684               "QUOTE">".*"</span> regular expression. This is redundant</p>
685             </dd>
686
687             <dt><tt class="LITERAL">.example.com/.*/index.html$</tt></dt>
688
689             <dd>
690               <p>Will match any page in the domain of <span class=
691               "QUOTE">"example.com"</span> that is named <span class=
692               "QUOTE">"index.html"</span>, and that is part of some path. For
693               example, it matches <span class=
694               "QUOTE">"www.example.com/testing/index.html"</span> but NOT
695               <span class="QUOTE">"www.example.com/index.html"</span> because
696               the regular expression called for at least two <span class=
697               "QUOTE">"/'s"</span>, thus the path requirement. It also would
698               match <span class=
699               "QUOTE">"www.example.com/testing/index_html"</span>, because of
700               the special meta-character <span class="QUOTE">"."</span>.</p>
701             </dd>
702
703             <dt><tt class="LITERAL">.example.com/(.*/)?index\.html$</tt></dt>
704
705             <dd>
706               <p>This regular expression is conditional so it will match any
707               page named <span class="QUOTE">"index.html"</span> regardless
708               of path which in this case can have one or more <span class=
709               "QUOTE">"/'s"</span>. And this one must contain exactly
710               <span class="QUOTE">".html"</span> (but does not have to end
711               with that!).</p>
712             </dd>
713
714             <dt><tt class=
715             "LITERAL">.example.com/(.*/)(ads|banners?|junk)</tt></dt>
716
717             <dd>
718               <p>This regular expression will match any path of <span class=
719               "QUOTE">"example.com"</span> that contains any of the words
720               <span class="QUOTE">"ads"</span>, <span class=
721               "QUOTE">"banner"</span>, <span class="QUOTE">"banners"</span>
722               (because of the <span class="QUOTE">"?"</span>) or <span class=
723               "QUOTE">"junk"</span>. The path does not have to end in these
724               words, just contain them.</p>
725             </dd>
726
727             <dt><tt class=
728             "LITERAL">.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</tt></dt>
729
730             <dd>
731               <p>This is very much the same as above, except now it must end
732               in either <span class="QUOTE">".jpg"</span>, <span class=
733               "QUOTE">".jpeg"</span>, <span class="QUOTE">".gif"</span> or
734               <span class="QUOTE">".png"</span>. So this one is limited to
735               common image formats.</p>
736             </dd>
737           </dl>
738         </div>
739
740         <p>There are many, many good examples to be found in <tt class=
741         "FILENAME">default.action</tt>, and more tutorials below in <a href=
742         "appendix.html#REGEX">Appendix on regular expressions</a>.</p>
743       </div>
744
745       <div class="SECT3">
746         <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The
747         Tag Pattern</a></h3>
748
749         <p>Tag patterns are used to change the applying actions based on the
750         request's tags. Tags can be created with either the <a href=
751         "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or
752         the <a href=
753         "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
754         action.</p>
755
756         <p>Tag patterns have to start with <span class="QUOTE">"TAG:"</span>,
757         so <span class="APPLICATION">Privoxy</span> can tell them apart from
758         URL patterns. Everything after the colon including white space, is
759         interpreted as a regular expression with path pattern syntax, except
760         that tag patterns aren't left-anchored automatically (<span class=
761         "APPLICATION">Privoxy</span> doesn't silently add a <span class=
762         "QUOTE">"^"</span>, you have to do it yourself if you need it).</p>
763
764         <p>To match all requests that are tagged with <span class=
765         "QUOTE">"foo"</span> your pattern line should be <span class=
766         "QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span>
767         would work as well, but it would also match requests whose tags
768         contain <span class="QUOTE">"foo"</span> somewhere. <span class=
769         "QUOTE">"TAG: foo"</span> wouldn't work as it requires white
770         space.</p>
771
772         <p>Sections can contain URL and tag patterns at the same time, but
773         tag patterns are checked after the URL patterns and thus always
774         overrule them, even if they are located before the URL patterns.</p>
775
776         <p>Once a new tag is added, Privoxy checks right away if it's matched
777         by one of the tag patterns and updates the action settings
778         accordingly. As a result tags can be used to activate other tagger
779         actions, as long as these other taggers look for headers that haven't
780         already be parsed.</p>
781
782         <p>For example you could tag client requests which use the <tt class=
783         "LITERAL">POST</tt> method, then use this tag to activate another
784         tagger that adds a tag if cookies are sent, and then use a block
785         action based on the cookie tag. This allows the outcome of one
786         action, to be input into a subsequent action. However if you'd
787         reverse the position of the described taggers, and activated the
788         method tagger based on the cookie tagger, no method tags would be
789         created. The method tagger would look for the request line, but at
790         the time the cookie tag is created, the request line has already been
791         parsed.</p>
792
793         <p>While this is a limitation you should be aware of, this kind of
794         indirection is seldom needed anyway and even the example doesn't make
795         too much sense.</p>
796       </div>
797
798       <div class="SECT3">
799         <h3 class="SECT3"><a name="NEGATIVE-TAG-PATTERNS" id=
800         "NEGATIVE-TAG-PATTERNS">8.4.4. The Negative Tag Patterns</a></h3>
801
802         <p>To match requests that do not have a certain tag, specify a
803         negative tag pattern by prefixing the tag pattern line with either
804         <span class="QUOTE">"NO-REQUEST-TAG:"</span> or <span class=
805         "QUOTE">"NO-RESPONSE-TAG:"</span> instead of <span class=
806         "QUOTE">"TAG:"</span>.</p>
807
808         <p>Negative tag patterns created with <span class=
809         "QUOTE">"NO-REQUEST-TAG:"</span> are checked after all client headers
810         are scanned, the ones created with <span class=
811         "QUOTE">"NO-RESPONSE-TAG:"</span> are checked after all server
812         headers are scanned. In both cases all the created tags are
813         considered.</p>
814       </div>
815     </div>
816
817     <div class="SECT2">
818       <h2 class="SECT2"><a name="ACTIONS" id="ACTIONS">8.5. Actions</a></h2>
819
820       <p>All actions are disabled by default, until they are explicitly
821       enabled somewhere in an actions file. Actions are turned on if preceded
822       with a <span class="QUOTE">"+"</span>, and turned off if preceded with
823       a <span class="QUOTE">"-"</span>. So a <tt class="LITERAL">+action</tt>
824       means <span class="QUOTE">"do that action"</span>, e.g. <tt class=
825       "LITERAL">+block</tt> means <span class="QUOTE">"please block URLs that
826       match the following patterns"</span>, and <tt class=
827       "LITERAL">-block</tt> means <span class="QUOTE">"don't block URLs that
828       match the following patterns, even if <tt class="LITERAL">+block</tt>
829       previously applied."</span></p>
830
831       <p>Again, actions are invoked by placing them on a line, enclosed in
832       curly braces and separated by whitespace, like in <tt class=
833       "LITERAL">{+some-action -some-other-action{some-parameter}}</tt>,
834       followed by a list of URL patterns, one per line, to which they apply.
835       Together, the actions line and the following pattern lines make up a
836       section of the actions file.</p>
837
838       <p>Actions fall into three categories:</p>
839
840       <ul>
841         <li>
842           <p>Boolean, i.e the action can only be <span class=
843           "QUOTE">"enabled"</span> or <span class="QUOTE">"disabled"</span>.
844           Syntax:</p>
845
846           <table border="0" bgcolor="#E0E0E0" width="90%">
847             <tr>
848               <td>
849                 <pre class="SCREEN">
850   +<tt class="REPLACEABLE"><i>name</i></tt>        # enable action <tt class=
851 "REPLACEABLE"><i>name</i></tt>
852   -<tt class=
853 "REPLACEABLE"><i>name</i></tt>        # disable action <tt class="REPLACEABLE"><i>name</i></tt>
854 </pre>
855               </td>
856             </tr>
857           </table>
858
859           <p>Example: <tt class="LITERAL">+handle-as-image</tt></p>
860         </li>
861
862         <li>
863           <p>Parameterized, where some value is required in order to enable
864           this type of action. Syntax:</p>
865
866           <table border="0" bgcolor="#E0E0E0" width="90%">
867             <tr>
868               <td>
869                 <pre class="SCREEN">
870   +<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
871 "REPLACEABLE"><i>param</i></tt>}  # enable action and set parameter to <tt class="REPLACEABLE"><i>param</i></tt>,
872                # overwriting parameter from previous match if necessary
873   -<tt class=
874 "REPLACEABLE"><i>name</i></tt>         # disable action. The parameter can be omitted
875 </pre>
876               </td>
877             </tr>
878           </table>
879
880           <p>Note that if the URL matches multiple positive forms of a
881           parameterized action, the last match wins, i.e. the params from
882           earlier matches are simply ignored.</p>
883
884           <p>Example: <tt class="LITERAL">+hide-user-agent{Mozilla/5.0 (X11;
885           U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602
886           Firefox/2.0.0.4}</tt></p>
887         </li>
888
889         <li>
890           <p>Multi-value. These look exactly like parameterized actions, but
891           they behave differently: If the action applies multiple times to
892           the same URL, but with different parameters, <span class=
893           "emphasis"><i class="EMPHASIS">all</i></span> the parameters from
894           <span class="emphasis"><i class="EMPHASIS">all</i></span> matches
895           are remembered. This is used for actions that can be executed for
896           the same request repeatedly, like adding multiple headers, or
897           filtering through multiple filters. Syntax:</p>
898
899           <table border="0" bgcolor="#E0E0E0" width="90%">
900             <tr>
901               <td>
902                 <pre class="SCREEN">
903   +<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
904 "REPLACEABLE"><i>param</i></tt>}   # enable action and add <tt class=
905 "REPLACEABLE"><i>param</i></tt> to the list of parameters
906   -<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
907 "REPLACEABLE"><i>param</i></tt>}   # remove the parameter <tt class=
908 "REPLACEABLE"><i>param</i></tt> from the list of parameters
909                 # If it was the last one left, disable the action.
910   <tt class=
911 "REPLACEABLE"><i>-name</i></tt>          # disable this action completely and remove all parameters from the list
912 </pre>
913               </td>
914             </tr>
915           </table>
916
917           <p>Examples: <tt class="LITERAL">+add-header{X-Fun-Header: Some
918           text}</tt> and <tt class=
919           "LITERAL">+filter{html-annoyances}</tt></p>
920         </li>
921       </ul>
922
923       <p>If nothing is specified in any actions file, no <span class=
924       "QUOTE">"actions"</span> are taken. So in this case <span class=
925       "APPLICATION">Privoxy</span> would just be a normal, non-blocking,
926       non-filtering proxy. You must specifically enable the privacy and
927       blocking features you need (although the provided default actions files
928       will give a good starting point).</p>
929
930       <p>Later defined action sections always over-ride earlier ones of the
931       same type. So exceptions to any rules you make, should come in the
932       latter part of the file (or in a file that is processed later when
933       using multiple actions files such as <tt class=
934       "FILENAME">user.action</tt>). For multi-valued actions, the actions are
935       applied in the order they are specified. Actions files are processed in
936       the order they are defined in <tt class="FILENAME">config</tt> (the
937       default installation has three actions files). It also quite possible
938       for any given URL to match more than one <span class=
939       "QUOTE">"pattern"</span> (because of wildcards and regular
940       expressions), and thus to trigger more than one set of actions! Last
941       match wins.</p>
942
943       <p>The list of valid <span class="APPLICATION">Privoxy</span> actions
944       are:</p>
945
946       <div class="SECT3">
947         <h4 class="SECT3"><a name="ADD-HEADER" id="ADD-HEADER">8.5.1.
948         add-header</a></h4>
949
950         <div class="VARIABLELIST">
951           <dl>
952             <dt>Typical use:</dt>
953
954             <dd>
955               <p>Confuse log analysis, custom applications</p>
956             </dd>
957
958             <dt>Effect:</dt>
959
960             <dd>
961               <p>Sends a user defined HTTP header to the web server.</p>
962             </dd>
963
964             <dt>Type:</dt>
965
966             <dd>
967               <p>Multi-value.</p>
968             </dd>
969
970             <dt>Parameter:</dt>
971
972             <dd>
973               <p>Any string value is possible. Validity of the defined HTTP
974               headers is not checked. It is recommended that you use the
975               <span class="QUOTE">"<tt class="LITERAL">X-</tt>"</span> prefix
976               for custom headers.</p>
977             </dd>
978
979             <dt>Notes:</dt>
980
981             <dd>
982               <p>This action may be specified multiple times, in order to
983               define multiple headers. This is rarely needed for the typical
984               user. If you don't know what <span class="QUOTE">"HTTP
985               headers"</span> are, you definitely don't need to worry about
986               this one.</p>
987
988               <p>Headers added by this action are not modified by other
989               actions.</p>
990             </dd>
991
992             <dt>Example usage:</dt>
993
994             <dd>
995               <table border="0" bgcolor="#E0E0E0" width="90%">
996                 <tr>
997                   <td>
998                     <pre class="SCREEN">
999 +add-header{X-User-Tracking: sucks}
1000 </pre>
1001                   </td>
1002                 </tr>
1003               </table>
1004             </dd>
1005           </dl>
1006         </div>
1007       </div>
1008
1009       <div class="SECT3">
1010         <h4 class="SECT3"><a name="BLOCK" id="BLOCK">8.5.2. block</a></h4>
1011
1012         <div class="VARIABLELIST">
1013           <dl>
1014             <dt>Typical use:</dt>
1015
1016             <dd>
1017               <p>Block ads or other unwanted content</p>
1018             </dd>
1019
1020             <dt>Effect:</dt>
1021
1022             <dd>
1023               <p>Requests for URLs to which this action applies are blocked,
1024               i.e. the requests are trapped by <span class=
1025               "APPLICATION">Privoxy</span> and the requested URL is never
1026               retrieved, but is answered locally with a substitute page or
1027               image, as determined by the <tt class="LITERAL"><a href=
1028               "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
1029               <tt class="LITERAL"><a href=
1030               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>,
1031               and <tt class="LITERAL"><a href=
1032               "actions-file.html#HANDLE-AS-EMPTY-DOCUMENT">handle-as-empty-document</a></tt>
1033               actions.</p>
1034             </dd>
1035
1036             <dt>Type:</dt>
1037
1038             <dd>
1039               <p>Parameterized.</p>
1040             </dd>
1041
1042             <dt>Parameter:</dt>
1043
1044             <dd>
1045               <p>A block reason that should be given to the user.</p>
1046             </dd>
1047
1048             <dt>Notes:</dt>
1049
1050             <dd>
1051               <p><span class="APPLICATION">Privoxy</span> sends a special
1052               <span class="QUOTE">"BLOCKED"</span> page for requests to
1053               blocked pages. This page contains the block reason given as
1054               parameter, a link to find out why the block action applies, and
1055               a click-through to the blocked content (the latter only if the
1056               force feature is available and enabled).</p>
1057
1058               <p>A very important exception occurs if <span class=
1059               "emphasis"><i class="EMPHASIS">both</i></span> <tt class=
1060               "LITERAL">block</tt> and <tt class="LITERAL"><a href=
1061               "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
1062               apply to the same request: it will then be replaced by an
1063               image. If <tt class="LITERAL"><a href=
1064               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
1065               (see below) also applies, the type of image will be determined
1066               by its parameter, if not, the standard checkerboard pattern is
1067               sent.</p>
1068
1069               <p>It is important to understand this process, in order to
1070               understand how <span class="APPLICATION">Privoxy</span> deals
1071               with ads and other unwanted content. Blocking is a core
1072               feature, and one upon which various other features depend.</p>
1073
1074               <p>The <tt class="LITERAL"><a href=
1075               "actions-file.html#FILTER">filter</a></tt> action can perform a
1076               very similar task, by <span class="QUOTE">"blocking"</span>
1077               banner images and other content through rewriting the relevant
1078               URLs in the document's HTML source, so they don't get requested
1079               in the first place. Note that this is a totally different
1080               technique, and it's easy to confuse the two.</p>
1081             </dd>
1082
1083             <dt>Example usage (section):</dt>
1084
1085             <dd>
1086               <table border="0" bgcolor="#E0E0E0" width="90%">
1087                 <tr>
1088                   <td>
1089                     <pre class="SCREEN">
1090 {+block{No nasty stuff for you.}}
1091 # Block and replace with "blocked" page
1092  .nasty-stuff.example.com
1093
1094 {+block{Doubleclick banners.} +handle-as-image}
1095 # Block and replace with image
1096  .ad.doubleclick.net
1097  .ads.r.us/banners/
1098
1099 {+block{Layered ads.} +handle-as-empty-document}
1100 # Block and then ignore
1101  adserver.example.net/.*\.js$
1102 </pre>
1103                   </td>
1104                 </tr>
1105               </table>
1106             </dd>
1107           </dl>
1108         </div>
1109       </div>
1110
1111       <div class="SECT3">
1112         <h4 class="SECT3"><a name="CHANGE-X-FORWARDED-FOR" id=
1113         "CHANGE-X-FORWARDED-FOR">8.5.3. change-x-forwarded-for</a></h4>
1114
1115         <div class="VARIABLELIST">
1116           <dl>
1117             <dt>Typical use:</dt>
1118
1119             <dd>
1120               <p>Improve privacy by not forwarding the source of the request
1121               in the HTTP headers.</p>
1122             </dd>
1123
1124             <dt>Effect:</dt>
1125
1126             <dd>
1127               <p>Deletes the <span class="QUOTE">"X-Forwarded-For:"</span>
1128               HTTP header from the client request, or adds a new one.</p>
1129             </dd>
1130
1131             <dt>Type:</dt>
1132
1133             <dd>
1134               <p>Parameterized.</p>
1135             </dd>
1136
1137             <dt>Parameter:</dt>
1138
1139             <dd>
1140               <ul>
1141                 <li>
1142                   <p><span class="QUOTE">"block"</span> to delete the
1143                   header.</p>
1144                 </li>
1145
1146                 <li>
1147                   <p><span class="QUOTE">"add"</span> to create the header
1148                   (or append the client's IP address to an already existing
1149                   one).</p>
1150                 </li>
1151               </ul>
1152             </dd>
1153
1154             <dt>Notes:</dt>
1155
1156             <dd>
1157               <p>It is safe and recommended to use <tt class=
1158               "LITERAL">block</tt>.</p>
1159
1160               <p>Forwarding the source address of the request may make sense
1161               in some multi-user setups but is also a privacy risk.</p>
1162             </dd>
1163
1164             <dt>Example usage:</dt>
1165
1166             <dd>
1167               <table border="0" bgcolor="#E0E0E0" width="90%">
1168                 <tr>
1169                   <td>
1170                     <pre class="SCREEN">
1171 +change-x-forwarded-for{block}
1172 </pre>
1173                   </td>
1174                 </tr>
1175               </table>
1176             </dd>
1177           </dl>
1178         </div>
1179       </div>
1180
1181       <div class="SECT3">
1182         <h4 class="SECT3"><a name="CLIENT-HEADER-FILTER" id=
1183         "CLIENT-HEADER-FILTER">8.5.4. client-header-filter</a></h4>
1184
1185         <div class="VARIABLELIST">
1186           <dl>
1187             <dt>Typical use:</dt>
1188
1189             <dd>
1190               <p>Rewrite or remove single client headers.</p>
1191             </dd>
1192
1193             <dt>Effect:</dt>
1194
1195             <dd>
1196               <p>All client headers to which this action applies are filtered
1197               on-the-fly through the specified regular expression based
1198               substitutions.</p>
1199             </dd>
1200
1201             <dt>Type:</dt>
1202
1203             <dd>
1204               <p>Parameterized.</p>
1205             </dd>
1206
1207             <dt>Parameter:</dt>
1208
1209             <dd>
1210               <p>The name of a client-header filter, as defined in one of the
1211               <a href="filter-file.html">filter files</a>.</p>
1212             </dd>
1213
1214             <dt>Notes:</dt>
1215
1216             <dd>
1217               <p>Client-header filters are applied to each header on its own,
1218               not to all at once. This makes it easier to diagnose problems,
1219               but on the downside you can't write filters that only change
1220               header x if header y's value is z. You can do that by using
1221               tags though.</p>
1222
1223               <p>Client-header filters are executed after the other header
1224               actions have finished and use their output as input.</p>
1225
1226               <p>If the request URI gets changed, <span class=
1227               "APPLICATION">Privoxy</span> will detect that and use the new
1228               one. This can be used to rewrite the request destination behind
1229               the client's back, for example to specify a Tor exit relay for
1230               certain requests.</p>
1231
1232               <p>Please refer to the <a href="filter-file.html">filter file
1233               chapter</a> to learn which client-header filters are available
1234               by default, and how to create your own.</p>
1235             </dd>
1236
1237             <dt>Example usage (section):</dt>
1238
1239             <dd>
1240               <table border="0" bgcolor="#E0E0E0" width="90%">
1241                 <tr>
1242                   <td>
1243                     <pre class="SCREEN">
1244 # Hide Tor exit notation in Host and Referer Headers
1245 {+client-header-filter{hide-tor-exit-notation}}
1246 /
1247
1248 </pre>
1249                   </td>
1250                 </tr>
1251               </table>
1252             </dd>
1253           </dl>
1254         </div>
1255       </div>
1256
1257       <div class="SECT3">
1258         <h4 class="SECT3"><a name="CLIENT-HEADER-TAGGER" id=
1259         "CLIENT-HEADER-TAGGER">8.5.5. client-header-tagger</a></h4>
1260
1261         <div class="VARIABLELIST">
1262           <dl>
1263             <dt>Typical use:</dt>
1264
1265             <dd>
1266               <p>Block requests based on their headers.</p>
1267             </dd>
1268
1269             <dt>Effect:</dt>
1270
1271             <dd>
1272               <p>Client headers to which this action applies are filtered
1273               on-the-fly through the specified regular expression based
1274               substitutions, the result is used as tag.</p>
1275             </dd>
1276
1277             <dt>Type:</dt>
1278
1279             <dd>
1280               <p>Parameterized.</p>
1281             </dd>
1282
1283             <dt>Parameter:</dt>
1284
1285             <dd>
1286               <p>The name of a client-header tagger, as defined in one of the
1287               <a href="filter-file.html">filter files</a>.</p>
1288             </dd>
1289
1290             <dt>Notes:</dt>
1291
1292             <dd>
1293               <p>Client-header taggers are applied to each header on its own,
1294               and as the header isn't modified, each tagger <span class=
1295               "QUOTE">"sees"</span> the original.</p>
1296
1297               <p>Client-header taggers are the first actions that are
1298               executed and their tags can be used to control every other
1299               action.</p>
1300             </dd>
1301
1302             <dt>Example usage (section):</dt>
1303
1304             <dd>
1305               <table border="0" bgcolor="#E0E0E0" width="90%">
1306                 <tr>
1307                   <td>
1308                     <pre class="SCREEN">
1309 # Tag every request with the User-Agent header
1310 {+client-header-tagger{user-agent}}
1311 /
1312
1313 # Tagging itself doesn't change the action
1314 # settings, sections with TAG patterns do:
1315 #
1316 # If it's a download agent, use a different forwarding proxy,
1317 # show the real User-Agent and make sure resume works.
1318 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
1319  -hide-if-modified-since      \
1320  -overwrite-last-modified     \
1321  -hide-user-agent             \
1322  -filter                      \
1323  -deanimate-gifs              \
1324 }
1325 TAG:^User-Agent: NetBSD-ftp/
1326 TAG:^User-Agent: Novell ZYPP Installer
1327 TAG:^User-Agent: RPM APT-HTTP/
1328 TAG:^User-Agent: fetch libfetch/
1329 TAG:^User-Agent: Ubuntu APT-HTTP/
1330 TAG:^User-Agent: MPlayer/
1331
1332 </pre>
1333                   </td>
1334                 </tr>
1335               </table>
1336
1337               <table border="0" bgcolor="#E0E0E0" width="90%">
1338                 <tr>
1339                   <td>
1340                     <pre class="SCREEN">
1341 # Tag all requests with the Range header set
1342 {+client-header-tagger{range-requests}}
1343 /
1344
1345 # Disable filtering for the tagged requests.
1346 #
1347 # With filtering enabled Privoxy would remove the Range headers
1348 # to be able to filter the whole response. The downside is that
1349 # it prevents clients from resuming downloads or skipping over
1350 # parts of multimedia files.
1351 {-filter -deanimate-gifs}
1352 TAG:^RANGE-REQUEST$
1353
1354 </pre>
1355                   </td>
1356                 </tr>
1357               </table>
1358             </dd>
1359           </dl>
1360         </div>
1361       </div>
1362
1363       <div class="SECT3">
1364         <h4 class="SECT3"><a name="CONTENT-TYPE-OVERWRITE" id=
1365         "CONTENT-TYPE-OVERWRITE">8.5.6. content-type-overwrite</a></h4>
1366
1367         <div class="VARIABLELIST">
1368           <dl>
1369             <dt>Typical use:</dt>
1370
1371             <dd>
1372               <p>Stop useless download menus from popping up, or change the
1373               browser's rendering mode</p>
1374             </dd>
1375
1376             <dt>Effect:</dt>
1377
1378             <dd>
1379               <p>Replaces the <span class="QUOTE">"Content-Type:"</span> HTTP
1380               server header.</p>
1381             </dd>
1382
1383             <dt>Type:</dt>
1384
1385             <dd>
1386               <p>Parameterized.</p>
1387             </dd>
1388
1389             <dt>Parameter:</dt>
1390
1391             <dd>
1392               <p>Any string.</p>
1393             </dd>
1394
1395             <dt>Notes:</dt>
1396
1397             <dd>
1398               <p>The <span class="QUOTE">"Content-Type:"</span> HTTP server
1399               header is used by the browser to decide what to do with the
1400               document. The value of this header can cause the browser to
1401               open a download menu instead of displaying the document by
1402               itself, even if the document's format is supported by the
1403               browser.</p>
1404
1405               <p>The declared content type can also affect which rendering
1406               mode the browser chooses. If XHTML is delivered as <span class=
1407               "QUOTE">"text/html"</span>, many browsers treat it as yet
1408               another broken HTML document. If it is send as <span class=
1409               "QUOTE">"application/xml"</span>, browsers with XHTML support
1410               will only display it, if the syntax is correct.</p>
1411
1412               <p>If you see a web site that proudly uses XHTML buttons, but
1413               sets <span class="QUOTE">"Content-Type: text/html"</span>, you
1414               can use <span class="APPLICATION">Privoxy</span> to overwrite
1415               it with <span class="QUOTE">"application/xml"</span> and
1416               validate the web master's claim inside your XHTML-supporting
1417               browser. If the syntax is incorrect, the browser will complain
1418               loudly.</p>
1419
1420               <p>You can also go the opposite direction: if your browser
1421               prints error messages instead of rendering a document falsely
1422               declared as XHTML, you can overwrite the content type with
1423               <span class="QUOTE">"text/html"</span> and have it rendered as
1424               broken HTML document.</p>
1425
1426               <p>By default <tt class="LITERAL">content-type-overwrite</tt>
1427               only replaces <span class="QUOTE">"Content-Type:"</span>
1428               headers that look like some kind of text. If you want to
1429               overwrite it unconditionally, you have to combine it with
1430               <tt class="LITERAL"><a href=
1431               "actions-file.html#FORCE-TEXT-MODE">force-text-mode</a></tt>.
1432               This limitation exists for a reason, think twice before
1433               circumventing it.</p>
1434
1435               <p>Most of the time it's easier to replace this action with a
1436               custom <tt class="LITERAL"><a href=
1437               "actions-file.html#SERVER-HEADER-FILTER">server-header
1438               filter</a></tt>. It allows you to activate it for every
1439               document of a certain site and it will still only replace the
1440               content types you aimed at.</p>
1441
1442               <p>Of course you can apply <tt class=
1443               "LITERAL">content-type-overwrite</tt> to a whole site and then
1444               make URL based exceptions, but it's a lot more work to get the
1445               same precision.</p>
1446             </dd>
1447
1448             <dt>Example usage (sections):</dt>
1449
1450             <dd>
1451               <table border="0" bgcolor="#E0E0E0" width="90%">
1452                 <tr>
1453                   <td>
1454                     <pre class="SCREEN">
1455 # Check if www.example.net/ really uses valid XHTML
1456 { +content-type-overwrite{application/xml} }
1457 www.example.net/
1458
1459 # but leave the content type unmodified if the URL looks like a style sheet
1460 {-content-type-overwrite}
1461 www.example.net/.*\.css$
1462 www.example.net/.*style
1463 </pre>
1464                   </td>
1465                 </tr>
1466               </table>
1467             </dd>
1468           </dl>
1469         </div>
1470       </div>
1471
1472       <div class="SECT3">
1473         <h4 class="SECT3"><a name="CRUNCH-CLIENT-HEADER" id=
1474         "CRUNCH-CLIENT-HEADER">8.5.7. crunch-client-header</a></h4>
1475
1476         <div class="VARIABLELIST">
1477           <dl>
1478             <dt>Typical use:</dt>
1479
1480             <dd>
1481               <p>Remove a client header <span class=
1482               "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1483             </dd>
1484
1485             <dt>Effect:</dt>
1486
1487             <dd>
1488               <p>Deletes every header sent by the client that contains the
1489               string the user supplied as parameter.</p>
1490             </dd>
1491
1492             <dt>Type:</dt>
1493
1494             <dd>
1495               <p>Parameterized.</p>
1496             </dd>
1497
1498             <dt>Parameter:</dt>
1499
1500             <dd>
1501               <p>Any string.</p>
1502             </dd>
1503
1504             <dt>Notes:</dt>
1505
1506             <dd>
1507               <p>This action allows you to block client headers for which no
1508               dedicated <span class="APPLICATION">Privoxy</span> action
1509               exists. <span class="APPLICATION">Privoxy</span> will remove
1510               every client header that contains the string you supplied as
1511               parameter.</p>
1512
1513               <p>Regular expressions are <span class="emphasis"><i class=
1514               "EMPHASIS">not supported</i></span> and you can't use this
1515               action to block different headers in the same request, unless
1516               they contain the same string.</p>
1517
1518               <p><tt class="LITERAL">crunch-client-header</tt> is only meant
1519               for quick tests. If you have to block several different
1520               headers, or only want to modify parts of them, you should use a
1521               <tt class="LITERAL"><a href=
1522               "actions-file.html#CLIENT-HEADER-FILTER">client-header
1523               filter</a></tt>.</p>
1524
1525               <div class="WARNING">
1526                 <table class="WARNING" border="1" width="90%">
1527                   <tr>
1528                     <td align="center"><b>Warning</b></td>
1529                   </tr>
1530
1531                   <tr>
1532                     <td align="left">
1533                       <p>Don't block any header without understanding the
1534                       consequences.</p>
1535                     </td>
1536                   </tr>
1537                 </table>
1538               </div>
1539             </dd>
1540
1541             <dt>Example usage (section):</dt>
1542
1543             <dd>
1544               <table border="0" bgcolor="#E0E0E0" width="90%">
1545                 <tr>
1546                   <td>
1547                     <pre class="SCREEN">
1548 # Block the non-existent "Privacy-Violation:" client header
1549 { +crunch-client-header{Privacy-Violation:} }
1550 /
1551
1552 </pre>
1553                   </td>
1554                 </tr>
1555               </table>
1556             </dd>
1557           </dl>
1558         </div>
1559       </div>
1560
1561       <div class="SECT3">
1562         <h4 class="SECT3"><a name="CRUNCH-IF-NONE-MATCH" id=
1563         "CRUNCH-IF-NONE-MATCH">8.5.8. crunch-if-none-match</a></h4>
1564
1565         <div class="VARIABLELIST">
1566           <dl>
1567             <dt>Typical use:</dt>
1568
1569             <dd>
1570               <p>Prevent yet another way to track the user's steps between
1571               sessions.</p>
1572             </dd>
1573
1574             <dt>Effect:</dt>
1575
1576             <dd>
1577               <p>Deletes the <span class="QUOTE">"If-None-Match:"</span> HTTP
1578               client header.</p>
1579             </dd>
1580
1581             <dt>Type:</dt>
1582
1583             <dd>
1584               <p>Boolean.</p>
1585             </dd>
1586
1587             <dt>Parameter:</dt>
1588
1589             <dd>
1590               <p>N/A</p>
1591             </dd>
1592
1593             <dt>Notes:</dt>
1594
1595             <dd>
1596               <p>Removing the <span class="QUOTE">"If-None-Match:"</span>
1597               HTTP client header is useful for filter testing, where you want
1598               to force a real reload instead of getting status code
1599               <span class="QUOTE">"304"</span> which would cause the browser
1600               to use a cached copy of the page.</p>
1601
1602               <p>It is also useful to make sure the header isn't used as a
1603               cookie replacement (unlikely but possible).</p>
1604
1605               <p>Blocking the <span class="QUOTE">"If-None-Match:"</span>
1606               header shouldn't cause any caching problems, as long as the
1607               <span class="QUOTE">"If-Modified-Since:"</span> header isn't
1608               blocked or missing as well.</p>
1609
1610               <p>It is recommended to use this action together with
1611               <tt class="LITERAL"><a href=
1612               "actions-file.html#HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</a></tt>
1613               and <tt class="LITERAL"><a href=
1614               "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>.</p>
1615             </dd>
1616
1617             <dt>Example usage (section):</dt>
1618
1619             <dd>
1620               <table border="0" bgcolor="#E0E0E0" width="90%">
1621                 <tr>
1622                   <td>
1623                     <pre class="SCREEN">
1624 # Let the browser revalidate cached documents but don't
1625 # allow the server to use the revalidation headers for user tracking.
1626 {+hide-if-modified-since{-60} \
1627  +overwrite-last-modified{randomize} \
1628  +crunch-if-none-match}
1629 /
1630 </pre>
1631                   </td>
1632                 </tr>
1633               </table>
1634             </dd>
1635           </dl>
1636         </div>
1637       </div>
1638
1639       <div class="SECT3">
1640         <h4 class="SECT3"><a name="CRUNCH-INCOMING-COOKIES" id=
1641         "CRUNCH-INCOMING-COOKIES">8.5.9. crunch-incoming-cookies</a></h4>
1642
1643         <div class="VARIABLELIST">
1644           <dl>
1645             <dt>Typical use:</dt>
1646
1647             <dd>
1648               <p>Prevent the web server from setting HTTP cookies on your
1649               system</p>
1650             </dd>
1651
1652             <dt>Effect:</dt>
1653
1654             <dd>
1655               <p>Deletes any <span class="QUOTE">"Set-Cookie:"</span> HTTP
1656               headers from server replies.</p>
1657             </dd>
1658
1659             <dt>Type:</dt>
1660
1661             <dd>
1662               <p>Boolean.</p>
1663             </dd>
1664
1665             <dt>Parameter:</dt>
1666
1667             <dd>
1668               <p>N/A</p>
1669             </dd>
1670
1671             <dt>Notes:</dt>
1672
1673             <dd>
1674               <p>This action is only concerned with <span class=
1675               "emphasis"><i class="EMPHASIS">incoming</i></span> HTTP
1676               cookies. For <span class="emphasis"><i class=
1677               "EMPHASIS">outgoing</i></span> HTTP cookies, use <tt class=
1678               "LITERAL"><a href=
1679               "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>.
1680               Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1681               to disable HTTP cookies completely.</p>
1682
1683               <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1684               at all</i></span> to use this action in conjunction with the
1685               <tt class="LITERAL"><a href=
1686               "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1687               action, since it would prevent the session cookies from being
1688               set. See also <tt class="LITERAL"><a href=
1689               "actions-file.html#FILTER-CONTENT-COOKIES">filter-content-cookies</a></tt>.</p>
1690             </dd>
1691
1692             <dt>Example usage:</dt>
1693
1694             <dd>
1695               <table border="0" bgcolor="#E0E0E0" width="90%">
1696                 <tr>
1697                   <td>
1698                     <pre class="SCREEN">
1699 +crunch-incoming-cookies
1700 </pre>
1701                   </td>
1702                 </tr>
1703               </table>
1704             </dd>
1705           </dl>
1706         </div>
1707       </div>
1708
1709       <div class="SECT3">
1710         <h4 class="SECT3"><a name="CRUNCH-SERVER-HEADER" id=
1711         "CRUNCH-SERVER-HEADER">8.5.10. crunch-server-header</a></h4>
1712
1713         <div class="VARIABLELIST">
1714           <dl>
1715             <dt>Typical use:</dt>
1716
1717             <dd>
1718               <p>Remove a server header <span class=
1719               "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1720             </dd>
1721
1722             <dt>Effect:</dt>
1723
1724             <dd>
1725               <p>Deletes every header sent by the server that contains the
1726               string the user supplied as parameter.</p>
1727             </dd>
1728
1729             <dt>Type:</dt>
1730
1731             <dd>
1732               <p>Parameterized.</p>
1733             </dd>
1734
1735             <dt>Parameter:</dt>
1736
1737             <dd>
1738               <p>Any string.</p>
1739             </dd>
1740
1741             <dt>Notes:</dt>
1742
1743             <dd>
1744               <p>This action allows you to block server headers for which no
1745               dedicated <span class="APPLICATION">Privoxy</span> action
1746               exists. <span class="APPLICATION">Privoxy</span> will remove
1747               every server header that contains the string you supplied as
1748               parameter.</p>
1749
1750               <p>Regular expressions are <span class="emphasis"><i class=
1751               "EMPHASIS">not supported</i></span> and you can't use this
1752               action to block different headers in the same request, unless
1753               they contain the same string.</p>
1754
1755               <p><tt class="LITERAL">crunch-server-header</tt> is only meant
1756               for quick tests. If you have to block several different
1757               headers, or only want to modify parts of them, you should use a
1758               custom <tt class="LITERAL"><a href=
1759               "actions-file.html#SERVER-HEADER-FILTER">server-header
1760               filter</a></tt>.</p>
1761
1762               <div class="WARNING">
1763                 <table class="WARNING" border="1" width="90%">
1764                   <tr>
1765                     <td align="center"><b>Warning</b></td>
1766                   </tr>
1767
1768                   <tr>
1769                     <td align="left">
1770                       <p>Don't block any header without understanding the
1771                       consequences.</p>
1772                     </td>
1773                   </tr>
1774                 </table>
1775               </div>
1776             </dd>
1777
1778             <dt>Example usage (section):</dt>
1779
1780             <dd>
1781               <table border="0" bgcolor="#E0E0E0" width="90%">
1782                 <tr>
1783                   <td>
1784                     <pre class="SCREEN">
1785 # Crunch server headers that try to prevent caching
1786 { +crunch-server-header{no-cache} }
1787 /
1788 </pre>
1789                   </td>
1790                 </tr>
1791               </table>
1792             </dd>
1793           </dl>
1794         </div>
1795       </div>
1796
1797       <div class="SECT3">
1798         <h4 class="SECT3"><a name="CRUNCH-OUTGOING-COOKIES" id=
1799         "CRUNCH-OUTGOING-COOKIES">8.5.11. crunch-outgoing-cookies</a></h4>
1800
1801         <div class="VARIABLELIST">
1802           <dl>
1803             <dt>Typical use:</dt>
1804
1805             <dd>
1806               <p>Prevent the web server from reading any HTTP cookies from
1807               your system</p>
1808             </dd>
1809
1810             <dt>Effect:</dt>
1811
1812             <dd>
1813               <p>Deletes any <span class="QUOTE">"Cookie:"</span> HTTP
1814               headers from client requests.</p>
1815             </dd>
1816
1817             <dt>Type:</dt>
1818
1819             <dd>
1820               <p>Boolean.</p>
1821             </dd>
1822
1823             <dt>Parameter:</dt>
1824
1825             <dd>
1826               <p>N/A</p>
1827             </dd>
1828
1829             <dt>Notes:</dt>
1830
1831             <dd>
1832               <p>This action is only concerned with <span class=
1833               "emphasis"><i class="EMPHASIS">outgoing</i></span> HTTP
1834               cookies. For <span class="emphasis"><i class=
1835               "EMPHASIS">incoming</i></span> HTTP cookies, use <tt class=
1836               "LITERAL"><a href=
1837               "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>.
1838               Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1839               to disable HTTP cookies completely.</p>
1840
1841               <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1842               at all</i></span> to use this action in conjunction with the
1843               <tt class="LITERAL"><a href=
1844               "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1845               action, since it would prevent the session cookies from being
1846               read.</p>
1847             </dd>
1848
1849             <dt>Example usage:</dt>
1850
1851             <dd>
1852               <table border="0" bgcolor="#E0E0E0" width="90%">
1853                 <tr>
1854                   <td>
1855                     <pre class="SCREEN">
1856 +crunch-outgoing-cookies
1857 </pre>
1858                   </td>
1859                 </tr>
1860               </table>
1861             </dd>
1862           </dl>
1863         </div>
1864       </div>
1865
1866       <div class="SECT3">
1867         <h4 class="SECT3"><a name="DEANIMATE-GIFS" id=
1868         "DEANIMATE-GIFS">8.5.12. deanimate-gifs</a></h4>
1869
1870         <div class="VARIABLELIST">
1871           <dl>
1872             <dt>Typical use:</dt>
1873
1874             <dd>
1875               <p>Stop those annoying, distracting animated GIF images.</p>
1876             </dd>
1877
1878             <dt>Effect:</dt>
1879
1880             <dd>
1881               <p>De-animate GIF animations, i.e. reduce them to their first
1882               or last image.</p>
1883             </dd>
1884
1885             <dt>Type:</dt>
1886
1887             <dd>
1888               <p>Parameterized.</p>
1889             </dd>
1890
1891             <dt>Parameter:</dt>
1892
1893             <dd>
1894               <p><span class="QUOTE">"last"</span> or <span class=
1895               "QUOTE">"first"</span></p>
1896             </dd>
1897
1898             <dt>Notes:</dt>
1899
1900             <dd>
1901               <p>This will also shrink the images considerably (in bytes, not
1902               pixels!). If the option <span class="QUOTE">"first"</span> is
1903               given, the first frame of the animation is used as the
1904               replacement. If <span class="QUOTE">"last"</span> is given, the
1905               last frame of the animation is used instead, which probably
1906               makes more sense for most banner animations, but also has the
1907               risk of not showing the entire last frame (if it is only a
1908               delta to an earlier frame).</p>
1909
1910               <p>You can safely use this action with patterns that will also
1911               match non-GIF objects, because no attempt will be made at
1912               anything that doesn't look like a GIF.</p>
1913             </dd>
1914
1915             <dt>Example usage:</dt>
1916
1917             <dd>
1918               <table border="0" bgcolor="#E0E0E0" width="90%">
1919                 <tr>
1920                   <td>
1921                     <pre class="SCREEN">
1922 +deanimate-gifs{last}
1923 </pre>
1924                   </td>
1925                 </tr>
1926               </table>
1927             </dd>
1928           </dl>
1929         </div>
1930       </div>
1931
1932       <div class="SECT3">
1933         <h4 class="SECT3"><a name="DOWNGRADE-HTTP-VERSION" id=
1934         "DOWNGRADE-HTTP-VERSION">8.5.13. downgrade-http-version</a></h4>
1935
1936         <div class="VARIABLELIST">
1937           <dl>
1938             <dt>Typical use:</dt>
1939
1940             <dd>
1941               <p>Work around (very rare) problems with HTTP/1.1</p>
1942             </dd>
1943
1944             <dt>Effect:</dt>
1945
1946             <dd>
1947               <p>Downgrades HTTP/1.1 client requests and server replies to
1948               HTTP/1.0.</p>
1949             </dd>
1950
1951             <dt>Type:</dt>
1952
1953             <dd>
1954               <p>Boolean.</p>
1955             </dd>
1956
1957             <dt>Parameter:</dt>
1958
1959             <dd>
1960               <p>N/A</p>
1961             </dd>
1962
1963             <dt>Notes:</dt>
1964
1965             <dd>
1966               <p>This is a left-over from the time when <span class=
1967               "APPLICATION">Privoxy</span> didn't support important HTTP/1.1
1968               features well. It is left here for the unlikely case that you
1969               experience HTTP/1.1-related problems with some server out
1970               there.</p>
1971
1972               <p>Note that enabling this action is only a workaround. It
1973               should not be enabled for sites that work without it. While it
1974               shouldn't break any pages, it has an (usually negative)
1975               performance impact.</p>
1976
1977               <p>If you come across a site where enabling this action helps,
1978               please report it, so the cause of the problem can be analyzed.
1979               If the problem turns out to be caused by a bug in <span class=
1980               "APPLICATION">Privoxy</span> it should be fixed so the
1981               following release works without the work around.</p>
1982             </dd>
1983
1984             <dt>Example usage (section):</dt>
1985
1986             <dd>
1987               <table border="0" bgcolor="#E0E0E0" width="90%">
1988                 <tr>
1989                   <td>
1990                     <pre class="SCREEN">
1991 {+downgrade-http-version}
1992 problem-host.example.com
1993 </pre>
1994                   </td>
1995                 </tr>
1996               </table>
1997             </dd>
1998           </dl>
1999         </div>
2000       </div>
2001
2002       <div class="SECT3">
2003         <h4 class="SECT3"><a name="EXTERNAL-FILTER" id=
2004         "EXTERNAL-FILTER">8.5.14. external-filter</a></h4>
2005
2006         <div class="VARIABLELIST">
2007           <dl>
2008             <dt>Typical use:</dt>
2009
2010             <dd>
2011               <p>Modify content using a programming language of your
2012               choice.</p>
2013             </dd>
2014
2015             <dt>Effect:</dt>
2016
2017             <dd>
2018               <p>All instances of text-based type, most notably HTML and
2019               JavaScript, to which this action applies, can be filtered
2020               on-the-fly through the specified external filter. By default
2021               plain text documents are exempted from filtering, because web
2022               servers often use the <tt class="LITERAL">text/plain</tt> MIME
2023               type for all files whose type they don't know.)</p>
2024             </dd>
2025
2026             <dt>Type:</dt>
2027
2028             <dd>
2029               <p>Parameterized.</p>
2030             </dd>
2031
2032             <dt>Parameter:</dt>
2033
2034             <dd>
2035               <p>The name of an external content filter, as defined in the
2036               <a href="filter-file.html">filter file</a>. External filters
2037               can be defined in one or more files as defined by the
2038               <tt class="LITERAL"><a href=
2039               "config.html#FILTERFILE">filterfile</a></tt> option in the
2040               <a href="config.html">config file</a>.</p>
2041
2042               <p>When used in its negative form, and without parameters,
2043               <span class="emphasis"><i class="EMPHASIS">all</i></span>
2044               filtering with external filters is completely disabled.</p>
2045             </dd>
2046
2047             <dt>Notes:</dt>
2048
2049             <dd>
2050               <p>External filters are scripts or programs that can modify the
2051               content in case common <tt class="LITERAL"><a href=
2052               "actions-file.html#FILTER">filters</a></tt> aren't powerful
2053               enough.</p>
2054
2055               <div class="WARNING">
2056                 <table class="WARNING" border="1" width="90%">
2057                   <tr>
2058                     <td align="center"><b>Warning</b></td>
2059                   </tr>
2060
2061                   <tr>
2062                     <td align="left">
2063                       <p>Currently external filters are executed with
2064                       <span class="APPLICATION">Privoxy</span>'s privileges.
2065                       Only use external filters you understand and trust.</p>
2066                     </td>
2067                   </tr>
2068                 </table>
2069               </div>
2070
2071               <p>This feature is experimental, the <tt class=
2072               "LITERAL"><a href=
2073               "filter-file.html#EXTERNAL-FILTER-SYNTAX">syntax</a></tt> may
2074               change in the future.</p>
2075             </dd>
2076
2077             <dt>Example usage:</dt>
2078
2079             <dd>
2080               <table border="0" bgcolor="#E0E0E0" width="90%">
2081                 <tr>
2082                   <td>
2083                     <pre class="SCREEN">
2084 +external-filter{fancy-filter}
2085 </pre>
2086                   </td>
2087                 </tr>
2088               </table>
2089             </dd>
2090           </dl>
2091         </div>
2092       </div>
2093
2094       <div class="SECT3">
2095         <h4 class="SECT3"><a name="FAST-REDIRECTS" id=
2096         "FAST-REDIRECTS">8.5.15. fast-redirects</a></h4>
2097
2098         <div class="VARIABLELIST">
2099           <dl>
2100             <dt>Typical use:</dt>
2101
2102             <dd>
2103               <p>Fool some click-tracking scripts and speed up indirect
2104               links.</p>
2105             </dd>
2106
2107             <dt>Effect:</dt>
2108
2109             <dd>
2110               <p>Detects redirection URLs and redirects the browser without
2111               contacting the redirection server first.</p>
2112             </dd>
2113
2114             <dt>Type:</dt>
2115
2116             <dd>
2117               <p>Parameterized.</p>
2118             </dd>
2119
2120             <dt>Parameter:</dt>
2121
2122             <dd>
2123               <ul>
2124                 <li>
2125                   <p><span class="QUOTE">"simple-check"</span> to just search
2126                   for the string <span class="QUOTE">"http://"</span> to
2127                   detect redirection URLs.</p>
2128                 </li>
2129
2130                 <li>
2131                   <p><span class="QUOTE">"check-decoded-url"</span> to decode
2132                   URLs (if necessary) before searching for redirection
2133                   URLs.</p>
2134                 </li>
2135               </ul>
2136             </dd>
2137
2138             <dt>Notes:</dt>
2139
2140             <dd>
2141               <p>Many sites, like yahoo.com, don't just link to other sites.
2142               Instead, they will link to some script on their own servers,
2143               giving the destination as a parameter, which will then redirect
2144               you to the final target. URLs resulting from this scheme
2145               typically look like: <span class=
2146               "QUOTE">"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</span>.</p>
2147
2148               <p>Sometimes, there are even multiple consecutive redirects
2149               encoded in the URL. These redirections via scripts make your
2150               web browsing more traceable, since the server from which you
2151               follow such a link can see where you go to. Apart from that,
2152               valuable bandwidth and time is wasted, while your browser asks
2153               the server for one redirect after the other. Plus, it feeds the
2154               advertisers.</p>
2155
2156               <p>This feature is currently not very smart and is scheduled
2157               for improvement. If it is enabled by default, you will have to
2158               create some exceptions to this action. It can lead to failures
2159               in several ways:</p>
2160
2161               <p>Not every URLs with other URLs as parameters is evil. Some
2162               sites offer a real service that requires this information to
2163               work. For example a validation service needs to know, which
2164               document to validate. <tt class="LITERAL">fast-redirects</tt>
2165               assumes that every URL parameter that looks like another URL is
2166               a redirection target, and will always redirect to the last one.
2167               Most of the time the assumption is correct, but if it isn't,
2168               the user gets redirected anyway.</p>
2169
2170               <p>Another failure occurs if the URL contains other parameters
2171               after the URL parameter. The URL: <span class=
2172               "QUOTE">"http://www.example.org/?redirect=http%3a//www.example.net/&amp;foo=bar"</span>.
2173               contains the redirection URL <span class=
2174               "QUOTE">"http://www.example.net/"</span>, followed by another
2175               parameter. <tt class="LITERAL">fast-redirects</tt> doesn't know
2176               that and will cause a redirect to <span class=
2177               "QUOTE">"http://www.example.net/&amp;foo=bar"</span>. Depending
2178               on the target server configuration, the parameter will be
2179               silently ignored or lead to a <span class="QUOTE">"page not
2180               found"</span> error. You can prevent this problem by first
2181               using the <tt class="LITERAL"><a href=
2182               "actions-file.html#REDIRECT">redirect</a></tt> action to remove
2183               the last part of the URL, but it requires a little effort.</p>
2184
2185               <p>To detect a redirection URL, <tt class=
2186               "LITERAL">fast-redirects</tt> only looks for the string
2187               <span class="QUOTE">"http://"</span>, either in plain text
2188               (invalid but often used) or encoded as <span class=
2189               "QUOTE">"http%3a//"</span>. Some sites use their own URL
2190               encoding scheme, encrypt the address of the target server or
2191               replace it with a database id. In theses cases <tt class=
2192               "LITERAL">fast-redirects</tt> is fooled and the request reaches
2193               the redirection server where it probably gets logged.</p>
2194             </dd>
2195
2196             <dt>Example usage:</dt>
2197
2198             <dd>
2199               <table border="0" bgcolor="#E0E0E0" width="90%">
2200                 <tr>
2201                   <td>
2202                     <pre class="SCREEN">
2203  { +fast-redirects{simple-check} }
2204    one.example.com
2205
2206  { +fast-redirects{check-decoded-url} }
2207    another.example.com/testing
2208 </pre>
2209                   </td>
2210                 </tr>
2211               </table>
2212             </dd>
2213           </dl>
2214         </div>
2215       </div>
2216
2217       <div class="SECT3">
2218         <h4 class="SECT3"><a name="FILTER" id="FILTER">8.5.16.
2219         filter</a></h4>
2220
2221         <div class="VARIABLELIST">
2222           <dl>
2223             <dt>Typical use:</dt>
2224
2225             <dd>
2226               <p>Get rid of HTML and JavaScript annoyances, banner
2227               advertisements (by size), do fun text replacements, add
2228               personalized effects, etc.</p>
2229             </dd>
2230
2231             <dt>Effect:</dt>
2232
2233             <dd>
2234               <p>All instances of text-based type, most notably HTML and
2235               JavaScript, to which this action applies, can be filtered
2236               on-the-fly through the specified regular expression based
2237               substitutions. (Note: as of version 3.0.3 plain text documents
2238               are exempted from filtering, because web servers often use the
2239               <tt class="LITERAL">text/plain</tt> MIME type for all files
2240               whose type they don't know.)</p>
2241             </dd>
2242
2243             <dt>Type:</dt>
2244
2245             <dd>
2246               <p>Parameterized.</p>
2247             </dd>
2248
2249             <dt>Parameter:</dt>
2250
2251             <dd>
2252               <p>The name of a content filter, as defined in the <a href=
2253               "filter-file.html">filter file</a>. Filters can be defined in
2254               one or more files as defined by the <tt class=
2255               "LITERAL"><a href="config.html#FILTERFILE">filterfile</a></tt>
2256               option in the <a href="config.html">config file</a>. <tt class=
2257               "FILENAME">default.filter</tt> is the collection of filters
2258               supplied by the developers. Locally defined filters should go
2259               in their own file, such as <tt class=
2260               "FILENAME">user.filter</tt>.</p>
2261
2262               <p>When used in its negative form, and without parameters,
2263               <span class="emphasis"><i class="EMPHASIS">all</i></span>
2264               filtering is completely disabled.</p>
2265             </dd>
2266
2267             <dt>Notes:</dt>
2268
2269             <dd>
2270               <p>For your convenience, there are a number of pre-defined
2271               filters available in the distribution filter file that you can
2272               use. See the examples below for a list.</p>
2273
2274               <p>Filtering requires buffering the page content, which may
2275               appear to slow down page rendering since nothing is displayed
2276               until all content has passed the filters. (The total time until
2277               the page is completely rendered doesn't change much, but it may
2278               be perceived as slower since the page is not incrementally
2279               displayed.) This effect will be more noticeable on slower
2280               connections.</p>
2281
2282               <p><span class="QUOTE">"Rolling your own"</span> filters
2283               requires a knowledge of <a href=
2284               "http://en.wikipedia.org/wiki/Regular_expressions" target=
2285               "_top"><span class="QUOTE">"Regular Expressions"</span></a> and
2286               <a href="http://en.wikipedia.org/wiki/Html" target=
2287               "_top"><span class="QUOTE">"HTML"</span></a>. This is very
2288               powerful feature, and potentially very intrusive. Filters
2289               should be used with caution, and where an equivalent
2290               <span class="QUOTE">"action"</span> is not available.</p>
2291
2292               <p>The amount of data that can be filtered is limited to the
2293               <tt class="LITERAL"><a href=
2294               "config.html#BUFFER-LIMIT">buffer-limit</a></tt> option in the
2295               main <a href="config.html">config file</a>. The default is 4096
2296               KB (4 Megs). Once this limit is exceeded, the buffered data,
2297               and all pending data, is passed through unfiltered.</p>
2298
2299               <p>Inappropriate MIME types, such as zipped files, are not
2300               filtered at all. (Again, only text-based types except plain
2301               text). Encrypted SSL data (from HTTPS servers) cannot be
2302               filtered either, since this would violate the integrity of the
2303               secure transaction. In some situations it might be necessary to
2304               protect certain text, like source code, from filtering by
2305               defining appropriate <tt class="LITERAL">-filter</tt>
2306               exceptions.</p>
2307
2308               <p>Compressed content can't be filtered either, but if
2309               <span class="APPLICATION">Privoxy</span> is compiled with zlib
2310               support and a supported compression algorithm is used (gzip or
2311               deflate), <span class="APPLICATION">Privoxy</span> can first
2312               decompress the content and then filter it.</p>
2313
2314               <p>If you use a <span class="APPLICATION">Privoxy</span>
2315               version without zlib support, but want filtering to work on as
2316               much documents as possible, even those that would normally be
2317               sent compressed, you must use the <tt class="LITERAL"><a href=
2318               "actions-file.html#PREVENT-COMPRESSION">prevent-compression</a></tt>
2319               action in conjunction with <tt class="LITERAL">filter</tt>.</p>
2320
2321               <p>Content filtering can achieve some of the same effects as
2322               the <tt class="LITERAL"><a href=
2323               "actions-file.html#BLOCK">block</a></tt> action, i.e. it can be
2324               used to block ads and banners. But the mechanism works quite
2325               differently. One effective use, is to block ad banners based on
2326               their size (see below), since many of these seem to be somewhat
2327               standardized.</p>
2328
2329               <p><a href="contact.html">Feedback</a> with suggestions for new
2330               or improved filters is particularly welcome!</p>
2331
2332               <p>The below list has only the names and a one-line description
2333               of each predefined filter. There are <a href=
2334               "filter-file.html#PREDEFINED-FILTERS">more verbose
2335               explanations</a> of what these filters do in the <a href=
2336               "filter-file.html">filter file chapter</a>.</p>
2337             </dd>
2338
2339             <dt>Example usage (with filters from the distribution <tt class=
2340             "FILENAME">default.filter</tt> file). See <a href=
2341             "filter-file.html#PREDEFINED-FILTERS">the Predefined Filters
2342             section</a> for more explanation on each:</dt>
2343
2344             <dd>
2345               <p><a name="FILTER-JS-ANNOYANCES" id=
2346               "FILTER-JS-ANNOYANCES"></a></p>
2347
2348               <table border="0" bgcolor="#E0E0E0" width="90%">
2349                 <tr>
2350                   <td>
2351                     <pre class="SCREEN">
2352 +filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.
2353 </pre>
2354                   </td>
2355                 </tr>
2356               </table>
2357
2358               <p><a name="FILTER-JS-EVENTS" id="FILTER-JS-EVENTS"></a></p>
2359
2360               <table border="0" bgcolor="#E0E0E0" width="90%">
2361                 <tr>
2362                   <td>
2363                     <pre class="SCREEN">
2364 +filter{js-events}           # Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites).
2365 </pre>
2366                   </td>
2367                 </tr>
2368               </table>
2369
2370               <p><a name="FILTER-HTML-ANNOYANCES" id=
2371               "FILTER-HTML-ANNOYANCES"></a></p>
2372
2373               <table border="0" bgcolor="#E0E0E0" width="90%">
2374                 <tr>
2375                   <td>
2376                     <pre class="SCREEN">
2377 +filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.
2378 </pre>
2379                   </td>
2380                 </tr>
2381               </table>
2382
2383               <p><a name="FILTER-CONTENT-COOKIES" id=
2384               "FILTER-CONTENT-COOKIES"></a></p>
2385
2386               <table border="0" bgcolor="#E0E0E0" width="90%">
2387                 <tr>
2388                   <td>
2389                     <pre class="SCREEN">
2390 +filter{content-cookies}     # Kill cookies that come in the HTML or JS content.
2391 </pre>
2392                   </td>
2393                 </tr>
2394               </table>
2395
2396               <p><a name="FILTER-REFRESH-TAGS" id=
2397               "FILTER-REFRESH-TAGS"></a></p>
2398
2399               <table border="0" bgcolor="#E0E0E0" width="90%">
2400                 <tr>
2401                   <td>
2402                     <pre class="SCREEN">
2403 +filter{refresh-tags}        # Kill automatic refresh tags if refresh time is larger than 9 seconds.
2404 </pre>
2405                   </td>
2406                 </tr>
2407               </table>
2408
2409               <p><a name="FILTER-UNSOLICITED-POPUPS" id=
2410               "FILTER-UNSOLICITED-POPUPS"></a></p>
2411
2412               <table border="0" bgcolor="#E0E0E0" width="90%">
2413                 <tr>
2414                   <td>
2415                     <pre class="SCREEN">
2416 +filter{unsolicited-popups}  # Disable only unsolicited pop-up windows.
2417 </pre>
2418                   </td>
2419                 </tr>
2420               </table>
2421
2422               <p><a name="FILTER-ALL-POPUPS" id="FILTER-ALL-POPUPS"></a></p>
2423
2424               <table border="0" bgcolor="#E0E0E0" width="90%">
2425                 <tr>
2426                   <td>
2427                     <pre class="SCREEN">
2428 +filter{all-popups}          # Kill all popups in JavaScript and HTML.
2429 </pre>
2430                   </td>
2431                 </tr>
2432               </table>
2433
2434               <p><a name="FILTER-IMG-REORDER" id=
2435               "FILTER-IMG-REORDER"></a></p>
2436
2437               <table border="0" bgcolor="#E0E0E0" width="90%">
2438                 <tr>
2439                   <td>
2440                     <pre class="SCREEN">
2441 +filter{img-reorder}         # Reorder attributes in &lt;img&gt; tags to make the banners-by-* filters more effective.
2442 </pre>
2443                   </td>
2444                 </tr>
2445               </table>
2446
2447               <p><a name="FILTER-BANNERS-BY-SIZE" id=
2448               "FILTER-BANNERS-BY-SIZE"></a></p>
2449
2450               <table border="0" bgcolor="#E0E0E0" width="90%">
2451                 <tr>
2452                   <td>
2453                     <pre class="SCREEN">
2454 +filter{banners-by-size}     # Kill banners by size.
2455 </pre>
2456                   </td>
2457                 </tr>
2458               </table>
2459
2460               <p><a name="FILTER-BANNERS-BY-LINK" id=
2461               "FILTER-BANNERS-BY-LINK"></a></p>
2462
2463               <table border="0" bgcolor="#E0E0E0" width="90%">
2464                 <tr>
2465                   <td>
2466                     <pre class="SCREEN">
2467 +filter{banners-by-link}     # Kill banners by their links to known clicktrackers.
2468 </pre>
2469                   </td>
2470                 </tr>
2471               </table>
2472
2473               <p><a name="FILTER-WEBBUGS" id="FILTER-WEBBUGS"></a></p>
2474
2475               <table border="0" bgcolor="#E0E0E0" width="90%">
2476                 <tr>
2477                   <td>
2478                     <pre class="SCREEN">
2479 +filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).
2480 </pre>
2481                   </td>
2482                 </tr>
2483               </table>
2484
2485               <p><a name="FILTER-TINY-TEXTFORMS" id=
2486               "FILTER-TINY-TEXTFORMS"></a></p>
2487
2488               <table border="0" bgcolor="#E0E0E0" width="90%">
2489                 <tr>
2490                   <td>
2491                     <pre class="SCREEN">
2492 +filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.
2493 </pre>
2494                   </td>
2495                 </tr>
2496               </table>
2497
2498               <p><a name="FILTER-JUMPING-WINDOWS" id=
2499               "FILTER-JUMPING-WINDOWS"></a></p>
2500
2501               <table border="0" bgcolor="#E0E0E0" width="90%">
2502                 <tr>
2503                   <td>
2504                     <pre class="SCREEN">
2505 +filter{jumping-windows}     # Prevent windows from resizing and moving themselves.
2506 </pre>
2507                   </td>
2508                 </tr>
2509               </table>
2510
2511               <p><a name="FILTER-FRAMESET-BORDERS" id=
2512               "FILTER-FRAMESET-BORDERS"></a></p>
2513
2514               <table border="0" bgcolor="#E0E0E0" width="90%">
2515                 <tr>
2516                   <td>
2517                     <pre class="SCREEN">
2518 +filter{frameset-borders}    # Give frames a border and make them resizable.
2519 </pre>
2520                   </td>
2521                 </tr>
2522               </table>
2523
2524               <p><a name="FILTER-IFRAMES" id="FILTER-IFRAMES"></a></p>
2525
2526               <table border="0" bgcolor="#E0E0E0" width="90%">
2527                 <tr>
2528                   <td>
2529                     <pre class="SCREEN">
2530 +filter{iframes}             # Removes all detected iframes. Should only be enabled for individual sites.
2531 </pre>
2532                   </td>
2533                 </tr>
2534               </table>
2535
2536               <p><a name="FILTER-DEMORONIZER" id=
2537               "FILTER-DEMORONIZER"></a></p>
2538
2539               <table border="0" bgcolor="#E0E0E0" width="90%">
2540                 <tr>
2541                   <td>
2542                     <pre class="SCREEN">
2543 +filter{demoronizer}         # Fix MS's non-standard use of standard charsets.
2544 </pre>
2545                   </td>
2546                 </tr>
2547               </table>
2548
2549               <p><a name="FILTER-SHOCKWAVE-FLASH" id=
2550               "FILTER-SHOCKWAVE-FLASH"></a></p>
2551
2552               <table border="0" bgcolor="#E0E0E0" width="90%">
2553                 <tr>
2554                   <td>
2555                     <pre class="SCREEN">
2556 +filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.
2557 </pre>
2558                   </td>
2559                 </tr>
2560               </table>
2561
2562               <p><a name="FILTER-QUICKTIME-KIOSKMODE" id=
2563               "FILTER-QUICKTIME-KIOSKMODE"></a></p>
2564
2565               <table border="0" bgcolor="#E0E0E0" width="90%">
2566                 <tr>
2567                   <td>
2568                     <pre class="SCREEN">
2569 +filter{quicktime-kioskmode} # Make Quicktime movies saveable.
2570 </pre>
2571                   </td>
2572                 </tr>
2573               </table>
2574
2575               <p><a name="FILTER-FUN" id="FILTER-FUN"></a></p>
2576
2577               <table border="0" bgcolor="#E0E0E0" width="90%">
2578                 <tr>
2579                   <td>
2580                     <pre class="SCREEN">
2581 +filter{fun}                 # Text replacements for subversive browsing fun!
2582 </pre>
2583                   </td>
2584                 </tr>
2585               </table>
2586
2587               <p><a name="FILTER-CRUDE-PARENTAL" id=
2588               "FILTER-CRUDE-PARENTAL"></a></p>
2589
2590               <table border="0" bgcolor="#E0E0E0" width="90%">
2591                 <tr>
2592                   <td>
2593                     <pre class="SCREEN">
2594 +filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.
2595 </pre>
2596                   </td>
2597                 </tr>
2598               </table>
2599
2600               <p><a name="FILTER-IE-EXPLOITS" id=
2601               "FILTER-IE-EXPLOITS"></a></p>
2602
2603               <table border="0" bgcolor="#E0E0E0" width="90%">
2604                 <tr>
2605                   <td>
2606                     <pre class="SCREEN">
2607 +filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.
2608 </pre>
2609                   </td>
2610                 </tr>
2611               </table>
2612
2613               <p><a name="FILTER-SITE-SPECIFICS" id=
2614               "FILTER-SITE-SPECIFICS"></a></p>
2615
2616               <table border="0" bgcolor="#E0E0E0" width="90%">
2617                 <tr>
2618                   <td>
2619                     <pre class="SCREEN">
2620 +filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!
2621 </pre>
2622                   </td>
2623                 </tr>
2624               </table>
2625
2626               <p><a name="FILTER-NO-PING" id="FILTER-NO-PING"></a></p>
2627
2628               <table border="0" bgcolor="#E0E0E0" width="90%">
2629                 <tr>
2630                   <td>
2631                     <pre class="SCREEN">
2632 +filter{no-ping}             # Removes non-standard ping attributes in &lt;a&gt; and &lt;area&gt; tags.
2633 </pre>
2634                   </td>
2635                 </tr>
2636               </table>
2637
2638               <p><a name="FILTER-GOOGLE" id="FILTER-GOOGLE"></a></p>
2639
2640               <table border="0" bgcolor="#E0E0E0" width="90%">
2641                 <tr>
2642                   <td>
2643                     <pre class="SCREEN">
2644 +filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
2645 </pre>
2646                   </td>
2647                 </tr>
2648               </table>
2649
2650               <p><a name="FILTER-YAHOO" id="FILTER-YAHOO"></a></p>
2651
2652               <table border="0" bgcolor="#E0E0E0" width="90%">
2653                 <tr>
2654                   <td>
2655                     <pre class="SCREEN">
2656 +filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.
2657 </pre>
2658                   </td>
2659                 </tr>
2660               </table>
2661
2662               <p><a name="FILTER-MSN" id="FILTER-MSN"></a></p>
2663
2664               <table border="0" bgcolor="#E0E0E0" width="90%">
2665                 <tr>
2666                   <td>
2667                     <pre class="SCREEN">
2668 +filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
2669 </pre>
2670                   </td>
2671                 </tr>
2672               </table>
2673
2674               <p><a name="FILTER-BLOGSPOT" id="FILTER-BLOGSPOT"></a></p>
2675
2676               <table border="0" bgcolor="#E0E0E0" width="90%">
2677                 <tr>
2678                   <td>
2679                     <pre class="SCREEN">
2680 +filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.
2681 </pre>
2682                   </td>
2683                 </tr>
2684               </table>
2685             </dd>
2686           </dl>
2687         </div>
2688       </div>
2689
2690       <div class="SECT3">
2691         <h4 class="SECT3"><a name="FORCE-TEXT-MODE" id=
2692         "FORCE-TEXT-MODE">8.5.17. force-text-mode</a></h4>
2693
2694         <div class="VARIABLELIST">
2695           <dl>
2696             <dt>Typical use:</dt>
2697
2698             <dd>
2699               <p>Force <span class="APPLICATION">Privoxy</span> to treat a
2700               document as if it was in some kind of <span class=
2701               "emphasis"><i class="EMPHASIS">text</i></span> format.</p>
2702             </dd>
2703
2704             <dt>Effect:</dt>
2705
2706             <dd>
2707               <p>Declares a document as text, even if the <span class=
2708               "QUOTE">"Content-Type:"</span> isn't detected as such.</p>
2709             </dd>
2710
2711             <dt>Type:</dt>
2712
2713             <dd>
2714               <p>Boolean.</p>
2715             </dd>
2716
2717             <dt>Parameter:</dt>
2718
2719             <dd>
2720               <p>N/A</p>
2721             </dd>
2722
2723             <dt>Notes:</dt>
2724
2725             <dd>
2726               <p>As explained <tt class="LITERAL"><a href=
2727               "actions-file.html#FILTER">above</a></tt>, <span class=
2728               "APPLICATION">Privoxy</span> tries to only filter files that
2729               are in some kind of text format. The same restrictions apply to
2730               <tt class="LITERAL"><a href=
2731               "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite</a></tt>.
2732               <tt class="LITERAL">force-text-mode</tt> declares a document as
2733               text, without looking at the <span class=
2734               "QUOTE">"Content-Type:"</span> first.</p>
2735
2736               <div class="WARNING">
2737                 <table class="WARNING" border="1" width="90%">
2738                   <tr>
2739                     <td align="center"><b>Warning</b></td>
2740                   </tr>
2741
2742                   <tr>
2743                     <td align="left">
2744                       <p>Think twice before activating this action. Filtering
2745                       binary data with regular expressions can cause file
2746                       damage.</p>
2747                     </td>
2748                   </tr>
2749                 </table>
2750               </div>
2751             </dd>
2752
2753             <dt>Example usage:</dt>
2754
2755             <dd>
2756               <table border="0" bgcolor="#E0E0E0" width="90%">
2757                 <tr>
2758                   <td>
2759                     <pre class="SCREEN">
2760 +force-text-mode
2761
2762 </pre>
2763                   </td>
2764                 </tr>
2765               </table>
2766             </dd>
2767           </dl>
2768         </div>
2769       </div>
2770
2771       <div class="SECT3">
2772         <h4 class="SECT3"><a name="FORWARD-OVERRIDE" id=
2773         "FORWARD-OVERRIDE">8.5.18. forward-override</a></h4>
2774
2775         <div class="VARIABLELIST">
2776           <dl>
2777             <dt>Typical use:</dt>
2778
2779             <dd>
2780               <p>Change the forwarding settings based on User-Agent or
2781               request origin</p>
2782             </dd>
2783
2784             <dt>Effect:</dt>
2785
2786             <dd>
2787               <p>Overrules the forward directives in the configuration
2788               file.</p>
2789             </dd>
2790
2791             <dt>Type:</dt>
2792
2793             <dd>
2794               <p>Multi-value.</p>
2795             </dd>
2796
2797             <dt>Parameter:</dt>
2798
2799             <dd>
2800               <ul>
2801                 <li>
2802                   <p><span class="QUOTE">"forward ."</span> to use a direct
2803                   connection without any additional proxies.</p>
2804                 </li>
2805
2806                 <li>
2807                   <p><span class="QUOTE">"forward 127.0.0.1:8123"</span> to
2808                   use the HTTP proxy listening at 127.0.0.1 port 8123.</p>
2809                 </li>
2810
2811                 <li>
2812                   <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2813                   ."</span> to use the socks4a proxy listening at 127.0.0.1
2814                   port 9050. Replace <span class=
2815                   "QUOTE">"forward-socks4a"</span> with <span class=
2816                   "QUOTE">"forward-socks4"</span> to use a socks4 connection
2817                   (with local DNS resolution) instead, use <span class=
2818                   "QUOTE">"forward-socks5"</span> for socks5 connections
2819                   (with remote DNS resolution).</p>
2820                 </li>
2821
2822                 <li>
2823                   <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2824                   proxy.example.org:8000"</span> to use the socks4a proxy
2825                   listening at 127.0.0.1 port 9050 to reach the HTTP proxy
2826                   listening at proxy.example.org port 8000. Replace
2827                   <span class="QUOTE">"forward-socks4a"</span> with
2828                   <span class="QUOTE">"forward-socks4"</span> to use a socks4
2829                   connection (with local DNS resolution) instead, use
2830                   <span class="QUOTE">"forward-socks5"</span> for socks5
2831                   connections (with remote DNS resolution).</p>
2832                 </li>
2833               </ul>
2834             </dd>
2835
2836             <dt>Notes:</dt>
2837
2838             <dd>
2839               <p>This action takes parameters similar to the <a href=
2840               "config.html#FORWARDING">forward</a> directives in the
2841               configuration file, but without the URL pattern. It can be used
2842               as replacement, but normally it's only used in cases where
2843               matching based on the request URL isn't sufficient.</p>
2844
2845               <div class="WARNING">
2846                 <table class="WARNING" border="1" width="90%">
2847                   <tr>
2848                     <td align="center"><b>Warning</b></td>
2849                   </tr>
2850
2851                   <tr>
2852                     <td align="left">
2853                       <p>Please read the description for the <a href=
2854                       "config.html#FORWARDING">forward</a> directives before
2855                       using this action. Forwarding to the wrong people will
2856                       reduce your privacy and increase the chances of
2857                       man-in-the-middle attacks.</p>
2858
2859                       <p>If the ports are missing or invalid, default values
2860                       will be used. This might change in the future and you
2861                       shouldn't rely on it. Otherwise incorrect syntax causes
2862                       Privoxy to exit.</p>
2863
2864                       <p>Use the <a href=
2865                       "http://config.privoxy.org/show-url-info" target=
2866                       "_top">show-url-info CGI page</a> to verify that your
2867                       forward settings do what you thought the do.</p>
2868                     </td>
2869                   </tr>
2870                 </table>
2871               </div>
2872             </dd>
2873
2874             <dt>Example usage:</dt>
2875
2876             <dd>
2877               <table border="0" bgcolor="#E0E0E0" width="90%">
2878                 <tr>
2879                   <td>
2880                     <pre class="SCREEN">
2881 # Always use direct connections for requests previously tagged as
2882 # <span class="QUOTE">"User-Agent: fetch libfetch/2.0"</span> and make sure
2883 # resuming downloads continues to work.
2884 # This way you can continue to use Tor for your normal browsing,
2885 # without overloading the Tor network with your FreeBSD ports updates
2886 # or downloads of bigger files like ISOs.
2887 # Note that HTTP headers are easy to fake and therefore their
2888 # values are as (un)trustworthy as your clients and users.
2889 {+forward-override{forward .} \
2890  -hide-if-modified-since      \
2891  -overwrite-last-modified     \
2892 }
2893 TAG:^User-Agent: fetch libfetch/2\.0$
2894
2895 </pre>
2896                   </td>
2897                 </tr>
2898               </table>
2899             </dd>
2900           </dl>
2901         </div>
2902       </div>
2903
2904       <div class="SECT3">
2905         <h4 class="SECT3"><a name="HANDLE-AS-EMPTY-DOCUMENT" id=
2906         "HANDLE-AS-EMPTY-DOCUMENT">8.5.19. handle-as-empty-document</a></h4>
2907
2908         <div class="VARIABLELIST">
2909           <dl>
2910             <dt>Typical use:</dt>
2911
2912             <dd>
2913               <p>Mark URLs that should be replaced by empty documents
2914               <span class="emphasis"><i class="EMPHASIS">if they get
2915               blocked</i></span></p>
2916             </dd>
2917
2918             <dt>Effect:</dt>
2919
2920             <dd>
2921               <p>This action alone doesn't do anything noticeable. It just
2922               marks URLs. If the <tt class="LITERAL"><a href=
2923               "actions-file.html#BLOCK">block</a></tt> action <span class=
2924               "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2925               presence or absence of this mark decides whether an HTML
2926               <span class="QUOTE">"BLOCKED"</span> page, or an empty document
2927               will be sent to the client as a substitute for the blocked
2928               content. The <span class="emphasis"><i class=
2929               "EMPHASIS">empty</i></span> document isn't literally empty, but
2930               actually contains a single space.</p>
2931             </dd>
2932
2933             <dt>Type:</dt>
2934
2935             <dd>
2936               <p>Boolean.</p>
2937             </dd>
2938
2939             <dt>Parameter:</dt>
2940
2941             <dd>
2942               <p>N/A</p>
2943             </dd>
2944
2945             <dt>Notes:</dt>
2946
2947             <dd>
2948               <p>Some browsers complain about syntax errors if JavaScript
2949               documents are blocked with <span class=
2950               "APPLICATION">Privoxy's</span> default HTML page; this option
2951               can be used to silence them. And of course this action can also
2952               be used to eliminate the <span class=
2953               "APPLICATION">Privoxy</span> BLOCKED message in frames.</p>
2954
2955               <p>The content type for the empty document can be specified
2956               with <tt class="LITERAL"><a href=
2957               "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite{}</a></tt>,
2958               but usually this isn't necessary.</p>
2959             </dd>
2960
2961             <dt>Example usage:</dt>
2962
2963             <dd>
2964               <table border="0" bgcolor="#E0E0E0" width="90%">
2965                 <tr>
2966                   <td>
2967                     <pre class="SCREEN">
2968 # Block all documents on example.org that end with ".js",
2969 # but send an empty document instead of the usual HTML message.
2970 {+block{Blocked JavaScript} +handle-as-empty-document}
2971 example.org/.*\.js$
2972
2973 </pre>
2974                   </td>
2975                 </tr>
2976               </table>
2977             </dd>
2978           </dl>
2979         </div>
2980       </div>
2981
2982       <div class="SECT3">
2983         <h4 class="SECT3"><a name="HANDLE-AS-IMAGE" id=
2984         "HANDLE-AS-IMAGE">8.5.20. handle-as-image</a></h4>
2985
2986         <div class="VARIABLELIST">
2987           <dl>
2988             <dt>Typical use:</dt>
2989
2990             <dd>
2991               <p>Mark URLs as belonging to images (so they'll be replaced by
2992               images <span class="emphasis"><i class="EMPHASIS">if they do
2993               get blocked</i></span>, rather than HTML pages)</p>
2994             </dd>
2995
2996             <dt>Effect:</dt>
2997
2998             <dd>
2999               <p>This action alone doesn't do anything noticeable. It just
3000               marks URLs as images. If the <tt class="LITERAL"><a href=
3001               "actions-file.html#BLOCK">block</a></tt> action <span class=
3002               "emphasis"><i class="EMPHASIS">also applies</i></span>, the
3003               presence or absence of this mark decides whether an HTML
3004               <span class="QUOTE">"blocked"</span> page, or a replacement
3005               image (as determined by the <tt class="LITERAL"><a href=
3006               "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
3007               action) will be sent to the client as a substitute for the
3008               blocked content.</p>
3009             </dd>
3010
3011             <dt>Type:</dt>
3012
3013             <dd>
3014               <p>Boolean.</p>
3015             </dd>
3016
3017             <dt>Parameter:</dt>
3018
3019             <dd>
3020               <p>N/A</p>
3021             </dd>
3022
3023             <dt>Notes:</dt>
3024
3025             <dd>
3026               <p>The below generic example section is actually part of
3027               <tt class="FILENAME">default.action</tt>. It marks all URLs
3028               with well-known image file name extensions as images and should
3029               be left intact.</p>
3030
3031               <p>Users will probably only want to use the handle-as-image
3032               action in conjunction with <tt class="LITERAL"><a href=
3033               "actions-file.html#BLOCK">block</a></tt>, to block sources of
3034               banners, whose URLs don't reflect the file type, like in the
3035               second example section.</p>
3036
3037               <p>Note that you cannot treat HTML pages as images in most
3038               cases. For instance, (in-line) ad frames require an HTML page
3039               to be sent, or they won't display properly. Forcing <tt class=
3040               "LITERAL">handle-as-image</tt> in this situation will not
3041               replace the ad frame with an image, but lead to error
3042               messages.</p>
3043             </dd>
3044
3045             <dt>Example usage (sections):</dt>
3046
3047             <dd>
3048               <table border="0" bgcolor="#E0E0E0" width="90%">
3049                 <tr>
3050                   <td>
3051                     <pre class="SCREEN">
3052 # Generic image extensions:
3053 #
3054 {+handle-as-image}
3055 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
3056
3057 # These don't look like images, but they're banners and should be
3058 # blocked as images:
3059 #
3060 {+block{Nasty banners.} +handle-as-image}
3061 nasty-banner-server.example.com/junk.cgi\?output=trash
3062 </pre>
3063                   </td>
3064                 </tr>
3065               </table>
3066             </dd>
3067           </dl>
3068         </div>
3069       </div>
3070
3071       <div class="SECT3">
3072         <h4 class="SECT3"><a name="HIDE-ACCEPT-LANGUAGE" id=
3073         "HIDE-ACCEPT-LANGUAGE">8.5.21. hide-accept-language</a></h4>
3074
3075         <div class="VARIABLELIST">
3076           <dl>
3077             <dt>Typical use:</dt>
3078
3079             <dd>
3080               <p>Pretend to use different language settings.</p>
3081             </dd>
3082
3083             <dt>Effect:</dt>
3084
3085             <dd>
3086               <p>Deletes or replaces the <span class=
3087               "QUOTE">"Accept-Language:"</span> HTTP header in client
3088               requests.</p>
3089             </dd>
3090
3091             <dt>Type:</dt>
3092
3093             <dd>
3094               <p>Parameterized.</p>
3095             </dd>
3096
3097             <dt>Parameter:</dt>
3098
3099             <dd>
3100               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
3101               defined value.</p>
3102             </dd>
3103
3104             <dt>Notes:</dt>
3105
3106             <dd>
3107               <p>Faking the browser's language settings can be useful to make
3108               a foreign User-Agent set with <tt class="LITERAL"><a href=
3109               "actions-file.html#HIDE-USER-AGENT">hide-user-agent</a></tt>
3110               more believable.</p>
3111
3112               <p>However some sites with content in different languages check
3113               the <span class="QUOTE">"Accept-Language:"</span> to decide
3114               which one to take by default. Sometimes it isn't possible to
3115               later switch to another language without changing the
3116               <span class="QUOTE">"Accept-Language:"</span> header first.</p>
3117
3118               <p>Therefore it's a good idea to either only change the
3119               <span class="QUOTE">"Accept-Language:"</span> header to
3120               languages you understand, or to languages that aren't wide
3121               spread.</p>
3122
3123               <p>Before setting the <span class=
3124               "QUOTE">"Accept-Language:"</span> header to a rare language,
3125               you should consider that it helps to make your requests unique
3126               and thus easier to trace. If you don't plan to change this
3127               header frequently, you should stick to a common language.</p>
3128             </dd>
3129
3130             <dt>Example usage (section):</dt>
3131
3132             <dd>
3133               <table border="0" bgcolor="#E0E0E0" width="90%">
3134                 <tr>
3135                   <td>
3136                     <pre class="SCREEN">
3137 # Pretend to use Canadian language settings.
3138 {+hide-accept-language{en-ca} \
3139 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
3140 }
3141 /
3142 </pre>
3143                   </td>
3144                 </tr>
3145               </table>
3146             </dd>
3147           </dl>
3148         </div>
3149       </div>
3150
3151       <div class="SECT3">
3152         <h4 class="SECT3"><a name="HIDE-CONTENT-DISPOSITION" id=
3153         "HIDE-CONTENT-DISPOSITION">8.5.22. hide-content-disposition</a></h4>
3154
3155         <div class="VARIABLELIST">
3156           <dl>
3157             <dt>Typical use:</dt>
3158
3159             <dd>
3160               <p>Prevent download menus for content you prefer to view inside
3161               the browser.</p>
3162             </dd>
3163
3164             <dt>Effect:</dt>
3165
3166             <dd>
3167               <p>Deletes or replaces the <span class=
3168               "QUOTE">"Content-Disposition:"</span> HTTP header set by some
3169               servers.</p>
3170             </dd>
3171
3172             <dt>Type:</dt>
3173
3174             <dd>
3175               <p>Parameterized.</p>
3176             </dd>
3177
3178             <dt>Parameter:</dt>
3179
3180             <dd>
3181               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
3182               defined value.</p>
3183             </dd>
3184
3185             <dt>Notes:</dt>
3186
3187             <dd>
3188               <p>Some servers set the <span class=
3189               "QUOTE">"Content-Disposition:"</span> HTTP header for documents
3190               they assume you want to save locally before viewing them. The
3191               <span class="QUOTE">"Content-Disposition:"</span> header
3192               contains the file name the browser is supposed to use by
3193               default.</p>
3194
3195               <p>In most browsers that understand this header, it makes it
3196               impossible to <span class="emphasis"><i class="EMPHASIS">just
3197               view</i></span> the document, without downloading it first,
3198               even if it's just a simple text file or an image.</p>
3199
3200               <p>Removing the <span class=
3201               "QUOTE">"Content-Disposition:"</span> header helps to prevent
3202               this annoyance, but some browsers additionally check the
3203               <span class="QUOTE">"Content-Type:"</span> header, before they
3204               decide if they can display a document without saving it first.
3205               In these cases, you have to change this header as well, before
3206               the browser stops displaying download menus.</p>
3207
3208               <p>It is also possible to change the server's file name
3209               suggestion to another one, but in most cases it isn't worth the
3210               time to set it up.</p>
3211
3212               <p>This action will probably be removed in the future, use
3213               server-header filters instead.</p>
3214             </dd>
3215
3216             <dt>Example usage:</dt>
3217
3218             <dd>
3219               <table border="0" bgcolor="#E0E0E0" width="90%">
3220                 <tr>
3221                   <td>
3222                     <pre class="SCREEN">
3223 # Disarm the download link in Sourceforge's patch tracker
3224 { -filter \
3225  +content-type-overwrite{text/plain}\
3226  +hide-content-disposition{block} }
3227  .sourceforge.net/tracker/download\.php
3228 </pre>
3229                   </td>
3230                 </tr>
3231               </table>
3232             </dd>
3233           </dl>
3234         </div>
3235       </div>
3236
3237       <div class="SECT3">
3238         <h4 class="SECT3"><a name="HIDE-IF-MODIFIED-SINCE" id=
3239         "HIDE-IF-MODIFIED-SINCE">8.5.23. hide-if-modified-since</a></h4>
3240
3241         <div class="VARIABLELIST">
3242           <dl>
3243             <dt>Typical use:</dt>
3244
3245             <dd>
3246               <p>Prevent yet another way to track the user's steps between
3247               sessions.</p>
3248             </dd>
3249
3250             <dt>Effect:</dt>
3251
3252             <dd>
3253               <p>Deletes the <span class="QUOTE">"If-Modified-Since:"</span>
3254               HTTP client header or modifies its value.</p>
3255             </dd>
3256
3257             <dt>Type:</dt>
3258
3259             <dd>
3260               <p>Parameterized.</p>
3261             </dd>
3262
3263             <dt>Parameter:</dt>
3264
3265             <dd>
3266               <p>Keyword: <span class="QUOTE">"block"</span>, or a user
3267               defined value that specifies a range of hours.</p>
3268             </dd>
3269
3270             <dt>Notes:</dt>
3271
3272             <dd>
3273               <p>Removing this header is useful for filter testing, where you
3274               want to force a real reload instead of getting status code
3275               <span class="QUOTE">"304"</span>, which would cause the browser
3276               to use a cached copy of the page.</p>
3277
3278               <p>Instead of removing the header, <tt class=
3279               "LITERAL">hide-if-modified-since</tt> can also add or subtract
3280               a random amount of time to/from the header's value. You specify
3281               a range of minutes where the random factor should be chosen
3282               from and <span class="APPLICATION">Privoxy</span> does the
3283               rest. A negative value means subtracting, a positive value
3284               adding.</p>
3285
3286               <p>Randomizing the value of the <span class=
3287               "QUOTE">"If-Modified-Since:"</span> makes it less likely that
3288               the server can use the time as a cookie replacement, but you
3289               will run into caching problems if the random range is too
3290               high.</p>
3291
3292               <p>It is a good idea to only use a small negative value and let
3293               <tt class="LITERAL"><a href=
3294               "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>
3295               handle the greater changes.</p>
3296
3297               <p>It is also recommended to use this action together with
3298               <tt class="LITERAL"><a href=
3299               "actions-file.html#CRUNCH-IF-NONE-MATCH">crunch-if-none-match</a></tt>,
3300               otherwise it's more or less pointless.</p>
3301             </dd>
3302
3303             <dt>Example usage (section):</dt>
3304
3305             <dd>
3306               <table border="0" bgcolor="#E0E0E0" width="90%">
3307                 <tr>
3308                   <td>
3309                     <pre class="SCREEN">
3310 # Let the browser revalidate but make tracking based on the time less likely.
3311 {+hide-if-modified-since{-60} \
3312  +overwrite-last-modified{randomize} \
3313  +crunch-if-none-match}
3314 /
3315 </pre>
3316                   </td>
3317                 </tr>
3318               </table>
3319             </dd>
3320           </dl>
3321         </div>
3322       </div>
3323
3324       <div class="SECT3">
3325         <h4 class="SECT3"><a name="HIDE-FROM-HEADER" id=
3326         "HIDE-FROM-HEADER">8.5.24. hide-from-header</a></h4>
3327
3328         <div class="VARIABLELIST">
3329           <dl>
3330             <dt>Typical use:</dt>
3331
3332             <dd>
3333               <p>Keep your (old and ill) browser from telling web servers
3334               your email address</p>
3335             </dd>
3336
3337             <dt>Effect:</dt>
3338
3339             <dd>
3340               <p>Deletes any existing <span class="QUOTE">"From:"</span> HTTP
3341               header, or replaces it with the specified string.</p>
3342             </dd>
3343
3344             <dt>Type:</dt>
3345
3346             <dd>
3347               <p>Parameterized.</p>
3348             </dd>
3349
3350             <dt>Parameter:</dt>
3351
3352             <dd>
3353               <p>Keyword: <span class="QUOTE">"block"</span>, or any user
3354               defined value.</p>
3355             </dd>
3356
3357             <dt>Notes:</dt>
3358
3359             <dd>
3360               <p>The keyword <span class="QUOTE">"block"</span> will
3361               completely remove the header (not to be confused with the
3362               <tt class="LITERAL"><a href=
3363               "actions-file.html#BLOCK">block</a></tt> action).</p>
3364
3365               <p>Alternately, you can specify any value you prefer to be sent
3366               to the web server. If you do, it is a matter of fairness not to
3367               use any address that is actually used by a real person.</p>
3368
3369               <p>This action is rarely needed, as modern web browsers don't
3370               send <span class="QUOTE">"From:"</span> headers anymore.</p>
3371             </dd>
3372
3373             <dt>Example usage:</dt>
3374
3375             <dd>
3376               <table border="0" bgcolor="#E0E0E0" width="90%">
3377                 <tr>
3378                   <td>
3379                     <pre class="SCREEN">
3380 +hide-from-header{block}
3381 </pre>
3382                   </td>
3383                 </tr>
3384               </table>or
3385
3386               <table border="0" bgcolor="#E0E0E0" width="90%">
3387                 <tr>
3388                   <td>
3389                     <pre class="SCREEN">
3390 +hide-from-header{spam-me-senseless@sittingduck.example.com}
3391 </pre>
3392                   </td>
3393                 </tr>
3394               </table>
3395             </dd>
3396           </dl>
3397         </div>
3398       </div>
3399
3400       <div class="SECT3">
3401         <h4 class="SECT3"><a name="HIDE-REFERRER" id="HIDE-REFERRER">8.5.25.
3402         hide-referrer</a></h4><a name="HIDE-REFERER" id="HIDE-REFERER"></a>
3403
3404         <div class="VARIABLELIST">
3405           <dl>
3406             <dt>Typical use:</dt>
3407
3408             <dd>
3409               <p>Conceal which link you followed to get to a particular
3410               site</p>
3411             </dd>
3412
3413             <dt>Effect:</dt>
3414
3415             <dd>
3416               <p>Deletes the <span class="QUOTE">"Referer:"</span> (sic) HTTP
3417               header from the client request, or replaces it with a forged
3418               one.</p>
3419             </dd>
3420
3421             <dt>Type:</dt>
3422
3423             <dd>
3424               <p>Parameterized.</p>
3425             </dd>
3426
3427             <dt>Parameter:</dt>
3428
3429             <dd>
3430               <ul>
3431                 <li>
3432                   <p><span class="QUOTE">"conditional-block"</span> to delete
3433                   the header completely if the host has changed.</p>
3434                 </li>
3435
3436                 <li>
3437                   <p><span class="QUOTE">"conditional-forge"</span> to forge
3438                   the header if the host has changed.</p>
3439                 </li>
3440
3441                 <li>
3442                   <p><span class="QUOTE">"block"</span> to delete the header
3443                   unconditionally.</p>
3444                 </li>
3445
3446                 <li>
3447                   <p><span class="QUOTE">"forge"</span> to pretend to be
3448                   coming from the homepage of the server we are talking
3449                   to.</p>
3450                 </li>
3451
3452                 <li>
3453                   <p>Any other string to set a user defined referrer.</p>
3454                 </li>
3455               </ul>
3456             </dd>
3457
3458             <dt>Notes:</dt>
3459
3460             <dd>
3461               <p><tt class="LITERAL">conditional-block</tt> is the only
3462               parameter, that isn't easily detected in the server's log file.
3463               If it blocks the referrer, the request will look like the
3464               visitor used a bookmark or typed in the address directly.</p>
3465
3466               <p>Leaving the referrer unmodified for requests on the same
3467               host allows the server owner to see the visitor's <span class=
3468               "QUOTE">"click path"</span>, but in most cases she could also
3469               get that information by comparing other parts of the log file:
3470               for example the User-Agent if it isn't a very common one, or
3471               the user's IP address if it doesn't change between different
3472               requests.</p>
3473
3474               <p>Always blocking the referrer, or using a custom one, can
3475               lead to failures on servers that check the referrer before they
3476               answer any requests, in an attempt to prevent their content
3477               from being embedded or linked to elsewhere.</p>
3478
3479               <p>Both <tt class="LITERAL">conditional-block</tt> and
3480               <tt class="LITERAL">forge</tt> will work with referrer checks,
3481               as long as content and valid referring page are on the same
3482               host. Most of the time that's the case.</p>
3483
3484               <p><tt class="LITERAL">hide-referer</tt> is an alternate
3485               spelling of <tt class="LITERAL">hide-referrer</tt> and the two
3486               can be can be freely substituted with each other. (<span class=
3487               "QUOTE">"referrer"</span> is the correct English spelling,
3488               however the HTTP specification has a bug - it requires it to be
3489               spelled as <span class="QUOTE">"referer"</span>.)</p>
3490             </dd>
3491
3492             <dt>Example usage:</dt>
3493
3494             <dd>
3495               <table border="0" bgcolor="#E0E0E0" width="90%">
3496                 <tr>
3497                   <td>
3498                     <pre class="SCREEN">
3499 +hide-referrer{forge}
3500 </pre>
3501                   </td>
3502                 </tr>
3503               </table>or
3504
3505               <table border="0" bgcolor="#E0E0E0" width="90%">
3506                 <tr>
3507                   <td>
3508                     <pre class="SCREEN">
3509 +hide-referrer{http://www.yahoo.com/}
3510 </pre>
3511                   </td>
3512                 </tr>
3513               </table>
3514             </dd>