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