In the first third of the file, mention several times that
[privoxy.git] / doc / source / user-manual.sgml
1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
2 <!entity % dummy "IGNORE"> 
3 <!entity supported SYSTEM "supported.sgml">
4 <!entity newfeatures SYSTEM "newfeatures.sgml">
5 <!entity p-intro SYSTEM "privoxy.sgml">
6 <!entity seealso SYSTEM "seealso.sgml">
7 <!entity buildsource SYSTEM "buildsource.sgml">
8 <!entity contacting SYSTEM "contacting.sgml">
9 <!entity history SYSTEM "history.sgml">
10 <!entity copyright SYSTEM "copyright.sgml">
11 <!entity license SYSTEM "license.sgml">
12 <!entity p-authors SYSTEM "p-authors.sgml">
13 <!entity config SYSTEM "p-config.sgml">
14 <!entity p-version "3.0.7">
15 <!entity p-status "UNRELEASED">
16 <!entity % p-authors-formal "INCLUDE"> <!-- include additional text, etc  -->
17 <!entity % p-not-stable "INCLUDE">
18 <!entity % p-stable "IGNORE">
19 <!entity % p-text "IGNORE">        <!-- define we are not a text only doc -->
20 <!entity % p-doc "INCLUDE">        <!-- and we are a formal doc           -->
21 <!entity % p-readme "IGNORE">
22 <!entity % user-man "IGNORE">
23 <!entity % config-file "IGNORE">
24 <!entity % p-supp-userman "IGNORE"> <!-- Omit some from supported.sgml    -->
25 <!entity  my-copy "&copy;">         <!-- kludge for docbook2man           -->
26 <!entity % draft "IGNORE">          <!-- WIP stuff    -->
27 <!entity  my-app "<application>Privoxy</application>">
28 ]>
29 <!--
30  File        :  $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
31
32  Purpose     :  user manual
33                 This file belongs into
34                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
35
36  $Id: user-manual.sgml,v 2.39 2007/11/05 02:34:49 hal9 Exp $
37
38  Copyright (C) 2001-2007 Privoxy Developers http://www.privoxy.org/
39  See LICENSE.
40
41  ========================================================================
42  NOTE: Please read developer-manual/documentation.html before touching 
43  anything in this, or other Privoxy documentation.
44  ========================================================================
45
46 -->
47
48 <article id="index">
49 <artheader>
50
51 <title>Privoxy &p-version; User Manual</title>
52
53 <pubdate>
54  <subscript>
55 <!-- Completely the wrong markup, but very little is allowed  -->
56 <!-- in this part of an article. FIXME -->
57  <link linkend="copyright">Copyright</link> &my-copy; 2001 - 2007 by 
58  <ulink url="http://www.privoxy.org/">Privoxy Developers</ulink>
59  </subscript>
60 </pubdate>
61
62 <pubdate>$Id: user-manual.sgml,v 2.39 2007/11/05 02:34:49 hal9 Exp $</pubdate>
63
64 <!--
65
66 Note: the following should generate a separate page, and a live link to it,
67 all nicely done. But it doesn't for some mysterious reason. Please leave
68 commented unless it can be fixed proper. For the time being, the
69 copyright/license declarations will be in their own sgml.
70
71 Hal.
72
73
74 -->
75
76
77 <abstract>
78
79 <![%dummy;[
80  <para>
81  <comment>
82   This is here to keep vim syntax file from breaking :/
83   If I knew enough to fix it, I would.
84   PLEASE DO NOT REMOVE! HB: hal@foobox.net
85  </comment>
86  </para>
87 ]]>
88
89  <para>
90   The <citetitle>Privoxy User Manual</citetitle> gives users information on how to
91   install, configure and use <ulink
92   url="http://www.privoxy.org/">Privoxy</ulink>.
93  </para>
94
95 <!-- Include privoxy.sgml boilerplate: -->
96  &p-intro;
97 <!-- end privoxy.sgml -->
98
99  <para>
100   You can find the latest version of the <citetitle>Privoxy User Manual</citetitle> at  <ulink
101   url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/user-manual/</ulink>.
102   Please see the <link linkend="contact">Contact section</link> on how to
103   contact the developers.
104  </para>
105
106 <!--   <para> -->
107 <!--    Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
108 <!--   </para> -->
109 </abstract>
110
111 </artheader>
112
113 <!--   ~~~~~       New section      ~~~~~     -->
114 <sect1 label="1" id="introduction"><title>Introduction</title>
115 <para>
116  This documentation is included with the current &p-status; version of
117  <application>Privoxy</application>, v.&p-version;<![%p-not-stable;[, 
118  and is mostly complete at this point. The most up to date reference for the
119  time being is still the comments in the source files and in the individual
120  configuration files. Development of a new version is currently nearing
121  completion, and includes significant changes and enhancements over
122  earlier versions. ]]>.
123 </para>
124
125 <!-- include only in non-stable versions -->
126 <![%p-not-stable;[
127 <para>
128  Since this is a &p-status; version, not all new features are well tested. This
129  documentation may be slightly out of sync as a result (especially with 
130  CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
131  not many! 
132 </para>
133 ]]>
134
135 <!--   ~~~~~       New section      ~~~~~     -->
136 <sect2 id="features"><title>Features</title>
137 <para>
138  In addition to the core 
139  features of ad blocking and 
140  <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookie</ulink> management,
141  <application>Privoxy</application> provides many supplemental
142  features<![%p-not-stable;[, some of them currently under development]]>, 
143  that give the end-user more control, more privacy and more freedom:
144 </para>
145 <!-- Include newfeatures.sgml boilerplate here: -->
146  &newfeatures;
147 <!-- end boilerplate -->
148 </sect2>
149
150 </sect1>
151
152 <!--  ~  End section  ~  -->
153
154
155 <!--   ~~~~~       New section      ~~~~~     -->
156 <sect1 id="installation"><title>Installation</title>
157
158 <para>
159  <application>Privoxy</application> is available both in convenient pre-compiled
160  packages for a wide range of operating systems, and as raw source code.
161  For most users, we recommend using the packages, which can be downloaded from our
162  <ulink url="http://sourceforge.net/projects/ijbswa/">Privoxy Project
163  Page</ulink>.
164 </para>
165
166 <para>
167  Note: 
168  On some platforms, the installer may remove previously installed versions, if 
169  found. (See below for your platform). In any case <emphasis>be sure to backup
170  your old configuration if it is valuable to you.</emphasis> See the <link
171  linkend="upgradersnote">note to upgraders</link> section below.
172 </para>
173
174 <!--   ~~~~~       New section      ~~~~~     --> 
175 <sect2 id="installation-packages"><title>Binary Packages</title>
176 <para>
177 How to install the binary packages depends on your operating system:
178 </para>
179
180 <!-- XXX: The installation sections should be sorted -->
181
182 <!--   ~~~~~       New section      ~~~~~     -->
183 <sect3 id="installation-pack-rpm"><title>Red Hat and Fedora RPMs</title>
184
185 <para>
186  RPMs can be installed with <literal>rpm -Uvh privoxy-&p-version;-1.rpm</literal>,
187  and will use <filename>/etc/privoxy</filename> for the location 
188  of configuration files.
189 </para>
190
191 <para>
192  Note that on Red Hat, <application>Privoxy</application> will
193  <emphasis>not</emphasis> be automatically started on system boot. You will
194  need to enable that using <command>chkconfig</command>,
195  <command>ntsysv</command>, or similar methods. 
196 </para>
197
198 <para>
199  If you have problems with failed dependencies, try rebuilding the SRC RPM: 
200  <literal>rpm --rebuild privoxy-&p-version;-1.src.rpm</literal>. This 
201  will use your locally installed libraries and RPM version. 
202 </para>
203
204 <para>
205  Also note that if you have a <application>Junkbuster</application> RPM installed
206  on your system, you need to remove it first, because the packages conflict.
207  Otherwise, RPM will try to remove <application>Junkbuster</application>
208  automatically if found, before installing <application>Privoxy</application>.
209 </para>
210 </sect3>
211
212 <!--   ~~~~~       New section      ~~~~~     -->
213 <sect3 id="installation-deb"><title>Debian</title>
214 <para>
215  DEBs can be installed with <literal>apt-get install privoxy</literal>,
216  and will use <filename>/etc/privoxy</filename> for the location of 
217  configuration files.
218 </para>
219 </sect3>
220
221 <!--   ~~~~~       New section      ~~~~~     -->
222 <sect3 id="installation-pack-win"><title>Windows</title>
223
224 <para>
225  Just double-click the installer, which will guide you through
226  the installation process. You will find the configuration files
227  in the same directory as you installed <application>Privoxy</application> in. 
228 </para>
229 <para>
230  Version 3.0.5 beta introduced full <application>Windows</application> service
231  functionality. On Windows only, the <application>Privoxy</application>
232  program has two new command line arguments to install and uninstall
233  <application>Privoxy</application> as a <emphasis>service</emphasis>.
234 </para>
235  <variablelist>
236   <varlistentry>
237    <term>Arguments:</term>
238    <listitem>
239     <para>
240      <replaceable class="parameter">--install</replaceable>[:<replaceable class="parameter">service_name</replaceable>]
241     </para>
242     <para>
243      <replaceable class="parameter">--uninstall</replaceable>[:<replaceable class="parameter">service_name</replaceable>]
244     </para>
245    </listitem>
246   </varlistentry>
247  </variablelist>
248  <para>
249  After invoking <application>Privoxy</application> with
250  <command>--install</command>, you will need to bring up the
251  <application>Windows</application> service console to assign the user you
252  want <application>Privoxy</application> to run under, and whether or not you
253  want it to run whenever the system starts. You can start the
254  <application>Windows</application> services console with the following
255  command: <command>services.msc</command>.  If you do not take the manual step
256  of modifying <application>Privoxy's</application> service settings, it will
257  not start.  Note too that you will need to give Privoxy a user account that
258  actually exists, or it will not be permitted to 
259  write to its log and configuration files.
260 </para>
261
262 </sect3>
263
264 <!--   ~~~~~       New section      ~~~~~     -->
265 <sect3 id="installation-pack-bintgz"><title>Solaris <!--, NetBSD, HP-UX--></title>
266
267 <para>
268  Create a new directory, <literal>cd</literal> to it, then unzip and
269  untar the archive. For the most part, you'll have to figure out where
270  things go. <!-- FIXME, more info needed? -->
271 </para>
272 </sect3>
273
274 <!--   ~~~~~       New section      ~~~~~     -->
275 <sect3 id="installation-os2"><title>OS/2</title>
276
277 <para>
278  First, make sure that no previous installations of
279  <application>Junkbuster</application> and / or 
280  <application>Privoxy</application> are left on your
281  system. Check that no <application>Junkbuster</application>
282  or <application>Privoxy</application> objects are in
283  your startup folder.
284
285 </para>
286
287 <para>
288  Then, just double-click the WarpIN self-installing archive, which will
289  guide you through the installation process. A shadow of the
290  <application>Privoxy</application> executable will be placed in your
291  startup folder so it will start automatically whenever OS/2 starts.
292 </para>
293
294 <para>
295  The directory you choose to install <application>Privoxy</application>
296  into will contain all of the configuration files.
297 </para>
298 </sect3>
299
300 <!--   ~~~~~       New section      ~~~~~     -->
301 <sect3 id="installation-mac"><title>Mac OSX</title>
302 <para>
303  Unzip the downloaded file (you can either double-click on the file
304  from the finder, or from the desktop if you downloaded it there).
305  Then, double-click on the package installer icon named
306  <literal>Privoxy.pkg</literal>
307  and follow the installation process.
308  <application>Privoxy</application> will be installed in the folder
309  <literal>/Library/Privoxy</literal>.
310  It will start automatically whenever you start up.  To prevent it from
311  starting automatically, remove or rename the folder
312  <literal>/Library/StartupItems/Privoxy</literal>. 
313 </para>
314 <para>
315  To start Privoxy by hand, double-click on 
316  <literal>StartPrivoxy.command</literal> in the
317  <literal>/Library/Privoxy</literal> folder.
318  Or, type this command in the Terminal:
319 </para>
320 <para>
321   <screen>
322   /Library/Privoxy/StartPrivoxy.command
323   </screen>
324 </para>
325 <para>
326  You will be prompted for the administrator password.
327 </para>
328 </sect3>
329
330 <!--   ~~~~~       New section      ~~~~~     -->
331 <sect3 id="installation-amiga"><title>AmigaOS</title>
332 <para>
333  Copy and then unpack the <filename>lha</filename> archive to a suitable location. 
334  All necessary files will be installed into <application>Privoxy</application>
335  directory, including all configuration and log files. To uninstall, just 
336  remove this directory.
337 </para>
338 </sect3>
339
340 <!--   ~~~~~       New section      ~~~~~     -->
341 <sect3 id="installation-tbz"><title>FreeBSD</title>
342
343 <para>
344  Privoxy is part of FreeBSD's Ports Collection, you can build and install
345  it with <literal>cd /usr/ports/www/privoxy; make install clean</literal>.
346 </para>
347 <para>
348  If you don't use the ports, you can fetch and install
349  the package with <literal>pkg_add -r privoxy</literal>.
350 </para>
351 <para>
352  The port skeleton and the package can also be downloaded from the
353  <ulink url="https://sourceforge.net/project/showfiles.php?group_id=11118">File Release
354  Page</ulink>, but there's no reason to use them unless you're interested in the
355  beta releases which are only available there.
356 </para>
357 </sect3>
358
359 <!--   ~~~~~       New section      ~~~~~     -->
360 <sect3 id="installattion-gentoo"><title>Gentoo</title>
361 <para>
362  Gentoo source packages (Ebuilds) for <application>Privoxy</application> are 
363  contained in the Gentoo  Portage Tree (they are not on the download page, 
364  but there is a Gentoo section, where you can see when a new 
365  <application>Privoxy</application> Version is added to the  Portage Tree).
366 </para>
367 <para>
368  Before installing <application>Privoxy</application> under Gentoo just do 
369  first <literal>emerge rsync</literal> to get the latest changes from the 
370  Portage tree. With <literal>emerge privoxy</literal> you install the latest 
371  version.
372 </para>
373 <para>
374  Configuration files are in <filename>/etc/privoxy</filename>, the 
375  documentation is in <filename>/usr/share/doc/privoxy-&p-version;</filename>
376  and the Log directory is in <filename>/var/log/privoxy</filename>.
377 </para>
378 </sect3>
379
380 </sect2>
381
382 <!--   ~~~~~       New section      ~~~~~     -->
383 <sect2 id="installation-source"><title>Building from Source</title>
384
385 <para>
386  The most convenient way to obtain the <application>Privoxy</application> sources
387  is to download the source tarball from our 
388  <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118&amp;package_id=10571">project download
389  page</ulink>.
390 </para>
391
392 <para>
393  If you like to live on the bleeding edge and are not afraid of using
394  possibly unstable development versions, you can check out the up-to-the-minute
395  version directly from <ulink url="http://sourceforge.net/cvs/?group_id=11118">the
396  CVS repository</ulink>. 
397 <!-- 
398  deprecated...out of business.
399  or simply download <ulink
400  url="http://cvs.sourceforge.net/cvstarballs/ijbswa-cvsroot.tar.bz2">the nightly CVS
401  tarball.</ulink>
402 -->
403 </para>
404
405 <!-- include buildsource.sgml boilerplate: -->
406 &buildsource;
407 <!-- end boilerplate -->
408
409 </sect2>
410 <!--   ~~~~~       New section      ~~~~~     --> 
411 <sect2 id="installation-keepupdated"><title>Keeping your Installation Up-to-Date</title>
412 <para>
413  As user feedback comes in and development continues, we will make updated versions
414  of both the main <link linkend="actions-file">actions file</link> (as a <ulink
415  url="http://sourceforge.net/project/showfiles.php?group_id=11118&amp;release_id=103670">separate
416  package</ulink>) and the software itself (including the actions file) available for
417  download.
418 </para>
419
420 <para>
421  If you wish to receive an email notification whenever we release updates of
422  <application>Privoxy</application> or the actions file, <ulink
423  url="http://lists.sourceforge.net/lists/listinfo/ijbswa-announce/">subscribe
424  to our announce  mailing list</ulink>, ijbswa-announce@lists.sourceforge.net.
425 </para>
426
427 <para>
428  In order not to lose your personal changes and adjustments when updating
429  to the latest <literal>default.action</literal> file we <emphasis>strongly
430  recommend</emphasis> that you use <literal>user.action</literal> and 
431  <literal>user.filter</literal> for your local
432  customizations of <application>Privoxy</application>. See the <link
433  linkend="actions-file">Chapter on actions files</link> for details.
434 </para>
435
436 </sect2>
437
438
439 </sect1>
440
441 <!--  ~  End section  ~  -->
442
443 <!--   ~~~~~       New section      ~~~~~     -->
444 <sect1 id="whatsnew">
445 <title>What's New in this Release</title>
446 <para>
447  There are many improvements and new features since <application>Privoxy 3.0.6</application>, the last stable release:
448 </para>
449
450 <para>
451  <itemizedlist>
452   <listitem>
453    <para>
454     Header filtering can be done with dedicated header filters now. As a result
455     the actions <quote>filter-client-headers</quote> and <quote>filter-server-headers</quote>
456     that were introduced with <application>Privoxy 3.0.5</application> to apply
457     the content filters to the headers as, well have been removed again.
458    </para>
459   </listitem>
460
461 <!-- pre-3.0.6 changes: 
462  <listitem>
463   <para>  
464    There are a number of new <link linkend="actions-file">actions</link>:
465   </para>
466   
467   <para>
468   <itemizedlist>
469      
470      <listitem>
471       <para>
472        <literal><link linkend="content-type-overwrite">content-type-overwrite</link></literal>
473       </para>
474      </listitem>
475      <listitem>
476       <para>
477        <literal><link linkend="crunch-client-header">crunch-client-header</link></literal>
478       </para>
479      </listitem>
480      <listitem>
481       <para>
482        <literal><link linkend="crunch-if-none-match">crunch-if-none-match</link></literal>
483       </para>
484      </listitem>
485      <listitem>
486       <para>
487        <literal><link linkend="crunch-server-header">crunch-server-header</link></literal>
488       </para>
489      </listitem>
490      <listitem>
491       <para>
492        <literal><link linkend="filter-client-headers">filter-client-headers</link></literal>
493       </para>
494      </listitem>
495      <listitem>
496       <para>
497        <literal><link linkend="filter-server-headers">filter-server-headers</link></literal>
498       </para>
499      </listitem>
500      <listitem>
501       <para>
502        <literal><link linkend="force-text-mode">force-text-mode</link></literal>
503       </para>
504      </listitem>
505      <listitem>
506       <para>
507        <literal><link linkend="handle-as-empty-document">handle-as-empty-document</link></literal>
508       </para>
509      </listitem>
510      <listitem>
511       <para>
512        <literal><link linkend="hide-accept-language">hide-accept-language</link></literal>
513       </para>
514      </listitem>
515      <listitem>
516       <para>
517        <literal><link linkend="hide-content-disposition">hide-content-disposition</link></literal>
518       </para>
519      </listitem>
520      <listitem>
521       <para>
522        <literal><link linkend="hide-if-modified-since">hide-if-modified-since</link></literal>
523       </para>
524      </listitem>
525     <listitem>
526       <para>
527        <literal><link linkend="inspect-jpegs">inspect-jpegs</link></literal>
528       </para>
529      </listitem>
530      <listitem>
531       <para>
532        <literal><link linkend="overwrite-last-modified">overwrite-last-modified</link></literal>
533       </para>
534      </listitem>
535      <listitem>
536       <para>
537        <literal><link linkend="redirect">redirect</link></literal>
538       </para>
539      </listitem>
540      <listitem>
541       <para>
542        <literal><link linkend="treat-forbidden-connects-like-blocks">treat-forbidden-connects-like-blocks</link></literal>
543       </para>
544      </listitem>
545
546   </itemizedlist>
547   </para>
548   <para>
549      In addition, <literal><link linkend="fast-redirects">fast-redirects</link></literal>
550      has been significantly improved with enhanced syntax.
551   </para>
552    <para>
553      And <literal><link linkend="hide-referrer">hide-referrer</link></literal>
554      has a new option, <literal>conditional block</literal>.
555    </para>
556  
557  </listitem>
558
559   <listitem>
560    <para>
561     <application>MS-Windows</application> versions can now be 
562     <link
563     linkend="installation-pack-win">installed and 
564     started as a <emphasis>Windows service</emphasis></link>.
565    </para>
566   </listitem>
567
568   <listitem>
569    <para>
570     <filename>config</filename> has two new options: 
571     <link
572     linkend="enable-remote-http-toggle">enable-remote-http-toggle</link>, 
573     and <link
574     linkend="forwarded-connect-retries">forwarded-connect-retries</link>.
575    </para>
576    <para>
577     And there is improved handling of the <link
578     linkend="user-manual">user-manual</link>
579     option, for placing documentation and help files on the local system.
580    </para>
581   </listitem>
582   
583   <listitem>
584    <para>
585     There are six new <link linkend="FILTER">filters</link>.
586    </para>
587   </listitem>
588
589   <listitem>
590    <para>
591     Actions files problems and suggestions are now being directed to: 
592     <ulink url="http://sourceforge.net/tracker/?group_id=11118&amp;atid=460288">http://sourceforge.net/tracker/?group_id=11118&amp;atid=460288</ulink>.
593     Please use this to report such configuration related problems as missed
594     ads, sites that don't function properly due to one action or another, 
595     innocent images being blocked, etc.
596    </para>
597   </listitem>
598   
599   <listitem>
600    <para>
601     In addition, there are numerous bug fixes and significant enhancements,
602     including error pages should no longer be cached if the problem is fixed,
603     much better DNS error handling, various logging improvements, and 
604     configuration updates for better ad blocking and junk elimination.
605    </para>
606   </listitem>
607 -->
608
609  </itemizedlist>
610 </para>
611
612 <!--   ~~~~~       New section      ~~~~~     -->
613
614 <sect2 id="upgradersnote">
615 <title>Note to Upgraders</title>
616
617 <para>
618  A quick list of things to be aware of before upgrading from earlier 
619  versions of <application>Privoxy</application>:
620 </para>
621
622 <para>
623  <itemizedlist>
624
625  <listitem>
626   <para>  
627     Some installers may remove earlier versions completely, including 
628     configuration files. Save any important configuration files!
629   </para>
630  </listitem>
631  <listitem>
632   <para>  
633    On the other hand, other installers may not overwrite any existing configuration 
634    files, thinking you will want to do that. You may want to manually check 
635    your saved files against the newer versions to see if the improvements have
636    merit, or whether there are new options that you may want to consider.
637    There are a number of new features, but most won't be available unless 
638    these features are incorporated into your configuration somehow.
639   </para>
640  </listitem>
641  <listitem>
642   <para>  
643    <filename>standard.action</filename> now only includes the enabled actions.
644    Not all actions as before.
645   </para>
646  </listitem>
647  <!--
648  <listitem>
649     <para>
650      See the full documentation on 
651      <literal><link linkend="fast-redirects">fast-redirects</link></literal>
652      which has changed syntax, and will require adjustments to local configs, 
653      such as <filename>user.action</filename>. You must reference the new 
654      syntax: 
655    </para>
656    <para>
657  <screen>
658   { +fast-redirects{check-decoded-url} }
659    .example.com
660    mybank.com
661    .google.</screen>
662 </para>
663
664   </listitem>
665   -->
666  <listitem>
667     <para>
668      Logging is off by default now. If you need logging, it can be turned on
669      in the <link linkend="logfile">config file</link>.
670     </para>
671   </listitem>
672
673  <listitem>
674     <para>
675      Three other config file settings are now off by default: 
676      <link linkend="enable-remote-toggle">enable-remote-toggle</link>,
677      <link linkend="enable-remote-http-toggle">enable-remote-http-toggle</link>,
678      and  <link linkend="enable-edit-actions">enable-edit-actions</link>. 
679      If you use or want these, you will need to explicitly enable them, and
680      be aware of the security issues involved. 
681     </para>
682   </listitem>
683
684 <!--
685  <listitem>
686   <para>  
687    What constitutes a <quote>default</quote> configuration has changed, 
688    and you may want to review which actions are <quote>on</quote> by 
689    default. This is primarily a matter of emphasis, but some features 
690    you may have been used to, may now be <quote>off</quote> by default.
691    There are also a number of new actions and filters you may want to
692    consider, most of which are not fully incorporated into the default
693    settings as yet (see above).
694   </para>
695  </listitem>
696 -->
697 <!--
698   <listitem>
699    <para>
700     The default actions setting is now <literal>Cautious</literal>. Previous
701     releases had a default setting of <literal>Medium</literal>. Experienced
702     users may want to adjust this, as it is fairly conservative by &my-app;
703     standards and past practices. See <ulink
704     url="http://config.privoxy.org/edit-actions-list?f=default">
705     http://config.privoxy.org/edit-actions-list?f=default</ulink>. New users
706     should try the default settings for a while before turning up the volume.
707    </para>
708   </listitem>
709
710   <listitem>
711    <para>
712     The default setting has filtering turned <emphasis>off</emphasis>, which
713     subsequently means that compression is <emphasis>on</emphasis>. Remember
714     that filtering does not work on compressed pages, so if you use, or want to
715     use, filtering, you will need to force compression off. Example:
716    </para>
717    <para>
718  <screen>
719   { +<link linkend="filter">filter</link>{google}  +<link linkend="prevent-compression">prevent-compression</link> }
720    .google.</screen>
721    </para>
722    <para>
723     Or if you use a number of filters, or filter many sites, you may just want
724     to turn off compression for all sites in
725     <filename>default.action</filename> (or
726     <filename>user.action</filename>). 
727    </para>
728
729   </listitem>
730
731   <listitem>
732   <para>
733    Also, <link linkend="SESSION-COOKIES-ONLY">session-cookies-only</link> is 
734    off by default now. If you've liked this feature in the past, you may want 
735    to turn it back on in <filename>user.action</filename> now.
736   </para>
737   </listitem>
738
739
740   <listitem>
741   <para>
742    Some installers may not automatically start
743    <application>Privoxy</application> after installation.
744   </para>
745  </listitem> 
746 -->
747
748  </itemizedlist>
749 </para>
750
751 </sect2>
752 </sect1>
753
754 <!--   ~~~~~       New section      ~~~~~     -->
755 <sect1 id="quickstart"><title>Quickstart to Using Privoxy</title>
756 <para>
757  <itemizedlist>
758
759  <listitem>
760   <para>
761   Install <application>Privoxy</application>. See the <link
762   linkend="installation">Installation Section</link> below for platform specific
763   information. 
764  </para>
765  </listitem>  
766
767  <listitem>
768   <para>
769    Advanced users and those who want to offer <application>Privoxy</application>
770    service to more than just their local machine should check the <link
771    linkend="config">main config file</link>, especially the <link
772    linkend="access-control">security-relevant</link> options. These are 
773    off by default.
774   </para>
775  </listitem>  
776
777  <listitem>
778   <para>
779   Start <application>Privoxy</application>, if the installation program has
780   not done this already (may vary according to platform). See the section
781   <link linkend="startup">Starting <application>Privoxy</application></link>.
782   </para>
783  </listitem>
784
785  <listitem>
786   <para>
787    Set your browser to use <application>Privoxy</application> as HTTP and
788    HTTPS (SSL)  <ulink url="http://en.wikipedia.org/wiki/Proxy_server">proxy</ulink>
789    by setting the proxy configuration for address of
790    <literal>127.0.0.1</literal> and port <literal>8118</literal>.
791    <emphasis>DO NOT</emphasis> activate proxying for <literal>FTP</literal> or 
792    any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your
793    browser from using these protocols.
794   </para>
795  </listitem>  
796
797  <listitem>
798   <para>
799     Flush your browser's disk and memory caches, to remove any cached ad images.
800     If using <application>Privoxy</application> to manage 
801     <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookies</ulink>,
802     you should remove any currently stored cookies too.
803   </para>
804  </listitem> 
805
806  <listitem>
807   <para>
808    A default installation should provide a reasonable starting point for 
809    most. There will undoubtedly be occasions where you will want to adjust the
810    configuration, but that can be dealt with as the need arises. Little 
811    to no initial configuration is required in most cases, you may want
812    to enable the
813    <ulink url="config.html#ENABLE-EDIT-ACTIONS">web-based action editor</ulink> though.
814    Be sure to read the warnings first.
815   </para>
816   <para>
817    See the <link linkend="configuration">Configuration section</link> for more
818    configuration options, and how to customize your installation.
819    You might also want to look at the <link
820    linkend="quickstart-ad-blocking">next section</link> for a quick
821    introduction to how <application>Privoxy</application> blocks ads and
822    banners.
823 </para>
824  </listitem> 
825
826  <listitem>
827   <para>
828     If you experience ads that slip through, innocent images that are
829     blocked, or otherwise feel the need to fine-tune
830     <application>Privoxy's</application> behavior, take a look at the <link
831     linkend="actions-file">actions files</link>. As a quick start, you might
832     find the <link linkend="act-examples">richly commented examples</link>
833     helpful. You can also view and edit the actions files through the <ulink
834     url="http://config.privoxy.org">web-based user interface</ulink>. The
835     Appendix <quote><link linkend="actionsanat">Troubleshooting: Anatomy of an
836     Action</link></quote> has hints on how to understand and debug actions that
837     <quote>misbehave</quote>.
838   </para>
839  </listitem> 
840
841 <!--
842  Did anyone test these lately?
843  fk 2007-11-10
844  <listitem>
845   <para>
846    For easy access to &my-app;'s most important controls, drag the provided
847    <link linkend="bookmarklets">Bookmarklets</link> into your browser's
848    personal toolbar.
849   </para>
850  </listitem> 
851 -->
852
853  <listitem>
854   <para>
855    Please see the section <link linkend="contact">Contacting the
856    Developers</link> on how to report bugs, problems with websites or to get
857    help. 
858   </para>
859  </listitem> 
860
861  <listitem>
862   <para>
863    Now enjoy surfing with enhanced control, comfort and privacy!
864   </para>
865  </listitem> 
866
867  </itemizedlist>
868 </para>
869
870
871 <!--   ~~~~~       New section      ~~~~~     -->
872
873 <sect2 id="quickstart-ad-blocking">
874 <title>Quickstart to Ad Blocking</title>
875 <!--
876  NOTE:  This section is deliberately redundant for those that don't 
877  want to read the whole thing (which is getting lengthy).
878 -->
879 <para>
880  Ad blocking is but one of <application>Privoxy's</application>
881  array of features. Many of these features are for the technically minded advanced 
882  user. But, ad and banner blocking is surely common ground for everybody.
883 </para>
884 <para> 
885  This section will provide a quick summary of ad blocking so 
886  you can get up to speed quickly without having to read the more extensive
887  information provided below, though this is highly recommended.
888 </para>
889 <para>
890  First a bit of a warning ... blocking ads is much like blocking SPAM: the
891  more aggressive you are about it, the more likely you are to block 
892  things that were not intended. And the more likely that some things 
893  may not work as intended. So there is a trade off here. If you want
894  extreme ad free browsing, be prepared to deal with more
895  <quote>problem</quote> sites, and to spend more time adjusting the
896  configuration to solve these unintended consequences. In short, there is 
897  not an easy way to eliminate <emphasis>all</emphasis> ads. Either take 
898  the easy way and settle for <emphasis>most</emphasis> ads blocked with the
899  default configuration, or jump in and tweak it for your personal surfing
900  habits and preferences.
901 </para>
902 <para>
903  Secondly, a brief explanation of <application>Privoxy's </application>
904  <quote>actions</quote>. <quote>Actions</quote> in this context, are 
905  the directives we use to tell <application>Privoxy</application> to perform
906  some task relating to HTTP transactions (i.e. web browsing). We tell
907  <application>Privoxy</application> to take some <quote>action</quote>. Each
908  action has a unique name and function. While there are many potential
909  <application>actions</application> in <application>Privoxy's</application>
910  arsenal, only a few are used for ad blocking. <link
911  linkend="actions">Actions</link>, and <link linkend="actions-file">action
912  configuration files</link>, are explained in depth below.
913 </para>
914 <para>
915  Actions are specified in <application>Privoxy's</application> configuration,
916  followed by one or more URLs to which the action should apply. URLs 
917  can actually be URL type <link linkend="af-patterns">patterns</link> that use
918  wildcards so they can apply potentially to a range of similar URLs. The
919  actions, together with the URL patterns are called a section.
920 </para>
921 <para>
922  When you connect to a website, the full URL will either match one or more
923  of the sections as defined in <application>Privoxy's</application> configuration,
924  or not. If so, then <application>Privoxy</application> will perform the
925  respective actions. If not, then nothing special happens. Furthermore, web
926  pages may contain embedded, secondary URLs that your web browser will
927  use to load additional components of the page, as it parses the
928  original page's HTML content. An ad image for instance, is just an URL
929  embedded in the page somewhere. The image itself may be on the same server,
930  or a server somewhere else on the Internet. Complex web pages will have many
931  such embedded URLs. &my-app; can deal with each URL individually, so, for
932  instance, the main page text is not touched, but images from such-and-such
933  server are blocked.
934 </para>
935
936 <para>
937  The most important actions for basic ad blocking are:  <literal><link
938  linkend="block">block</link></literal>, <literal><link
939  linkend="handle-as-image">handle-as-image</link></literal>, 
940  <literal><link
941  linkend="handle-as-empty-document">handle-as-empty-document</link></literal>,and
942  <literal><link linkend="set-image-blocker">set-image-blocker</link></literal>:
943 </para>
944
945 <para>
946  <itemizedlist>
947   
948  <listitem>
949   <para>
950    <literal><link linkend="block">block</link></literal> - this is perhaps 
951    the single most used action, and is particularly important for ad blocking.
952    This action stops any contact between your browser and any URL patterns
953    that match this action's configuration. It can be used for blocking ads,
954    but also anything that is determined to be unwanted. By itself, it simply
955    stops any communication with the remote server and sends
956    <application>Privoxy</application>'s own built-in BLOCKED page instead to
957    let you now what has happened (with some exceptions, see below).
958   </para>
959  </listitem> 
960
961  <listitem>
962   <para>
963    <literal><link linkend="handle-as-image">handle-as-image</link></literal> - 
964    tells <application>Privoxy</application> to treat this URL as an image.
965    <application>Privoxy</application>'s default configuration already does this
966    for all common image types (e.g. GIF), but there are many situations where this
967    is not so easy to determine. So we'll force it in these cases. This is particularly
968    important for ad blocking, since  only if we know that it's an image of
969    some kind, can we replace it with an image of our choosing, instead of the 
970    <application>Privoxy</application> BLOCKED page (which would only result in
971    a <quote>broken image</quote> icon). There are some limitations to this
972    though. For instance, you can't just brute-force an image substitution for
973    an entire HTML page in most situations.
974   </para>
975  </listitem> 
976
977  <listitem>
978   <para>
979    <literal><link linkend="handle-as-empty-document">handle-as-empty-document</link></literal> - 
980    sends an empty document instead of <application>Privoxy's</application> 
981    normal BLOCKED HTML page. This is useful for file types that are neither 
982    HTML nor images, such as blocking JavaScript files.
983   </para>
984  </listitem> 
985
986  <listitem>
987   <para>
988    <literal><link
989    linkend="set-image-blocker">set-image-blocker</link></literal> - tells
990    <application>Privoxy</application> what to display in place of an ad image that
991    has hit a block rule. For this to come into play, the URL must match a
992    <literal><link linkend="block">block</link></literal> action somewhere in the
993    configuration, <emphasis>and</emphasis>, it must also match an
994    <literal><link linkend="handle-as-image">handle-as-image</link></literal> action.
995   </para>
996   <para>
997    The configuration options on what to display instead of the ad are:
998   </para>
999   <simplelist>
1000    <member>
1001     &nbsp;&nbsp;&nbsp;<emphasis>pattern</emphasis> - a checkerboard pattern, so that an ad 
1002     replacement is obvious. This is the default.
1003    </member>
1004   </simplelist>
1005   <simplelist>
1006    <member>
1007     &nbsp;&nbsp;&nbsp;<emphasis>blank</emphasis> - A very small empty GIF image is displayed.
1008     This is the so-called <quote>invisible</quote> configuration option.
1009    </member>
1010   </simplelist>
1011   <simplelist>
1012    <member>
1013     &nbsp;&nbsp;&nbsp;<emphasis>http://&lt;URL&gt;</emphasis> - A redirect to any image anywhere
1014     of the user's choosing (advanced usage).
1015    </member>
1016   </simplelist>
1017   </listitem> 
1018
1019 </itemizedlist>
1020 </para>
1021
1022 <para>
1023  The quickest way to adjust any of these settings is with your browser through
1024  the special <application>Privoxy</application> editor at <ulink
1025  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
1026  (shortcut: <ulink url="http://p.p/">http://p.p/show-status</ulink>). This 
1027  is an internal page, and does not require Internet access.
1028 </para>
1029
1030 <para>
1031  Note that as of <application>Privoxy</application> 3.0.7 beta the
1032  action editor is disabled by default. Check the
1033  <ulink url="config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions
1034   section in the configuration file</ulink> to learn why and in which
1035  cases it's safe to enable again.
1036 </para>
1037
1038 <para>
1039  If you decided to enable the action editor, select the appropriate
1040  <quote>actions</quote> file, and click
1041  <quote><guibutton>Edit</guibutton></quote>. It is best to put personal or
1042  local preferences in <filename>user.action</filename> since this is not
1043  meant to be overwritten during upgrades, and will over-ride the settings in
1044  other files. Here you can insert new <quote>actions</quote>, and URLs for ad
1045  blocking or other purposes, and make other adjustments to the configuration.
1046  <application>Privoxy</application> will detect these changes automatically.
1047 </para>
1048
1049 <para>
1050  A quick and simple step by step example:
1051 </para>
1052
1053 <para>
1054  <itemizedlist>
1055
1056   <listitem>
1057    <para>
1058      Right click on the ad image to be blocked, then select 
1059      <quote><guimenuitem>Copy Link Location</guimenuitem></quote> from the
1060      pop-up menu. 
1061    </para>
1062   </listitem> 
1063   <listitem>
1064    <para>
1065     Set your browser to 
1066     <ulink
1067  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
1068    </para>
1069   </listitem> 
1070   <listitem>
1071    <para>
1072     Find <filename>user.action</filename> in the top section, and click 
1073     on <quote><guibutton>Edit</guibutton></quote>:
1074    </para>
1075
1076  <!-- image of editor and actions files selections -->
1077  <para>
1078   <figure pgwide="0" float="0"><title>Actions Files in Use</title>
1079    <mediaobject>
1080      <imageobject>
1081       <imagedata  fileref="files-in-use.jpg" format="jpg">
1082        </imageobject> 
1083        <textobject>
1084         <phrase>[ Screenshot of Actions Files in Use ]</phrase>
1085       </textobject>
1086    </mediaobject>
1087   </figure>
1088  </para>
1089  </listitem> 
1090  
1091  <listitem>
1092   <para>
1093    You should have a section with only
1094    <literal><link linkend="block">block</link></literal> listed under 
1095    <quote>Actions:</quote>.
1096    If not, click a <quote><guibutton>Insert new section below</guibutton></quote>
1097    button, and in the new section that just appeared, click the 
1098    <guibutton>Edit</guibutton> button right under the word <quote>Actions:</quote>.
1099    This will bring up a list of all actions. Find
1100    <literal><link linkend="block">block</link></literal> near the top, and click
1101    in the <quote>Enabled</quote> column, then <quote><guibutton>Submit</guibutton></quote>
1102    just below the list.
1103   </para>
1104  </listitem> 
1105  <listitem>
1106   <para>
1107    Now, in the <literal><link linkend="block">block</link></literal> actions section,
1108    click the <quote><guibutton>Add</guibutton></quote> button, and paste the URL the
1109    browser got from <quote><guimenuitem>Copy Link Location</guimenuitem></quote>.
1110    Remove the <literal>http://</literal> at the beginning of the URL. Then, click
1111    <quote><guibutton>Submit</guibutton></quote> (or
1112    <quote><guibutton>OK</guibutton></quote> if in a pop-up window).
1113   </para>
1114  </listitem> 
1115  <listitem>
1116   <para>
1117    Now go back to the original page, and press <keycap>SHIFT-Reload</keycap>
1118    (or flush all browser caches). The image should be gone now.
1119   </para>
1120  </listitem> 
1121  
1122  </itemizedlist>
1123 </para>
1124
1125 <para>
1126  This is a very crude and simple example. There might be good reasons to use a 
1127  wildcard pattern match to include potentially similar images from the same
1128  site. For a more extensive explanation of <quote>patterns</quote>, and 
1129  the entire actions concept, see <link linkend="actions-file">the Actions
1130  section</link>.
1131 </para>
1132
1133 <para>
1134  For advanced users who want to hand edit their config files, you might want
1135  to now go to the <link linkend="act-examples">Actions Files Tutorial</link>.
1136  The ideas explained therein also apply to the web-based editor.
1137 </para>
1138 <para>
1139  There are also various 
1140  <link linkend="filter">filters</link> that can be used for ad blocking 
1141  (filters are a special subset of actions). These 
1142  fall into the <quote>advanced</quote> usage category, and are explained in
1143  depth in later sections. 
1144 </para>
1145
1146 </sect2>
1147
1148 </sect1>
1149
1150 <!--  ~  End section  ~  -->
1151
1152
1153 <!--   ~~~~~       New section      ~~~~~     -->
1154 <sect1 id="startup">
1155 <title>Starting Privoxy</title>
1156 <para>
1157  Before launching <application>Privoxy</application> for the first time, you
1158  will want to configure your browser(s) to use
1159  <application>Privoxy</application> as a HTTP and HTTPS (SSL) 
1160  <ulink url="http://en.wikipedia.org/wiki/Proxy_server">proxy</ulink>. The default is
1161  127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions
1162  used port 8000). This is the one configuration step <emphasis>that must be done
1163 </emphasis>!
1164 </para>
1165 <para>
1166  Please note that <application>Privoxy</application> can only proxy HTTP and 
1167  HTTPS traffic. It will not work with FTP or other protocols.
1168 </para>
1169
1170  <!-- image of Mozilla Proxy configuration -->
1171  <para>
1172   <figure pgwide="0" float="0"><title>Proxy Configuration Showing
1173   Mozilla/Netscape HTTP and HTTPS (SSL) Settings</title>
1174    <mediaobject>
1175      <imageobject>
1176       <imagedata  fileref="proxy_setup.jpg" format="jpg">
1177        </imageobject> 
1178        <textobject>
1179         <phrase>[ Screenshot of Mozilla Proxy Configuration ]</phrase>
1180       </textobject>
1181    </mediaobject>
1182   </figure>
1183  </para>
1184  
1185
1186 <para> 
1187  With <application>Firefox</application>, this is typically set under:
1188 </para>
1189  
1190 <literallayout>
1191  <guibutton>Tools</guibutton> -> <guibutton>Options</guibutton> -> <guibutton>General</guibutton> -> <guibutton>Connection Settings</guibutton> -> <guibutton>Manual Proxy Configuration</guibutton>
1192
1193 </literallayout>
1194
1195 <para> 
1196  Or optionally on some platforms:
1197 </para>
1198  
1199 <literallayout>
1200  <guibutton>Edit</guibutton> -> <guibutton>Preferences</guibutton> -> <guibutton>General</guibutton> -> <guibutton>Connection Settings</guibutton> -> <guibutton>Manual Proxy Configuration</guibutton>
1201
1202 </literallayout>
1203
1204
1205 <para> 
1206  With <application>Netscape</application> (and
1207  <application>Mozilla</application>), this can be set under:
1208 </para>
1209
1210
1211 <literallayout>
1212 <!-- Mix ascii and gui art, something for everybody -->
1213 <!-- spacing on this is tricky -->
1214  <guibutton>Edit</guibutton> -> <guibutton>Preferences</guibutton> -> <guibutton>Advanced</guibutton> -> <guibutton>Proxies</guibutton> -> <guibutton>HTTP Proxy</guibutton>
1215
1216 </literallayout>
1217
1218 <para>
1219  For <application>Internet Explorer v.5-6</application>: 
1220 </para>
1221
1222 <literallayout>
1223  <guibutton>Tools</guibutton> -> <guibutton>Internet Options</guibutton> -> <guibutton>Connections</guibutton> -> <guibutton>LAN Settings</guibutton>
1224 </literallayout>
1225
1226 <para>
1227  Then, check <quote>Use Proxy</quote> and fill in the appropriate info
1228  (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), if you want HTTPS
1229  proxy support too (sometimes labeled <quote>Secure</quote>). Make sure any
1230  checkboxes like <quote>Use the same proxy server for all protocols</quote> is
1231  <emphasis>UNCHECKED</emphasis>. You want only HTTP and HTTPS (SSL)!
1232 </para>
1233
1234  <!-- image of IE Proxy configuration -->
1235  <para>
1236   <figure pgwide="0" float="0"><title>Proxy Configuration Showing
1237   Internet Explorer HTTP and HTTPS (Secure) Settings</title>
1238    <mediaobject>
1239      <imageobject>
1240       <imagedata  fileref="proxy2.jpg" format="jpg">
1241        </imageobject> 
1242        <textobject>
1243         <phrase>[ Screenshot of IE Proxy Configuration ]</phrase>
1244       </textobject>
1245    </mediaobject>
1246   </figure>
1247  </para>
1248
1249
1250 <para>
1251  After doing this, flush your browser's disk and memory caches to force a
1252  re-reading of all pages and to get rid of any ads that may be cached. Remove 
1253  any <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookies</ulink>,
1254  if you want <application>Privoxy</application> to manage that. You are now
1255  ready to start enjoying the benefits of using
1256  <application>Privoxy</application>!
1257 </para>
1258
1259 <para>
1260  <application>Privoxy</application> itself is typically started by specifying the
1261  main configuration file to be used on the command line. If no configuration
1262  file is specified on the command line, <application>Privoxy</application>
1263  will look for a file named <filename>config</filename> in the current
1264  directory. Except on Win32 where it will try <filename>config.txt</filename>.
1265 </para>
1266
1267 <sect2 id="start-redhat">
1268 <title>Red Hat and Fedora</title>
1269 <para>
1270  A default Red Hat installation may not start &my-app; upon boot. It will use
1271  the file <filename>/etc/privoxy/config</filename> as its main configuration
1272  file.
1273 </para>
1274 <para>
1275  <screen>
1276  # /etc/rc.d/init.d/privoxy start
1277 </screen>
1278 </para>
1279 <para>
1280  Or ...
1281 </para>
1282 <para>
1283  <screen>
1284  # service privoxy start
1285 </screen>
1286 </para>
1287 </sect2>
1288
1289 <sect2 id="start-debian">
1290 <title>Debian</title>
1291 <para>
1292  We use a script. Note that Debian typically starts &my-app; upon booting per
1293  default.  It will use the file
1294  <filename>/etc/privoxy/config</filename> as its main configuration
1295  file.
1296 </para>
1297 <para>
1298  <screen>
1299  # /etc/init.d/privoxy start
1300 </screen>
1301 </para>
1302 </sect2>
1303
1304 <!--
1305  omitting 10/31/06 HB
1306
1307 <sect2 id="start-suse">
1308 <title>SuSE</title>
1309 <para>
1310 We use a script. It will use the file <filename>/etc/privoxy/config</filename>
1311 as its main configuration file. Note that SuSE starts Privoxy upon booting
1312 your PC.
1313 </para>
1314 <para>
1315  <screen>
1316  # rcprivoxy start
1317 </screen>
1318 </para>
1319 </sect2>
1320 -->
1321 <sect2 id="start-windows">
1322 <title>Windows</title>
1323 <para>
1324 Click on the &my-app; Icon to start <application>Privoxy</application>. If no configuration file is
1325  specified on the command line, <application>Privoxy</application> will look
1326  for a file named <filename>config.txt</filename>. Note that Windows will
1327  automatically start &my-app; when the system starts if you chose that option
1328  when installing.
1329 </para>
1330 <para>
1331  <application>Privoxy</application> can run with full Windows service functionality.
1332  On Windows only, the &my-app; program has two new command line arguments
1333  to install and uninstall &my-app; as a service. See the 
1334  <link linkend="installation-pack-win">Windows Installation
1335  instructions</link> for details.
1336 </para>
1337 </sect2>
1338
1339 <sect2 id="start-unices">
1340 <title>Solaris, NetBSD, FreeBSD, HP-UX and others</title>
1341 <para>
1342 Example Unix startup command:
1343 </para>
1344 <para>
1345  <screen>
1346  # /usr/sbin/privoxy /etc/privoxy/config
1347 </screen>
1348 </para>
1349 </sect2>
1350
1351 <sect2 id="start-os2">
1352 <title>OS/2</title>
1353 <para>
1354  During installation, <application>Privoxy</application> is configured to
1355  start automatically when the system restarts. You can start it manually by
1356  double-clicking on the <application>Privoxy</application> icon in the
1357  <application>Privoxy</application> folder.
1358 </para>
1359 </sect2>
1360
1361 <sect2 id="start-macosx">
1362 <title>Mac OSX</title>
1363 <para>
1364  During installation, <application>Privoxy</application> is configured to
1365  start automatically when the system restarts.  To start &my-app; manually,
1366  double-click on the <literal>StartPrivoxy.command</literal> icon in the
1367  <literal>/Library/Privoxy</literal> folder.  Or, type this command
1368  in the Terminal:
1369 </para>
1370 <para>
1371   <screen>
1372   /Library/Privoxy/StartPrivoxy.command
1373   </screen>
1374 </para>
1375 <para>
1376  You will be prompted for the administrator password.
1377 </para>
1378 </sect2>
1379
1380
1381 <sect2 id="start-amigaos">
1382 <title>AmigaOS</title>
1383 <para>
1384  Start <application>Privoxy</application> (with RUN &lt;&gt;NIL:) in your
1385  <filename>startnet</filename> script (AmiTCP), in
1386  <filename>s:user-startup</filename> (RoadShow), as startup program in your
1387  startup script (Genesis), or as startup action (Miami and MiamiDx). 
1388  <application>Privoxy</application> will automatically quit when you quit your
1389  TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that
1390  <application>Privoxy</application> is still running).
1391 </para>
1392 </sect2>
1393
1394 <sect2 id="start-gentoo">
1395 <title>Gentoo</title>
1396 <para>
1397  A script is again used. It will use the file <filename>/etc/privoxy/config 
1398  </filename> as its main configuration file.
1399 </para>
1400 <para>
1401  <screen>
1402  /etc/init.d/privoxy start
1403  </screen>
1404 </para>
1405 <para>
1406  Note that <application>Privoxy</application> is not automatically started at 
1407  boot time by default. You can change this with the <literal>rc-update</literal> 
1408  command.
1409 </para>
1410 <para> 
1411  <screen>
1412  rc-update add privoxy default
1413  </screen>
1414 </para>
1415 </sect2>
1416
1417 <!--
1418
1419 <para>
1420  See the section <link linkend="cmdoptions">Command line options</link> for
1421  further info.
1422 </para>
1423
1424 must find a better place for this paragraph
1425
1426 <para>
1427  The included default configuration files should give a reasonable starting
1428  point. Most of the per site configuration is done in the
1429  <ulink url="actions-file.html"><quote>actions</quote></ulink> files. These are
1430  where various cookie actions are defined, ad and banner blocking, and other
1431  aspects of <application>Privoxy</application> configuration. There are several
1432  such files included, with varying levels of aggressiveness. 
1433 </para>
1434
1435 <para>
1436  You will probably want to keep an eye out for sites for which you may prefer
1437  persistent cookies, and add these to your actions configuration as needed. By
1438  default, most of these will be accepted only during the current browser
1439  session (aka <quote>session cookies</quote>), unless you add them to the
1440  configuration. If you want the browser to handle this instead, you will need
1441  to edit <filename>user.action</filename> (or through the web based interface)
1442  and disable this feature. If you use more than one browser, it would make
1443  more sense to let <application>Privoxy</application> handle this. In which
1444  case, the browser(s) should be set to accept all cookies.
1445 </para>
1446
1447 <para>
1448  Another feature where you will probably want to define exceptions for trusted
1449  sites is the popup-killing (through the <ulink
1450  url="actions-file.html#KILL-POPUPS"><quote>+kill-popups</quote></ulink> and
1451  <ulink
1452  url="actions-file.html#FILTER-POPUPS"><quote>+filter{popups}</quote></ulink>
1453  actions), because your favorite shopping, banking, or leisure site may need
1454  popups (explained below). 
1455 </para>
1456
1457 <para>
1458  <application>Privoxy</application> does not support all of the optional HTTP/1.1
1459  features yet. In the unlikely event that you experience inexplicable problems
1460  with browsers that use HTTP/1.1 per default
1461  (like <application>Mozilla</application> or recent versions of I.E.), you might
1462  try to force HTTP/1.0 compatibility. For Mozilla, look under <literal>Edit -&gt;
1463  Preferences -&gt; Debug -&gt; Networking</literal>.
1464  Alternatively, set the <quote>+downgrade-http-version</quote> config option in
1465  <filename>default.action</filename> which will downgrade your browser's HTTP
1466  requests from HTTP/1.1 to HTTP/1.0 before processing them.
1467 </para>
1468
1469 <para>
1470  After running <application>Privoxy</application> for a while, you can 
1471  start to fine tune the configuration to suit your personal, or site, 
1472  preferences and requirements. There are many, many aspects that can 
1473  be customized. <quote>Actions</quote> 
1474  can be adjusted by pointing your browser to 
1475  <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
1476  (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>), 
1477  and then follow the link to <quote>View &#38; Change the Current Configuration</quote>. 
1478  (This is an internal page and does not require Internet access.)
1479 </para>
1480
1481 <para>
1482  In fact, various aspects of <application>Privoxy</application>
1483  configuration can be viewed from this page, including 
1484  current configuration parameters, source code version numbers, 
1485  the browser's request headers, and <quote>actions</quote> that apply 
1486  to a given URL. In addition to the actions file 
1487  editor mentioned above, <application>Privoxy</application> can also 
1488  be turned <quote>on</quote> and <quote>off</quote> (toggled) from this page.
1489 </para>
1490
1491 <para>
1492  If you encounter problems, try loading the page without
1493  <application>Privoxy</application>. If that helps, enter the URL where
1494  you have the problems into <ulink url="http://p.p/show-url-info">the browser
1495  based rule tracing utility</ulink>. See which rules apply and why, and
1496  then try turning them off for that site one after the other, until the problem
1497  is gone. When you have found the culprit, you might want to turn the rest on
1498  again.
1499 </para>
1500
1501 <para>
1502  If the above paragraph sounds gibberish to you, you might want to <link
1503  linkend="actions-file">read more about the actions concept</link>
1504  or even dive deep into the <link linkend="actionsanat">Appendix
1505  on actions</link>.
1506 </para>
1507
1508 <para>
1509  If you can't get rid of the problem at all, think you've found a bug in
1510  Privoxy, want to propose a new feature or smarter rules, please see the 
1511  section <link linkend="contact"><quote>Contacting the
1512  Developers</quote></link> below. 
1513 </para>
1514
1515 -->
1516
1517 <!--   ~~~~~       New section      ~~~~~     -->
1518 <sect2 id="cmdoptions">
1519 <title>Command Line Options</title>
1520 <para>
1521  <application>Privoxy</application> may be invoked with the following
1522  command-line options:
1523 </para>
1524
1525 <para>
1526  <itemizedlist>
1527
1528  <listitem>
1529   <para>
1530     <emphasis>--version</emphasis>
1531   </para>
1532   <para>
1533      Print version info and exit. Unix only.
1534   </para>
1535  </listitem> 
1536  <listitem>
1537   <para>
1538     <emphasis>--help</emphasis>
1539   </para>
1540   <para>
1541    Print short usage info and exit. Unix only.
1542   </para>
1543  </listitem> 
1544  <listitem>
1545   <para>
1546    <emphasis>--no-daemon</emphasis>
1547   </para>
1548   <para>
1549    Don't become a daemon, i.e. don't fork and become process group
1550    leader, and don't detach from controlling tty. Unix only.
1551   </para>
1552  </listitem> 
1553  <listitem>
1554   <para>
1555    <emphasis>--pidfile FILE</emphasis>
1556   </para>
1557   <para>
1558    On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
1559    <emphasis>FILE</emphasis> on exit. Failure to create or delete the
1560    <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
1561    option is given, no PID file will be used. Unix only.
1562   </para>
1563  </listitem> 
1564  <listitem>
1565   <para>
1566    <emphasis>--user USER[.GROUP]</emphasis>
1567   </para>
1568   <para>
1569    After (optionally) writing the PID file, assume the user  ID  of
1570    <emphasis>USER</emphasis>, and if included the GID of GROUP.  Exit if the
1571    privileges are not sufficient to do so. Unix only.
1572   </para>
1573  </listitem>
1574  <listitem>
1575   <para>
1576    <emphasis>--chroot</emphasis>
1577   </para>
1578   <para>
1579    Before changing to the user ID given in the <emphasis>--user</emphasis> option, 
1580    chroot to that user's home directory, i.e. make the kernel pretend to the &my-app;
1581    process that the directory tree starts there. If set up carefully, this can limit 
1582    the impact of possible vulnerabilities in &my-app; to the files contained in that hierarchy.
1583    Unix only.
1584   </para>
1585  </listitem>
1586  <listitem>
1587   <para>
1588    <emphasis>--pre-chroot-nslookup hostname</emphasis>
1589   </para>
1590   <para>
1591    Specifies a hostname to look up before doing a chroot. On some systems, initializing the
1592    resolver library involves reading config files from /etc and/or loading additional shared
1593    libraries from /lib. On these systems, doing a hostname lookup before the chroot reduces
1594    the number of files that must be copied into the chroot tree.
1595   </para>
1596   <para>
1597    For fastest startup speed, a good value is a hostname that is not in /etc/hosts but that
1598    your local name server (listed in /etc/resolv.conf) can resolve without recursion
1599    (that is, without having to ask any other name servers). The hostname need not exist,
1600    but if it doesn't, an error message (which can be ignored) will be output.
1601   </para>
1602  </listitem>
1603
1604  <listitem>
1605   <para>
1606     <emphasis>configfile</emphasis>
1607   </para>
1608   <para>
1609     If no <emphasis>configfile</emphasis> is included on the command line, 
1610     <application>Privoxy</application> will look for a file named 
1611     <quote>config</quote> in the current directory (except on Win32 
1612     where it will look for <quote>config.txt</quote> instead). Specify 
1613     full path to avoid confusion. If no config file is found, 
1614     <application>Privoxy</application> will fail to start.
1615   </para>
1616  </listitem> 
1617
1618  </itemizedlist>
1619 </para>
1620
1621 <para>
1622  On <application>MS Windows</application> only there are two additional 
1623  command-line options to allow <application>Privoxy</application> to install and 
1624  run as a <emphasis>service</emphasis>. See the 
1625 <link linkend="installation-pack-win">Window Installation section</link> 
1626 for details.
1627 </para>
1628
1629 </sect2>
1630
1631 </sect1>
1632
1633 <!--  ~  End section  ~  -->
1634
1635
1636 <!--   ~~~~~       New section      ~~~~~     -->
1637 <sect1 id="configuration"><title>Privoxy Configuration</title>
1638  <para>
1639   All <application>Privoxy</application> configuration is stored  
1640   in text files. These files can be edited with a text editor.
1641   Many important aspects of <application>Privoxy</application> can 
1642   also be controlled easily with a web browser.
1643  </para>
1644
1645
1646 <!--   ~~~~~       New section      ~~~~~     -->
1647
1648 <sect2>
1649 <title>Controlling Privoxy with Your Web Browser</title>
1650 <para>
1651  <application>Privoxy</application>'s user interface can be reached through the special 
1652  URL <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
1653  (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>), 
1654  which is a built-in page and works without Internet access.
1655  You will see the following section:
1656
1657 </para>
1658
1659 <!-- Needs to be put in a table and colorized  -->
1660 <screen>
1661  <msgtext>
1662  <bridgehead renderas="sect2">&nbsp;&nbsp;&nbsp;&nbsp;Privoxy Menu</bridgehead>
1663
1664  <simplelist>
1665  <member>
1666   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-status">View & change the current configuration</ulink>
1667  </member>
1668  <member>
1669   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-version">View the source code version numbers</ulink>
1670  </member>
1671  <member>
1672   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-request">View the request headers.</ulink>
1673  </member>
1674  <member>
1675   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-url-info">Look up which actions apply to a URL and why</ulink>
1676  </member>
1677  <member>
1678   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/toggle">Toggle Privoxy on or off</ulink>
1679  </member>
1680  <member>
1681   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://www.privoxy.org/
1682   &p-version;/user-manual/">Documentation</ulink>
1683  </member>
1684  </simplelist>
1685  </msgtext>
1686 </screen>
1687
1688
1689 <para>
1690  This should be self-explanatory. Note the first item leads to an editor for the
1691  <link linkend="actions-file">actions files</link>, which is where the ad, banner,
1692  cookie, and URL blocking magic is configured as well as other advanced features of
1693  <application>Privoxy</application>. This is an easy way to adjust various
1694  aspects of <application>Privoxy</application> configuration. The actions
1695  file, and other configuration files, are explained in detail below. 
1696 </para>
1697
1698 <para>
1699  <quote>Toggle Privoxy On or Off</quote> is handy for sites that might 
1700  have problems with your current actions and filters. You can in fact use
1701  it as a test to see whether it is <application>Privoxy</application> 
1702  causing the problem or not. <application>Privoxy</application> continues 
1703  to run as a proxy in this case, but all manipulation is disabled, i.e.
1704  <application>Privoxy</application> acts like a normal forwarding proxy. There
1705  is even a toggle <link linkend="bookmarklets">Bookmarklet</link> offered, so
1706  that you can toggle <application>Privoxy</application> with one click from
1707  your browser.
1708 </para>
1709
1710 <para>
1711  Note that several of the features described above are disabled by default
1712  in <application>Privoxy</application> 3.0.7 beta and later.
1713  Check the
1714  <ulink url="config.html">configuration file</ulink> to learn why
1715  and in which cases it's safe to enable them again.
1716 </para>
1717
1718 </sect2>
1719
1720 <!--  ~  End section  ~  -->
1721
1722
1723
1724
1725 <!--   ~~~~~       New section      ~~~~~     -->
1726
1727 <sect2 id="confoverview">
1728 <title>Configuration Files Overview</title>
1729 <para>
1730  For Unix, *BSD and Linux, all configuration files are located in
1731  <filename>/etc/privoxy/</filename> by default. For MS Windows, OS/2, and
1732  AmigaOS these are all in the same directory as the 
1733  <application>Privoxy</application> executable. <![%p-not-stable;[ The name
1734  and number of configuration files has changed from previous versions, and is
1735  subject to change as development progresses.]]>
1736 </para>
1737
1738 <para>
1739  The installed defaults provide a reasonable starting point, though 
1740  some settings may be aggressive by some standards. For the time being, the
1741  principle configuration files are:
1742 </para>
1743
1744 <para>
1745  <itemizedlist>
1746
1747   <listitem>
1748    <para>
1749      The <link linkend="config">main configuration file</link> is named <filename>config</filename>
1750      on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
1751      on Windows. This is a required file.
1752    </para>
1753   </listitem> 
1754
1755   <listitem>
1756    <para>
1757     <filename>default.action</filename> (the main <link linkend="actions-file">actions file</link>)
1758     is used to define which <quote>actions</quote> relating to banner-blocking, images, pop-ups,
1759     content modification, cookie handling etc should be applied by default. It also defines many
1760     exceptions (both positive and negative) from this default set of actions that enable 
1761     <application>Privoxy</application> to selectively eliminate the junk, and only the junk, on
1762     as many websites as possible.
1763    </para>
1764    <para>
1765     Multiple actions files may be defined in <filename>config</filename>. These 
1766     are processed in the order they are defined. Local customizations and locally 
1767     preferred exceptions to the default policies  as defined in
1768     <filename>default.action</filename> (which you will most probably want
1769     to define sooner or later) are probably best applied in
1770     <filename>user.action</filename>, where you can preserve them across
1771     upgrades. <filename>standard.action</filename> is only for
1772     <application>Privoxy's</application> internal use.
1773    </para>
1774    <para>    
1775     There is also a web based editor that can be accessed from
1776     <ulink
1777     url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
1778     (Shortcut: <ulink
1779     url="http://p.p/show-status">http://p.p/show-status</ulink>) for the
1780     various actions files. 
1781    </para>
1782   </listitem> 
1783
1784   <listitem>
1785    <para>
1786     <quote>Filter files</quote> (the <link linkend="filter-file">filter
1787     file</link>) can be used to re-write the raw page content, including
1788     viewable text as well as embedded HTML and JavaScript, and whatever else
1789     lurks on any given web page. The filtering jobs are only pre-defined here;
1790     whether to apply them or not is up to the actions files. 
1791     <filename>default.filter</filename> includes various filters made 
1792     available for use by the developers. Some are much more intrusive than 
1793     others, and all should be used with caution. You may define additional 
1794     filter files in <filename>config</filename> as you can with 
1795     actions files. We suggest <filename>user.filter</filename> for any 
1796     locally defined filters or customizations.
1797    </para>
1798   </listitem> 
1799
1800  </itemizedlist>
1801 </para>
1802
1803 <para>
1804  The syntax of the configuration and filter files may change between different
1805  Privoxy versions, unfortunately some enhancements cost backwards compatibility.
1806  <!-- Add link to documentation-->
1807 </para>
1808
1809 <para>
1810  All files use the <quote><literal>#</literal></quote> character to denote a
1811  comment (the rest of the line will be ignored) and understand line continuation
1812  through placing a backslash ("<literal>\</literal>") as the very last character
1813  in a line. If the <literal>#</literal> is preceded by a backslash, it looses
1814  its special function. Placing a <literal>#</literal> in front of an otherwise
1815  valid configuration line to prevent it from being interpreted is called "commenting
1816  out" that line. Blank lines are ignored.
1817 </para>
1818
1819 <para>
1820  The actions files and filter files  
1821  can use Perl style <link linkend="regex">regular expressions</link> for
1822  maximum flexibility. 
1823 </para>
1824
1825 <para>
1826  After making any changes, there is no need to restart
1827  <application>Privoxy</application> in order for the changes to take
1828  effect. <application>Privoxy</application> detects such changes 
1829  automatically. Note, however, that it may take one or two additional
1830  requests for the change to take effect. When changing the listening address
1831  of <application>Privoxy</application>, these <quote>wake up</quote> requests
1832  must obviously be sent to the <emphasis>old</emphasis> listening address.
1833 </para>
1834
1835 <![%p-not-stable;[
1836 <para>
1837  While under development, the configuration content is subject to change. 
1838  The below documentation may not be accurate by the time you read this. 
1839  Also, what constitutes a <quote>default</quote> setting, may change, so 
1840  please check all your configuration files on important issues.
1841 </para>
1842 ]]>
1843
1844 </sect2>
1845 </sect1>
1846 <!--  ~  End section  ~  -->
1847
1848
1849 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
1850
1851 <!-- **************************************************** -->
1852 <!-- Include config.sgml here -->
1853 <!-- This is where the entire config file is detailed. -->
1854  &config;
1855 <!-- end include  -->
1856
1857
1858 <!--  ~  End section  ~  -->
1859
1860
1861
1862 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
1863
1864 <sect1 id="actions-file"><title>Actions Files</title>
1865
1866 <para>
1867  The actions files are used to define what <emphasis>actions</emphasis>
1868  <application>Privoxy</application> takes for which URLs, and thus determines
1869  how ad images, cookies and various other aspects of HTTP content and
1870  transactions are handled, and on which sites (or even parts thereof). 
1871  There are a number of such actions, with a wide range of functionality.
1872  Each action does something a little different.
1873  These actions give us a veritable arsenal of tools with which to exert 
1874  our control, preferences and independence. Actions can be combined so that 
1875  their effects are aggregated when applied against a given set of URLs.
1876 </para> 
1877 <para>
1878  There 
1879  are three action files included with <application>Privoxy</application> with
1880  differing purposes:
1881  </para>
1882  
1883  <para>
1884   <itemizedlist>
1885    <listitem>
1886     <para>
1887      <filename>default.action</filename> - is the primary action file 
1888      that sets the initial values for all actions. It is intended to 
1889      provide a base level of functionality for
1890      <application>Privoxy's</application> array of features. So it is 
1891      a set of broad rules that should work reasonably well as-is for most users.
1892      This is the file that the developers are keeping updated, and <link
1893      linkend="installation-keepupdated">making available to users</link>.
1894      The user's preferences as set in <filename>standard.action</filename>,
1895      e.g. either <literal>Cautious</literal> (the default),
1896      <literal>Medium</literal>, or <literal>Advanced</literal> (see
1897      below).
1898     </para>
1899    </listitem> 
1900    <listitem>
1901     <para>
1902      <filename>user.action</filename> - is intended to be for local site 
1903      preferences and exceptions. As an example, if your ISP or your bank
1904      has specific requirements, and need special handling, this kind of 
1905      thing should go here. This file will not be upgraded.
1906     </para>
1907   </listitem> 
1908    <listitem>
1909     <para>
1910      <filename>standard.action</filename> - is used only by the web based editor
1911      at <ulink url="http://config.privoxy.org/edit-actions-list?f=default">
1912      http://config.privoxy.org/edit-actions-list?f=default</ulink>, 
1913      to set various pre-defined sets of rules for the default actions section
1914      in <filename>default.action</filename>. 
1915      </para>
1916      <para>
1917      <guibutton>Edit</guibutton>  <guibutton>Set to Cautious</guibutton> <guibutton>Set to Medium</guibutton>  <guibutton>Set to Advanced</guibutton>
1918      </para>
1919      <para>
1920      These have increasing levels of aggressiveness <emphasis>and have no
1921      influence on your browsing unless you select them explicitly in the
1922      editor</emphasis>. A default installation should be pre-set to 
1923      <literal>Cautious</literal> (versions prior to 3.0.5 were set to
1924      <literal>Medium</literal>). New users should try this for a while before
1925      adjusting the settings to more aggressive levels. The more aggressive 
1926      the settings, then the more likelihood there is of problems such as sites 
1927      not working as they should.
1928      </para>
1929      <para>
1930       The <guibutton>Edit</guibutton> button allows you to turn each 
1931       action on/off individually for fine-tuning. The <guibutton>Cautious</guibutton>
1932       button changes the actions list to low/safe settings which will activate 
1933       ad blocking and a minimal set of &my-app;'s features, and subsequently
1934       there will be less of a chance for accidental problems. The
1935       <guibutton>Medium</guibutton> button sets the list to a medium level of
1936       other features and a low level set of privacy features. The
1937       <guibutton>Advanced</guibutton> button sets the list to a high level of
1938       ad blocking and medium level of privacy. See the chart below. The latter
1939       three buttons over-ride any changes via with the
1940       <guibutton>Edit</guibutton> button. More fine-tuning can be done in the
1941       lower sections of this internal page.
1942      </para>
1943      <para>
1944      It is not recommend to edit the <filename>standard.action</filename> file
1945      itself.
1946     </para>
1947     <para>
1948      The default profiles, and their associated actions, as pre-defined in
1949      <filename>standard.action</filename> are<!-- different than this table which is out of date -->:
1950     </para>
1951     <para>
1952     <table frame=all><title>Default Configurations</title>
1953     <tgroup cols=4 align=left colsep=1 rowsep=1>
1954     <colspec colname=c1>
1955     <colspec colname=c2>
1956     <colspec colname=c3>
1957     <colspec colname=c4>
1958     <thead>
1959     <row>
1960       <entry>Feature</entry>
1961       <entry>Cautious</entry>
1962       <entry>Medium</entry>
1963       <entry>Advanced</entry>
1964     </row>
1965     </thead>
1966     <!--  <tfoot> -->
1967     <!--  <row> -->
1968     <!--    <entry>f1</entry> -->
1969     <!--    <entry>f2</entry> -->
1970     <!--    <entry>f3</entry> -->
1971     <!--    <entry>f4</entry> -->
1972     <!--  </row> -->
1973     <!--  </tfoot> -->
1974     <tbody>
1975
1976     <row>
1977       <entry>Ad-blocking Aggressiveness</entry>
1978       <entry>medium</entry>
1979       <entry>high</entry>
1980       <entry>high</entry>
1981     </row>
1982
1983     <row>
1984       <entry>Ad-filtering by size</entry>
1985       <entry>no</entry>
1986       <entry>yes</entry>
1987       <entry>yes</entry>
1988     </row>
1989
1990     <row>
1991       <entry>Ad-filtering by link</entry>
1992       <entry>no</entry>
1993       <entry>no</entry>
1994       <entry>yes</entry>
1995     </row>
1996     <row>
1997       <entry>Pop-up killing</entry>
1998       <entry>blocks only</entry>
1999       <entry>blocks only</entry>
2000       <entry>blocks only</entry>
2001     </row>
2002     
2003     <row>
2004       <entry>Privacy Features</entry>
2005       <entry>low</entry>
2006       <entry>medium</entry>
2007       <entry>medium/high</entry>
2008     </row>
2009
2010     <row>
2011       <entry>Cookie handling</entry>
2012       <entry>none</entry>
2013       <entry>session-only</entry>
2014       <entry>kill</entry>
2015     </row>
2016
2017     <row>
2018       <entry>Referer forging</entry>
2019       <entry>no</entry>
2020       <entry>yes</entry>
2021       <entry>yes</entry>
2022     </row>
2023
2024
2025     <row>
2026       <entry>GIF de-animation</entry>
2027       <entry>no</entry>
2028       <entry>yes</entry>
2029       <entry>yes</entry>
2030     </row>
2031
2032
2033     <row>
2034       <entry>Fast redirects</entry>
2035       <entry>no</entry>
2036       <entry>no</entry>
2037       <entry>yes</entry>
2038     </row>
2039
2040     <row>
2041       <entry>HTML taming</entry>
2042       <entry>no</entry>
2043       <entry>no</entry>
2044       <entry>yes</entry>
2045     </row>
2046
2047     <row>
2048       <entry>JavaScript taming</entry>
2049       <entry>no</entry>
2050       <entry>no</entry>
2051       <entry>yes</entry>
2052     </row>
2053
2054     <row>
2055       <entry>Web-bug killing</entry>
2056       <entry>no</entry>
2057       <entry>yes</entry>
2058       <entry>yes</entry>
2059     </row>
2060
2061     <row>
2062       <entry>Image tag reordering</entry>
2063       <entry>no</entry>
2064       <entry>no</entry>
2065       <entry>yes</entry>
2066     </row>
2067
2068     </tbody>
2069     </tgroup>
2070     </table>
2071     </para>
2072
2073    </listitem> 
2074   </itemizedlist>
2075  </para> 
2076
2077 <para>
2078  The list of actions files to be used are defined in the main configuration 
2079  file, and are processed in the order they are defined (e.g.
2080  <filename>default.action</filename> is typically processed before
2081  <filename>user.action</filename>). The content of these can all be viewed and
2082  edited from <ulink
2083  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2084  The over-riding principle when applying actions, is that the last action that
2085  matches a given URL wins. The broadest, most general rules go first
2086  (defined in <filename>default.action</filename>),
2087  followed by any exceptions (typically also in
2088  <filename>default.action</filename>), which are then followed lastly by any
2089  local preferences (typically in <emphasis>user</emphasis><filename>.action</filename>). 
2090  Generally, <filename>user.action</filename> has the last word.
2091  </para>
2092
2093 <para>
2094  An actions file typically has multiple sections. If you want to use
2095  <quote>aliases</quote> in an actions file, you have to place the (optional)
2096  <link linkend="aliases">alias section</link> at the top of that file.
2097  Then comes the default set of rules which will apply universally to all
2098  sites and pages (be <emphasis>very careful</emphasis> with using such a
2099  universal set in <filename>user.action</filename> or any other actions file after 
2100  <filename>default.action</filename>, because it will override the result
2101  from consulting any previous file). And then below that,
2102  exceptions to the defined universal policies. You can regard
2103  <filename>user.action</filename> as an appendix to <filename>default.action</filename>,
2104  with the advantage that it is a separate file, which makes preserving your
2105  personal settings across <application>Privoxy</application> upgrades easier.
2106 </para>
2107
2108 <para> 
2109  Actions can be used to block anything you want, including ads, banners, or
2110  just some obnoxious URL whose content you would rather not see. Cookies can be accepted
2111  or rejected, or accepted only during the current browser session (i.e. not
2112  written to disk), content can be modified, some JavaScripts tamed, user-tracking
2113  fooled, and much more. See below for a <link linkend="actions">complete list
2114  of actions</link>.
2115 </para>
2116
2117 <!--   ~~~~~       New section      ~~~~~     -->
2118 <sect2>
2119 <title>Finding the Right Mix</title>
2120 <para>
2121  Note that some <link linkend="actions">actions</link>, like cookie suppression
2122  or script disabling, may render some sites unusable that rely on these
2123  techniques to work properly. Finding the right mix of actions is not always easy and
2124  certainly a matter of personal taste. And, things can always change, requiring 
2125  refinements in the configuration. In general, it can be said that the more
2126  <quote>aggressive</quote> your default settings (in the top section of the
2127  actions file) are, the more exceptions for <quote>trusted</quote> sites you
2128  will have to make later. If, for example, you want to crunch all cookies per
2129  default, you'll have to make exceptions from that rule for sites that you
2130  regularly use and that require cookies for actually useful purposes, like maybe
2131  your bank, favorite shop, or newspaper.
2132 </para>
2133
2134 <para>
2135  We have tried to provide you with reasonable rules to start from in the
2136  distribution actions files. But there is no general rule of thumb on these
2137  things. There just are too many variables, and sites are constantly changing.
2138  Sooner or later you will want to change the rules (and read this chapter again :).
2139 </para>
2140 </sect2>
2141
2142 <!--   ~~~~~       New section      ~~~~~     -->
2143 <sect2>
2144 <title>How to Edit</title>
2145 <para>
2146  The easiest way to edit the actions files is with a browser by
2147  using our browser-based editor, which can be reached from <ulink
2148  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2149  Note: the config file option <link
2150  linkend="enable-edit-actions">enale-edit-actions</link> must be enabled for
2151  this to work. The editor allows both fine-grained control over every single
2152  feature on a per-URL basis, and easy choosing from wholesale sets of defaults
2153  like <quote>Cautious</quote>, <quote>Medium</quote> or
2154  <quote>Advanced</quote>. Warning: the <quote>Advanced</quote> setting is more
2155  aggressive, and will be more likely to cause problems for some sites.
2156  Experienced users only! 
2157  </para>
2158
2159 <para>
2160  If you prefer plain text editing to GUIs, you can of course also directly edit the
2161  the actions files with your favorite text editor. Look at
2162  <filename>default.action</filename> which is richly commented with many 
2163  good examples.
2164 </para>
2165 </sect2>
2166
2167
2168 <sect2 id="actions-apply">
2169 <title>How Actions are Applied to Requests</title>
2170 <para>
2171  Actions files are divided into sections. There are special sections,
2172  like the <quote><link linkend="aliases">alias</link></quote> sections which will
2173  be discussed later. For now let's concentrate on regular sections: They have a
2174  heading line (often split up to multiple lines for readability) which consist
2175  of a list of actions, separated by whitespace and enclosed in curly braces.
2176  Below that, there is a list of URL and tag patterns, each on a separate line.
2177 </para>
2178
2179 <para>
2180  To determine which actions apply to a request, the URL of the request is
2181  compared to all URL patterns in each <quote>action file</quote>.
2182  Every time it matches, the list of applicable actions for the request is
2183  incrementally updated, using the heading of the section in which the
2184  pattern is located. The same is done again for tags and tag patterns later on.
2185 </para>
2186
2187 <para>
2188  If multiple applying sections set the same action differently,
2189  the last match wins. If not, the effects are aggregated.
2190  E.g. a URL might match a regular section with a heading line of <literal>{ 
2191  +<link linkend="handle-as-image">handle-as-image</link> }</literal>,
2192  then later another one with just <literal>{
2193  +<link linkend="block">block</link> }</literal>, resulting
2194  in <emphasis>both</emphasis> actions to apply. And there may well be 
2195  cases where you will want to combine actions together. Such a section then 
2196  might look like:
2197 </para>
2198
2199  <para>
2200  <screen>
2201   { +<literal>handle-as-image</literal>  +<literal>block</literal> }
2202   # Block these as if they were images. Send no block page.
2203    banners.example.com
2204    media.example.com/.*banners
2205    .example.com/images/ads/</screen>
2206  </para>
2207
2208 <para>
2209  You can trace this process for URL patterns and any given URL by visiting <ulink
2210  url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>.
2211 </para>
2212
2213 <para>
2214  Examples and more detail on this is provided in the Appendix, <link linkend="ACTIONSANAT">
2215  Troubleshooting: Anatomy of an Action</link> section.
2216 </para>
2217 </sect2>
2218
2219 <!--   ~~~~~       New section      ~~~~~     -->
2220 <sect2 id="af-patterns">
2221 <title>Patterns</title>
2222 <para> 
2223  As mentioned, <application>Privoxy</application> uses <quote>patterns</quote>
2224  to determine what <emphasis>actions</emphasis> might apply to which sites and
2225  pages your browser attempts to access. These <quote>patterns</quote> use wild
2226  card type <emphasis>pattern</emphasis> matching to achieve a high degree of
2227  flexibility. This allows one expression to be expanded and potentially match
2228  against many similar patterns.
2229 </para>
2230  
2231 <para>
2232  Generally, an URL pattern has the form
2233  <literal>&lt;domain&gt;/&lt;path&gt;</literal>, where both the
2234  <literal>&lt;domain&gt;</literal> and <literal>&lt;path&gt;</literal> are
2235  optional. (This is why the special <literal>/</literal> pattern matches all
2236  URLs). Note that the protocol portion of the URL pattern (e.g.
2237  <literal>http://</literal>) should <emphasis>not</emphasis> be included in
2238  the pattern. This is assumed already!
2239 </para>
2240 <para>
2241  The pattern matching syntax is different for the domain and path parts of
2242  the URL. The domain part uses a simple globbing type matching technique, 
2243  while the path part uses a more flexible 
2244  <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
2245   Expressions (PCRE)</quote></ulink> based syntax.
2246 </para>
2247
2248 <variablelist>
2249  <varlistentry>
2250   <term><literal>www.example.com/</literal></term>
2251   <listitem>
2252    <para>
2253     is a domain-only pattern and will match any request to <literal>www.example.com</literal>,
2254     regardless of which document on that server is requested. So ALL pages in
2255     this domain would be covered by the scope of this action. Note that a 
2256     simple <literal>example.com</literal> is different and would NOT match.
2257    </para>
2258   </listitem>
2259  </varlistentry>
2260  <varlistentry>
2261   <term><literal>www.example.com</literal></term>
2262   <listitem>
2263    <para>
2264     means exactly the same. For domain-only patterns, the trailing <literal>/</literal> may
2265     be omitted.
2266    </para>
2267   </listitem>
2268  </varlistentry>
2269  <varlistentry>
2270   <term><literal>www.example.com/index.html$</literal></term>
2271   <listitem>
2272    <para>
2273     matches all the documents on <literal>www.example.com</literal>
2274     whose name starts with <literal>/index.html</literal>.
2275    </para>
2276   </listitem>
2277  </varlistentry>
2278  <varlistentry>
2279   <term><literal>www.example.com/index.html$</literal></term>
2280   <listitem>
2281    <para>
2282     matches only the single document <literal>/index.html</literal>
2283     on <literal>www.example.com</literal>.
2284    </para>
2285   </listitem>
2286  </varlistentry>
2287  <varlistentry>
2288   <term><literal>/index.html$</literal></term>
2289   <listitem>
2290    <para>
2291     matches the document <literal>/index.html</literal>, regardless of the domain,
2292     i.e. on <emphasis>any</emphasis> web server anywhere.
2293    </para>
2294   </listitem>
2295  </varlistentry>
2296  <varlistentry>
2297   <term><literal>index.html</literal></term>
2298   <listitem>
2299    <para>
2300     matches nothing, since it would be interpreted as a domain name and
2301     there is no top-level domain called <literal>.html</literal>. So its 
2302     a mistake.
2303    </para>
2304   </listitem>
2305  </varlistentry>
2306 </variablelist>
2307
2308
2309 <!--   ~~~~~       New section      ~~~~~     -->
2310 <sect3><title>The Domain Pattern</title>
2311
2312 <para>
2313  The matching of the domain part offers some flexible options: if the
2314  domain starts or ends with a dot, it becomes unanchored at that end. 
2315  For example:
2316 </para>
2317
2318 <variablelist>
2319  <varlistentry>
2320   <term><literal>.example.com</literal></term>
2321   <listitem>
2322    <para>
2323     matches any domain that <emphasis>ENDS</emphasis> in
2324     <literal>.example.com</literal>
2325    </para>
2326   </listitem>
2327  </varlistentry>
2328  <varlistentry>
2329   <term><literal>www.</literal></term>
2330   <listitem>
2331    <para>
2332     matches any domain that <emphasis>STARTS</emphasis> with
2333     <literal>www.</literal>
2334    </para>
2335   </listitem>
2336  </varlistentry>
2337  <varlistentry>
2338   <term><literal>.example.</literal></term>
2339   <listitem>
2340    <para>
2341     matches any domain that <emphasis>CONTAINS</emphasis> <literal>.example.</literal>.
2342     And, by the way, also included would be any files or documents that exist
2343     within that domain since no path limitations are specified. (Correctly
2344     speaking: It matches any FQDN that contains <literal>example</literal> as
2345     a domain.) This might be <literal>www.example.com</literal>,
2346     <literal>news.example.de</literal>, or
2347     <literal>www.example.net/cgi/testing.pl</literal> for instance. All these
2348     cases are matched. 
2349    </para>
2350   </listitem>
2351  </varlistentry>
2352 </variablelist>
2353
2354 <para>
2355  Additionally, there are wild-cards that you can use in the domain names
2356  themselves. These work similarly to shell globbing type wild-cards:
2357  <quote>*</quote> represents zero or more arbitrary characters (this is
2358  equivalent to the 
2359  <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
2360  Expression</quote></ulink> based syntax of <quote>.*</quote>),
2361  <quote>?</quote>  represents any single character (this is equivalent to the
2362  regular expression syntax of a simple <quote>.</quote>), and you can define
2363  <quote>character classes</quote> in square brackets which is similar to 
2364  the same regular expression technique. All of this can be freely mixed:
2365 </para>
2366
2367 <variablelist>
2368  <varlistentry>
2369   <term><literal>ad*.example.com</literal></term>
2370   <listitem>
2371    <para>
2372     matches <quote>adserver.example.com</quote>, 
2373     <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>
2374    </para>
2375   </listitem>
2376  </varlistentry>
2377  <varlistentry>
2378   <term><literal>*ad*.example.com</literal></term>
2379   <listitem>
2380    <para>
2381     matches all of the above, and then some.
2382    </para>
2383   </listitem>
2384  </varlistentry>
2385  <varlistentry>
2386   <term><literal>.?pix.com</literal></term>
2387   <listitem>
2388    <para>
2389     matches <literal>www.ipix.com</literal>,
2390     <literal>pictures.epix.com</literal>, <literal>a.b.c.d.e.upix.com</literal> etc. 
2391    </para>
2392   </listitem>
2393  </varlistentry>
2394  <varlistentry>
2395   <term><literal>www[1-9a-ez].example.c*</literal></term>
2396   <listitem>
2397    <para>
2398      matches <literal>www1.example.com</literal>, 
2399      <literal>www4.example.cc</literal>, <literal>wwwd.example.cy</literal>, 
2400      <literal>wwwz.example.com</literal> etc., but <emphasis>not</emphasis> 
2401      <literal>wwww.example.com</literal>.
2402    </para>
2403   </listitem>
2404  </varlistentry>
2405 </variablelist>
2406
2407 <para>
2408  While flexible, this is not the sophistication of full regular expression based syntax.
2409 </para>
2410
2411 </sect3>
2412
2413 <!--  ~  End section  ~  -->
2414
2415
2416 <!--   ~~~~~       New section      ~~~~~     -->
2417 <sect3><title>The Path Pattern</title>
2418
2419 <para>
2420  <application>Privoxy</application> uses Perl compatible (PCRE)
2421   <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
2422   Expression</quote></ulink> based syntax 
2423  (through the <ulink url="http://www.pcre.org/">PCRE</ulink> library) for
2424  matching the path portion (after the slash), and is thus more flexible.
2425 </para>
2426
2427 <para>
2428  There is an <link linkend="regex">Appendix</link> with a brief quick-start into regular
2429  expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
2430  at <ulink url="http://www.pcre.org/man.txt">http://www.pcre.org/man.txt</ulink>.
2431  You might also find the Perl man page on regular expressions (<literal>man perlre</literal>)
2432  useful, which is available on-line at <ulink
2433  url="http://perldoc.perl.org/perlre.html">http://perldoc.perl.org/perlre.html</ulink>.
2434 </para>
2435
2436 <para>
2437  Note that the path pattern is automatically left-anchored at the <quote>/</quote>,
2438  i.e. it matches as if it would start with a <quote>^</quote> (regular expression speak 
2439  for the beginning of a line).
2440 </para>
2441
2442 <para>
2443  Please also note that matching in the path is <emphasis>CASE INSENSITIVE</emphasis>
2444  by default, but you can switch to case sensitive at any point in the pattern by using the 
2445  <quote>(?-i)</quote> switch: <literal>www.example.com/(?-i)PaTtErN.*</literal> will match
2446  only documents whose path starts with <literal>PaTtErN</literal> in
2447  <emphasis>exactly</emphasis> this capitalization.
2448 </para>
2449
2450 <variablelist>
2451  <varlistentry>
2452   <term><literal>.example.com/.*</literal></term>
2453   <listitem>
2454    <para>
2455      Is equivalent to just <quote>.example.com</quote>, since any documents 
2456      within that domain are matched with or without the <quote>.*</quote>
2457      regular expression. This is redundant
2458    </para>
2459   </listitem>
2460  </varlistentry>
2461  <varlistentry>
2462   <term><literal>.example.com/.*/index.html$</literal></term>
2463   <listitem>
2464    <para>
2465     Will match any page in the domain of <quote>example.com</quote> that is
2466     named <quote>index.html</quote>, and that is part of some path. For
2467     example, it matches <quote>www.example.com/testing/index.html</quote> but
2468     NOT <quote>www.example.com/index.html</quote> because the regular
2469     expression called for at least two <quote>/'s</quote>, thus the path 
2470     requirement. It also would match 
2471     <quote>www.example.com/testing/index_html</quote>, because of the 
2472     special meta-character <quote>.</quote>.
2473    </para>
2474   </listitem>
2475  </varlistentry>
2476  <varlistentry>
2477   <term><literal>.example.com/(.*/)?index\.html$</literal></term>
2478   <listitem>
2479    <para>
2480     This regular expression is conditional so it will match any page 
2481     named <quote>index.html</quote> regardless of path which in this case can 
2482     have one or more <quote>/'s</quote>. And this one must contain exactly 
2483     <quote>.html</quote> (but does not have to end with that!).
2484    </para>
2485   </listitem>
2486  </varlistentry>
2487  <varlistentry>
2488   <term><literal>.example.com/(.*/)(ads|banners?|junk)</literal></term>
2489   <listitem>
2490    <para>
2491     This regular expression will match any path of <quote>example.com</quote>
2492     that contains any of the words <quote>ads</quote>, <quote>banner</quote>, 
2493     <quote>banners</quote> (because of the <quote>?</quote>) or <quote>junk</quote>.
2494     The path does not have to end in these words, just contain them.
2495    </para>
2496   </listitem>
2497  </varlistentry>
2498  <varlistentry>
2499   <term><literal>.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</literal></term>
2500   <listitem>
2501    <para>
2502     This is very much the same as above, except now it must end in either 
2503     <quote>.jpg</quote>, <quote>.jpeg</quote>, <quote>.gif</quote> or <quote>.png</quote>. So this 
2504     one is limited to common image formats.
2505    </para>
2506   </listitem>
2507  </varlistentry>
2508
2509 </variablelist>
2510 <para>
2511  There are many, many good examples to be found in <filename>default.action</filename>, 
2512  and more tutorials below in <link linkend="regex">Appendix on regular expressions</link>.
2513 </para>
2514
2515 </sect3>
2516
2517 <!--  ~  End section  ~  -->
2518
2519
2520 <!--   ~~~~~       New section      ~~~~~     -->
2521 <sect3 id="tag-pattern"><title>The Tag Pattern</title>
2522
2523 <para>
2524  Tag patterns are used to change the applying actions based on the
2525  request's tags. Tags can be created with either the
2526  <link linkend="CLIENT-HEADER-TAGGER">client-header-tagger</link>
2527  or the  <link linkend="SERVER-HEADER-TAGGER">server-header-tagger</link> action.
2528 </para>
2529
2530 <para>
2531  Tag patterns have to start with <quote>TAG:</quote>, so &my-app;
2532  can tell them apart from URL patterns. Everything after the colon
2533  including white space, is interpreted as a regular expression with
2534  path pattern syntax, except that tag patterns aren't left-anchored
2535  automatically (Privoxy doesn't silently add a <quote>^</quote>,
2536  you have to do it yourself if you need it).
2537 </para>
2538
2539 <para>
2540  To match all requests that are tagged with <quote>foo</quote>
2541  your pattern line should be <quote>TAG:^foo$</quote>,
2542  <quote>TAG:foo</quote> would work as well, but it would also
2543  match requests whose tags contain <quote>foo</quote> somewhere.
2544  <quote>TAG: foo</quote> wouldn't work as it requires white space.
2545 </para>
2546
2547 <para>
2548  Sections can contain URL and tag patterns at the same time,
2549  but tag patterns are checked after the URL patterns and thus
2550  always overrule them, even if they are located before the URL patterns.
2551 </para>
2552
2553 <para>
2554  Once a new tag is added, Privoxy checks right away if it's matched by one
2555  of the tag patterns and updates the action settings accordingly. As a result
2556  tags can be used to activate other tagger actions, as long as these other
2557  taggers look for headers that haven't already be parsed.
2558 </para>
2559
2560 <para>
2561  For example you could tag client requests which use the POST method,
2562  use this tag to activate another tagger that adds a tag if cookies
2563  are send, and then block based on the cookie tag. However if you'd
2564  reverse the position of the described taggers, and activated the method
2565  tagger based on the cookie tagger, no method tags would be created.
2566  The method tagger would look for the request line, but at the time
2567  the cookie tag is created the request line has already been parsed.
2568 </para>
2569
2570 <para>
2571  While this is a limitation you should be aware of, this kind of
2572  indirection is seldom needed anyway and even the example doesn't
2573  make too much sense.
2574 </para>
2575
2576 </sect3>
2577
2578 </sect2>
2579
2580 <!--  ~  End section  ~  -->
2581
2582
2583 <!--   ~~~~~       New section      ~~~~~     -->
2584
2585 <sect2 id="actions">
2586 <title>Actions</title>
2587 <para>
2588  All actions are disabled by default, until they are explicitly enabled
2589  somewhere in an actions file. Actions are turned on if preceded with a
2590  <quote>+</quote>, and turned off if preceded with a <quote>-</quote>. So a
2591  <literal>+action</literal> means <quote>do that action</quote>, e.g.
2592  <literal>+block</literal> means <quote>please block URLs that match the
2593  following patterns</quote>, and <literal>-block</literal> means <quote>don't
2594  block URLs that match the following patterns, even if <literal>+block</literal>
2595  previously applied.</quote>
2596
2597 </para>
2598
2599 <para> 
2600  Again, actions are invoked by placing them on a line, enclosed in curly braces and
2601  separated by whitespace, like in 
2602  <literal>{+some-action -some-other-action{some-parameter}}</literal>,
2603  followed by a list of URL patterns, one per line, to which they apply.
2604  Together, the actions line and the following pattern lines make up a section
2605  of the actions file. 
2606 </para>
2607
2608 <para> 
2609  Actions fall into three categories:
2610 </para>
2611
2612 <para>
2613  <itemizedlist>
2614  <listitem>
2615   <para>  
2616    Boolean, i.e the action can only be <quote>enabled</quote> or
2617    <quote>disabled</quote>. Syntax:
2618   </para>
2619   <para>
2620    <screen>
2621   +<replaceable class="function">name</replaceable>        # enable action <replaceable class="parameter">name</replaceable>
2622   -<replaceable class="function">name</replaceable>        # disable action <replaceable class="parameter">name</replaceable></screen>
2623   </para>
2624   <para>  
2625    Example: <literal>+block</literal>
2626   </para>
2627  </listitem>
2628
2629
2630  <listitem>
2631   <para>  
2632    Parameterized, where some value is required in order to enable this type of action.
2633    Syntax:
2634   </para>
2635   <para>
2636    <screen>
2637   +<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>}  # enable action and set parameter to <replaceable class="parameter">param</replaceable>,
2638                # overwriting parameter from previous match if necessary
2639   -<replaceable class="function">name</replaceable>         # disable action. The parameter can be omitted</screen>
2640   </para>
2641   <para>
2642    Note that if the URL matches multiple positive forms of a parameterized action,
2643    the last match wins, i.e. the params from earlier matches are simply ignored.
2644   </para>
2645   <para>  
2646    Example: <literal>+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4}</literal>
2647   </para>
2648  </listitem>
2649  
2650  <listitem>
2651   <para>  
2652    Multi-value. These look exactly like parameterized actions,
2653    but they behave differently: If the action applies multiple times to the
2654    same URL, but with different parameters, <emphasis>all</emphasis> the parameters
2655    from <emphasis>all</emphasis> matches are remembered. This is used for actions
2656    that can be executed for the same request repeatedly, like adding multiple
2657    headers, or filtering through multiple filters. Syntax:
2658   </para>
2659   <para>
2660    <screen>
2661   +<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>}   # enable action and add <replaceable class="parameter">param</replaceable> to the list of parameters
2662   -<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>}   # remove the parameter <replaceable class="parameter">param</replaceable> from the list of parameters
2663                 # If it was the last one left, disable the action.
2664   <replaceable class="parameter">-name</replaceable>          # disable this action completely and remove all parameters from the list</screen>
2665   </para>
2666   <para>  
2667    Examples: <literal>+add-header{X-Fun-Header: Some text}</literal> and
2668    <literal>+filter{html-annoyances}</literal>
2669   </para>
2670  </listitem>
2671
2672  </itemizedlist>
2673 </para>
2674
2675 <para>
2676  If nothing is specified in any actions file, no <quote>actions</quote> are
2677  taken. So in this case <application>Privoxy</application> would just be a
2678  normal, non-blocking, non-filtering proxy. You must specifically enable the
2679  privacy and blocking features you need (although the provided default actions
2680  files will give a good starting point).
2681 </para>
2682
2683 <para>
2684  Later defined action sections always over-ride earlier ones of the same type.
2685  So exceptions to any rules you make, should come in the latter part of the file (or 
2686  in a file that is processed later when using multiple actions files such 
2687  as <filename>user.action</filename>). For multi-valued actions, the actions
2688  are applied in the order they are specified. Actions files are processed in
2689  the order they are defined in <filename>config</filename> (the default
2690  installation has three actions files). It also quite possible for any given
2691  URL to match more than one <quote>pattern</quote> (because of wildcards and
2692  regular expressions), and thus to trigger more than one set of actions! Last
2693  match wins.
2694 </para>
2695
2696 <!-- start actions listing -->
2697 <para>
2698  The list of valid <application>Privoxy</application> actions are:
2699 </para>
2700
2701
2702 <!-- ********************************************************** -->
2703 <!-- Please note the below defined actions use id's that are    -->
2704 <!-- probably linked from other places, so please don't change. -->
2705 <!--                                                            -->
2706 <!-- ********************************************************** -->
2707
2708
2709 <!--   ~~~~~       New section      ~~~~~     -->
2710
2711 <sect3 renderas="sect4" id="add-header">
2712 <title>add-header</title>
2713
2714 <variablelist>
2715  <varlistentry>
2716   <term>Typical use:</term>
2717   <listitem>
2718    <para>Confuse log analysis, custom applications</para>
2719   </listitem>
2720  </varlistentry>
2721
2722  <varlistentry>
2723   <term>Effect:</term>
2724   <listitem>
2725    <para>
2726     Sends a user defined HTTP header to the web server.
2727    </para>
2728   </listitem>
2729  </varlistentry>
2730
2731  <varlistentry>
2732   <term>Type:</term>
2733   <!-- boolean, parameterized, Multi-value -->
2734   <listitem>
2735    <para>Multi-value.</para>
2736   </listitem>
2737  </varlistentry>
2738  
2739  <varlistentry>
2740   <term>Parameter:</term>
2741   <listitem>
2742    <para>
2743     Any string value is possible. Validity of the defined HTTP headers is not checked.
2744     It is recommended that you use the <quote><literal>X-</literal></quote> prefix
2745     for custom headers.
2746    </para>
2747   </listitem>
2748  </varlistentry>
2749  
2750 <varlistentry>
2751   <term>Notes:</term>
2752   <listitem>
2753    <para>
2754     This action may be specified multiple times, in order to define multiple 
2755     headers. This is rarely needed for the typical user. If you don't know what 
2756     <quote>HTTP headers</quote> are, you definitely don't need to worry about this 
2757     one.
2758    </para>
2759   </listitem>
2760  </varlistentry>
2761
2762  <varlistentry>
2763   <term>Example usage:</term>
2764   <listitem>
2765     <para>
2766      <screen>+add-header{X-User-Tracking: sucks}</screen>
2767    </para>
2768   </listitem>
2769  </varlistentry>
2770 </variablelist>
2771 </sect3>
2772
2773
2774 <!--   ~~~~~       New section      ~~~~~     -->
2775 <sect3 renderas="sect4" id="block">
2776 <title>block</title>
2777
2778 <variablelist>
2779  <varlistentry>
2780   <term>Typical use:</term>
2781   <listitem>
2782    <para>Block ads or other unwanted content</para>
2783   </listitem>
2784  </varlistentry>
2785
2786  <varlistentry>
2787   <term>Effect:</term>
2788   <listitem>
2789    <para>
2790     Requests for URLs to which this action applies are blocked, i.e. the
2791     requests are trapped by &my-app; and the requested URL is never retrieved,
2792     but is answered locally with a substitute page or image, as determined by
2793     the <literal><link
2794     linkend="handle-as-image">handle-as-image</link></literal>,
2795     <literal><link
2796     linkend="set-image-blocker">set-image-blocker</link></literal>, and 
2797     <literal><link
2798     linkend="handle-as-empty-document">handle-as-empty-document</link></literal> actions.
2799     
2800    </para>
2801   </listitem>
2802  </varlistentry>
2803
2804  <varlistentry>
2805   <term>Type:</term>
2806   <!-- boolean, parameterized, Multi-value -->
2807   <listitem>
2808    <para>Boolean.</para>
2809   </listitem>
2810  </varlistentry>
2811
2812  <varlistentry>
2813   <term>Parameter:</term>
2814   <listitem>
2815    <para>N/A</para>
2816   </listitem>
2817  </varlistentry>
2818  
2819 <varlistentry>
2820   <term>Notes:</term>
2821   <listitem>
2822    <para>
2823     <application>Privoxy</application> sends a special <quote>BLOCKED</quote> page
2824     for requests to blocked pages. This page contains links to find out why the request
2825     was blocked, and a click-through to the blocked content (the latter only if compiled with the
2826     force feature enabled). The <quote>BLOCKED</quote> page adapts to the available
2827     screen space -- it displays full-blown if space allows, or miniaturized and text-only
2828     if loaded into a small frame or window. If you are using <application>Privoxy</application>
2829     right now, you can take a look at the 
2830     <ulink url="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"><quote>BLOCKED</quote>
2831     page</ulink>.
2832    </para>
2833    <para> 
2834     A very important exception occurs if <emphasis>both</emphasis> 
2835     <literal>block</literal> and <literal><link linkend="handle-as-image">handle-as-image</link></literal>,
2836     apply to the same request: it will then be replaced by an image. If 
2837     <literal><link linkend="set-image-blocker">set-image-blocker</link></literal>
2838     (see below) also applies, the type of image will be determined by its parameter,
2839     if not, the standard checkerboard pattern is sent.
2840    </para>
2841    <para>
2842     It is important to understand this process, in order 
2843     to understand how <application>Privoxy</application> deals with 
2844     ads and other unwanted content. Blocking is a core feature, and one 
2845     upon which various other features depend.
2846    </para>
2847    <para>
2848     The <literal><link linkend="filter">filter</link></literal>
2849     action can perform a very similar task, by <quote>blocking</quote>
2850     banner images and other content through rewriting the relevant URLs in the
2851     document's HTML source, so they don't get requested in the first place.
2852     Note that this is a totally different technique, and it's easy to confuse the two.
2853    </para>
2854   </listitem>
2855  </varlistentry>
2856
2857  <varlistentry>
2858   <term>Example usage (section):</term>
2859   <listitem>
2860     <para>
2861      <screen>{+block}      
2862 # Block and replace with "blocked" page
2863  .nasty-stuff.example.com
2864
2865 {+block +handle-as-image} 
2866 # Block and replace with image
2867  .ad.doubleclick.net
2868  .ads.r.us/banners/
2869
2870 {+block +handle-as-empty-document} 
2871 # Block and then ignore
2872  adserver.exampleclick.net/.*\.js$</screen>
2873     </para>
2874   </listitem>
2875  </varlistentry>
2876
2877
2878 </variablelist>
2879 </sect3>
2880
2881
2882 <!--   ~~~~~       New section      ~~~~~     -->
2883 <sect3 renderas="sect4" id="client-header-filter">
2884 <title>client-header-filter</title>
2885
2886 <variablelist>
2887  <varlistentry>
2888   <term>Typical use:</term>
2889   <listitem>
2890    <para>
2891    Rewrite or remove single client headers.
2892    </para>
2893   </listitem>
2894  </varlistentry>
2895
2896  <varlistentry>
2897   <term>Effect:</term>
2898   <listitem>
2899    <para>
2900     All client headers to which this action applies are filtered on-the-fly through
2901     the specified regular expression based substitutions.
2902    </para>
2903   </listitem>
2904  </varlistentry>
2905
2906  <varlistentry>
2907   <term>Type:</term>
2908   <!-- boolean, parameterized, Multi-value -->
2909   <listitem>
2910    <para>Parameterized.</para>
2911   </listitem>
2912  </varlistentry>
2913
2914  <varlistentry>
2915   <term>Parameter:</term>
2916   <listitem>
2917    <para>
2918     The name of a client-header filter, as defined in one of the
2919     <link linkend="filter-file">filter files</link>.
2920    </para>
2921   </listitem>
2922  </varlistentry>
2923  
2924  <varlistentry>
2925   <term>Notes:</term>
2926   <listitem>
2927    <para>
2928     Client-header filters are applied to each header on its own, not to
2929     all at once. This makes it easier to diagnose problems, but on the downside
2930     you can't write filters that only change header x if header y's value is z.
2931     You can do that by using tags though.
2932    </para>
2933    <para>
2934     Client-header filters are executed after the other header actions have finished
2935     and use their output as input.
2936    </para>
2937    <para>
2938     Please refer to the <link linkend="filter-file">filter file chapter</link>
2939     to learn which client-header filters are available by default, and how to
2940     create your own.
2941    </para>
2942
2943   </listitem>
2944  </varlistentry>
2945
2946  <varlistentry>
2947   <term>Example usage (section):</term>
2948   <listitem>
2949     <para>
2950      <screen>
2951 {+client-header-filter{hide-tor-exit-notation}}
2952 .exit/
2953     </screen>
2954     </para>
2955   </listitem>
2956  </varlistentry>
2957
2958 </variablelist>
2959 </sect3>
2960
2961
2962 <!--   ~~~~~       New section      ~~~~~     -->
2963 <sect3 renderas="sect4" id="client-header-tagger">
2964 <title>client-header-tagger</title>
2965
2966 <variablelist>
2967  <varlistentry>
2968   <term>Typical use:</term>
2969   <listitem>
2970    <para>
2971    Block requests based on their headers.
2972    </para>
2973   </listitem>
2974  </varlistentry>
2975
2976  <varlistentry>
2977   <term>Effect:</term>
2978   <listitem>
2979    <para>
2980     Client headers to which this action applies are filtered on-the-fly through
2981     the specified regular expression based substitutions, the result is used as
2982     tag. 
2983    </para>
2984   </listitem>
2985  </varlistentry>
2986
2987  <varlistentry>
2988   <term>Type:</term>
2989   <!-- boolean, parameterized, Multi-value -->
2990   <listitem>
2991    <para>Parameterized.</para>
2992   </listitem>
2993  </varlistentry>
2994
2995  <varlistentry>
2996   <term>Parameter:</term>
2997   <listitem>
2998    <para>
2999     The name of a client-header tagger, as defined in one of the
3000     <link linkend="filter-file">filter files</link>.
3001    </para>
3002   </listitem>
3003  </varlistentry>
3004  
3005  <varlistentry>
3006   <term>Notes:</term>
3007   <listitem>
3008    <para>
3009     Client-header taggers are applied to each header on its own,
3010     and as the header isn't modified, each tagger <quote>sees</quote>
3011     the original.
3012    </para>
3013    <para>
3014     Client-header taggers are the first actions that are executed
3015     and their tags can be used to control every other action.
3016    </para>
3017  </listitem>
3018  </varlistentry>
3019
3020  <varlistentry>
3021   <term>Example usage (section):</term>
3022   <listitem>
3023     <para>
3024      <screen>
3025 # Tag every request with the User-Agent header
3026 {+client-header-filter{user-agent}}
3027 /
3028     </screen>
3029     </para>
3030   </listitem>
3031  </varlistentry>
3032
3033 </variablelist>
3034 </sect3>
3035
3036
3037 <!--   ~~~~~       New section      ~~~~~     -->
3038 <sect3 renderas="sect4" id="content-type-overwrite">
3039 <title>content-type-overwrite</title>
3040
3041 <variablelist>
3042  <varlistentry>
3043   <term>Typical use:</term>
3044   <listitem>
3045    <para>Stop useless download menus from popping up, or change the browser's rendering mode</para>
3046   </listitem>
3047  </varlistentry>
3048
3049  <varlistentry>
3050   <term>Effect:</term>
3051   <listitem>
3052    <para>
3053     Replaces the <quote>Content-Type:</quote> HTTP server header.
3054    </para>
3055   </listitem>
3056  </varlistentry>
3057
3058  <varlistentry>
3059   <term>Type:</term>
3060   <!-- Boolean, Parameterized, Multi-value -->
3061   <listitem>
3062    <para>Parameterized.</para>
3063   </listitem>
3064  </varlistentry>
3065
3066  <varlistentry>
3067   <term>Parameter:</term>
3068   <listitem>
3069    <para>
3070     Any string. 
3071    </para>    
3072   </listitem>
3073  </varlistentry>
3074  
3075  <varlistentry>
3076   <term>Notes:</term>
3077   <listitem>
3078    <para>
3079     The <quote>Content-Type:</quote> HTTP server header is used by the
3080     browser to decide what to do with the document. The value of this
3081     header can cause the browser to open a download menu instead of
3082     displaying the document by itself, even if the document's format is
3083     supported by the browser. 
3084    </para>
3085    <para>
3086     The declared content type can also affect which rendering mode
3087     the browser chooses. If XHTML is delivered as <quote>text/html</quote>,
3088     many browsers treat it as yet another broken HTML document.
3089     If it is send as <quote>application/xml</quote>, browsers with
3090     XHTML support will only display it, if the syntax is correct.
3091    </para>
3092    <para>
3093     If you see a web site that proudly uses XHTML buttons, but sets
3094     <quote>Content-Type: text/html</quote>, you can use &my-app;
3095     to overwrite it with <quote>application/xml</quote> and validate
3096     the web master's claim inside your XHTML-supporting browser.
3097     If the syntax is incorrect, the browser will complain loudly. 
3098    </para>
3099    <para>
3100     You can also go the opposite direction: if your browser prints
3101     error messages instead of rendering a document falsely declared
3102     as XHTML, you can overwrite the content type with
3103     <quote>text/html</quote> and have it rendered as broken HTML document. 
3104    </para>
3105    <para>
3106     By default <literal>content-type-overwrite</literal> only replaces
3107     <quote>Content-Type:</quote> headers that look like some kind of text.
3108     If you want to overwrite it unconditionally, you have to combine it with
3109     <literal><link linkend="force-text-mode">force-text-mode</link></literal>.
3110     This limitation exists for a reason, think twice before circumventing it.
3111    </para>
3112    <para>
3113     Most of the time it's easier to replace this action with a custom
3114     <literal><link linkend="server-header-filter">server-header filter</link></literal>.
3115     It allows you to activate it for every document of a certain site and it will still
3116     only replace the content types you aimed at.
3117    </para>
3118    <para>
3119     Of course you can apply <literal>content-type-overwrite</literal>
3120     to a whole site and then make URL based exceptions, but it's a lot
3121     more work to get the same precision. 
3122    </para>
3123   </listitem>
3124  </varlistentry>
3125
3126  <varlistentry>
3127   <term>Example usage (sections):</term>
3128   <listitem>
3129     <para>
3130      <screen># Check if www.example.net/ really uses valid XHTML
3131 { +content-type-overwrite{application/xml} }
3132 www.example.net/
3133
3134 # but leave the content type unmodified if the URL looks like a style sheet
3135 {-content-type-overwrite}
3136 www.example.net/.*\.css$
3137 www.example.net/.*style
3138 </screen>
3139    </para>
3140   </listitem>
3141  </varlistentry>
3142 </variablelist>
3143 </sect3>
3144
3145
3146 <!--   ~~~~~       New section      ~~~~~     -->
3147 <sect3 renderas="sect4" id="crunch-client-header">
3148 <!--
3149 new action
3150 -->
3151 <title>crunch-client-header</title>
3152
3153 <variablelist>
3154  <varlistentry>
3155   <term>Typical use:</term>
3156   <listitem>
3157    <para>Remove a client header <application>Privoxy</application> has no dedicated action for.</para>
3158   </listitem>
3159  </varlistentry>
3160
3161  <varlistentry>
3162   <term>Effect:</term>
3163   <listitem>
3164    <para>
3165     Deletes every header sent by the client that contains the string the user supplied as parameter.
3166    </para>
3167   </listitem>
3168  </varlistentry>
3169
3170  <varlistentry>
3171   <term>Type:</term>
3172   <!-- Boolean, Parameterized, Multi-value -->
3173   <listitem>
3174    <para>Parameterized.</para>
3175   </listitem>
3176  </varlistentry>
3177
3178  <varlistentry>
3179   <term>Parameter:</term>
3180   <listitem>
3181    <para>
3182     Any string.
3183    </para>    
3184   </listitem>
3185  </varlistentry>
3186  
3187  <varlistentry>
3188   <term>Notes:</term>
3189   <listitem>
3190    <para>
3191     This action allows you to block client headers for which no dedicated
3192     <application>Privoxy</application> action exists.
3193     <application>Privoxy</application> will remove every client header that
3194     contains the string you supplied as parameter.
3195    </para>
3196    <para>
3197     Regular expressions are <emphasis>not supported</emphasis> and you can't
3198     use this action to block different headers in the same request, unless
3199     they contain the same string.
3200    </para>
3201    <para>
3202     <literal>crunch-client-header</literal> is only meant for quick tests.
3203     If you have to block several different headers, or only want to modify
3204     parts of them, you should use a
3205     <literal><link linkend="client-header-filter">client-header filter</link></literal>.
3206    </para>
3207     <warning>
3208      <para>
3209       Don't block any header without understanding the consequences.
3210      </para>
3211     </warning>
3212   </listitem>
3213  </varlistentry>
3214
3215  <varlistentry>
3216   <term>Example usage (section):</term>
3217   <listitem>
3218     <para>
3219      <screen># Block the non-existent "Privacy-Violation:" client header 
3220 { +crunch-client-header{Privacy-Violation:} }
3221 /
3222     </screen>
3223    </para>
3224   </listitem>
3225  </varlistentry>
3226 </variablelist>
3227 </sect3>
3228
3229
3230 <!--   ~~~~~       New section      ~~~~~     -->
3231 <sect3 renderas="sect4" id="crunch-if-none-match">
3232 <title>crunch-if-none-match</title>
3233 <!--
3234 new action
3235 -->
3236 <variablelist>
3237  <varlistentry>
3238   <term>Typical use:</term>
3239   <listitem>
3240    <para>Prevent yet another way to track the user's steps between sessions.</para>
3241   </listitem>
3242  </varlistentry>
3243
3244  <varlistentry>
3245   <term>Effect:</term>
3246   <listitem>
3247    <para>
3248     Deletes the <quote>If-None-Match:</quote> HTTP client header.
3249    </para>
3250   </listitem>
3251  </varlistentry>
3252
3253  <varlistentry>
3254   <term>Type:</term>
3255   <!-- Boolean, Parameterized, Multi-value -->
3256   <listitem>
3257    <para>Boolean.</para>
3258   </listitem>
3259  </varlistentry>
3260
3261  <varlistentry>
3262   <term>Parameter:</term>
3263   <listitem>
3264    <para>
3265     N/A
3266    </para>    
3267   </listitem>
3268  </varlistentry>
3269  
3270  <varlistentry>
3271   <term>Notes:</term>
3272   <listitem>
3273    <para>
3274     Removing the <quote>If-None-Match:</quote> HTTP client header
3275     is useful for filter testing, where you want to force a real
3276     reload instead of getting status code <quote>304</quote> which
3277     would cause the browser to use a cached copy of the page.
3278    </para>
3279    <para>
3280     It is also useful to make sure the header isn't used as a cookie
3281     replacement (unlikely but possible).
3282    </para>
3283    <para>
3284     Blocking the <quote>If-None-Match:</quote> header shouldn't cause any
3285     caching problems, as long as the <quote>If-Modified-Since:</quote> header
3286     isn't blocked or missing as well.
3287    </para>
3288    <para>
3289     It is recommended to use this action together with
3290     <literal><link linkend="hide-if-modified-since">hide-if-modified-since</link></literal>
3291     and
3292     <literal><link linkend="overwrite-last-modified">overwrite-last-modified</link></literal>.
3293    </para>
3294   </listitem>
3295  </varlistentry>
3296
3297  <varlistentry>
3298   <term>Example usage (section):</term>
3299   <listitem>
3300     <para>
3301      <screen># Let the browser revalidate cached documents but don't
3302 # allow the server to use the revalidation headers for user tracking.
3303 {+hide-if-modified-since{-60} \
3304  +overwrite-last-modified{randomize} \
3305  +crunch-if-none-match}
3306 /   </screen>
3307    </para>
3308   </listitem>
3309  </varlistentry>
3310 </variablelist>
3311 </sect3>
3312
3313
3314 <!--   ~~~~~       New section      ~~~~~     -->
3315 <sect3 renderas="sect4" id="crunch-incoming-cookies">
3316 <title>crunch-incoming-cookies</title>
3317
3318 <variablelist>
3319  <varlistentry>
3320   <term>Typical use:</term>
3321   <listitem>
3322    <para>
3323     Prevent the web server from setting HTTP cookies on your system
3324    </para>
3325   </listitem>
3326  </varlistentry>
3327
3328  <varlistentry>
3329   <term>Effect:</term>
3330   <listitem>
3331    <para>
3332     Deletes any <quote>Set-Cookie:</quote> HTTP headers from server replies.
3333    </para>
3334   </listitem>
3335  </varlistentry>
3336
3337  <varlistentry>
3338   <term>Type:</term>
3339   <!-- Boolean, Parameterized, Multi-value -->
3340   <listitem>
3341    <para>Boolean.</para>
3342   </listitem>
3343  </varlistentry>
3344
3345  <varlistentry>
3346   <term>Parameter:</term>
3347   <listitem>
3348    <para>
3349     N/A
3350    </para>
3351   </listitem>
3352  </varlistentry>
3353  
3354  <varlistentry>
3355   <term>Notes:</term>
3356   <listitem>
3357    <para>
3358     This action is only concerned with <emphasis>incoming</emphasis> HTTP cookies. For
3359     <emphasis>outgoing</emphasis> HTTP cookies, use
3360     <literal><link linkend="crunch-outgoing-cookies">crunch-outgoing-cookies</link></literal>.
3361     Use <emphasis>both</emphasis> to disable HTTP cookies completely.
3362    </para>
3363    <para>
3364     It makes <emphasis>no sense at all</emphasis> to use this action in conjunction
3365     with the <literal><link linkend="session-cookies-only">session-cookies-only</link></literal> action,
3366     since it would prevent the session cookies from being set. See also 
3367     <literal><link linkend="filter-content-cookies">filter-content-cookies</link></literal>.
3368    </para>
3369   </listitem>
3370  </varlistentry>
3371
3372  <varlistentry>
3373   <term>Example usage:</term>
3374   <listitem>
3375    <para>
3376     <screen>+crunch-incoming-cookies</screen>
3377    </para>
3378   </listitem>
3379  </varlistentry>
3380 </variablelist>
3381 </sect3>
3382
3383
3384 <!--   ~~~~~       New section      ~~~~~     -->
3385 <sect3 renderas="sect4" id="crunch-server-header">
3386 <title>crunch-server-header</title>
3387 <!--
3388 new action
3389 -->
3390 <variablelist>
3391  <varlistentry>
3392   <term>Typical use:</term>
3393   <listitem>
3394    <para>Remove a server header <application>Privoxy</application> has no dedicated action for.</para>
3395   </listitem>
3396  </varlistentry>
3397
3398  <varlistentry>
3399   <term>Effect:</term>
3400   <listitem>
3401    <para>
3402     Deletes every header sent by the server that contains the string the user supplied as parameter.
3403    </para>
3404   </listitem>
3405  </varlistentry>
3406
3407  <varlistentry>
3408   <term>Type:</term>
3409   <!-- Boolean, Parameterized, Multi-value -->
3410   <listitem>
3411    <para>Parameterized.</para>
3412   </listitem>
3413  </varlistentry>
3414
3415  <varlistentry>
3416   <term>Parameter:</term>
3417   <listitem>
3418    <para>
3419     Any string.
3420    </para>    
3421   </listitem>
3422  </varlistentry>
3423  
3424  <varlistentry>
3425   <term>Notes:</term>
3426   <listitem>
3427    <para>
3428     This action allows you to block server headers for which no dedicated
3429     <application>Privoxy</application> action exists. <application>Privoxy</application>
3430     will remove every server header that contains the string you supplied as parameter.
3431    </para>
3432    <para>
3433     Regular expressions are <emphasis>not supported</emphasis> and you can't
3434     use this action to block different headers in the same request, unless
3435     they contain the same string.
3436    </para>
3437    <para>
3438     <literal>crunch-server-header</literal> is only meant for quick tests.
3439     If you have to block several different headers, or only want to modify
3440     parts of them, you should use a custom
3441     <literal><link linkend="server-header-filter">server-header filter</link></literal>.
3442    </para>
3443     <warning>
3444      <para>
3445      Don't block any header without understanding the consequences.
3446      </para>
3447     </warning>
3448   </listitem>
3449  </varlistentry>
3450
3451  <varlistentry>
3452   <term>Example usage (section):</term>
3453   <listitem>
3454     <para>
3455      <screen># Crunch server headers that try to prevent caching
3456 { +crunch-server-header{no-cache} }
3457 /   </screen>
3458    </para>
3459   </listitem>
3460  </varlistentry>
3461 </variablelist>
3462 </sect3>
3463
3464
3465 <!--   ~~~~~       New section      ~~~~~     -->
3466 <sect3 renderas="sect4" id="crunch-outgoing-cookies">
3467 <title>crunch-outgoing-cookies</title>
3468
3469 <variablelist>
3470  <varlistentry>
3471   <term>Typical use:</term>
3472   <listitem>
3473    <para>
3474     Prevent the web server from reading any HTTP cookies from your system
3475    </para>
3476   </listitem>
3477  </varlistentry>
3478
3479  <varlistentry>
3480   <term>Effect:</term>
3481   <listitem>
3482    <para>
3483     Deletes any <quote>Cookie:</quote> HTTP headers from client requests.
3484    </para>
3485   </listitem>
3486  </varlistentry>
3487
3488  <varlistentry>
3489   <term>Type:</term>
3490   <!-- Boolean, Parameterized, Multi-value -->
3491   <listitem>
3492    <para>Boolean.</para>
3493   </listitem>
3494  </varlistentry>
3495
3496  <varlistentry>
3497   <term>Parameter:</term>
3498   <listitem>
3499    <para>
3500     N/A
3501    </para>
3502   </listitem>
3503  </varlistentry>
3504  
3505  <varlistentry>
3506   <term>Notes:</term>
3507   <listitem>
3508    <para>
3509     This action is only concerned with <emphasis>outgoing</emphasis> HTTP cookies. For
3510     <emphasis>incoming</emphasis> HTTP cookies, use
3511     <literal><link linkend="crunch-incoming-cookies">crunch-incoming-cookies</link></literal>.
3512     Use <emphasis>both</emphasis> to disable HTTP cookies completely.
3513    </para>
3514    <para>
3515     It makes <emphasis>no sense at all</emphasis> to use this action in conjunction
3516     with the <literal><link linkend="session-cookies-only">session-cookies-only</link></literal> action,
3517     since it would prevent the session cookies from being read.
3518    </para>
3519   </listitem>
3520  </varlistentry>
3521
3522  <varlistentry>
3523   <term>Example usage:</term>
3524   <listitem>
3525    <para>
3526     <screen>+crunch-outgoing-cookies</screen>
3527    </para>
3528   </listitem>
3529  </varlistentry>
3530
3531 </variablelist>
3532 </sect3>
3533
3534
3535 <!--   ~~~~~       New section      ~~~~~     -->
3536 <sect3 renderas="sect4" id="deanimate-gifs">
3537 <title>deanimate-gifs</title>
3538
3539 <variablelist>
3540  <varlistentry>
3541   <term>Typical use:</term>
3542   <listitem>
3543    <para>Stop those annoying, distracting animated GIF images.</para>
3544   </listitem>
3545  </varlistentry>
3546
3547  <varlistentry>
3548   <term>Effect:</term>
3549   <listitem>
3550    <para>
3551     De-animate GIF animations, i.e. reduce them to their first or last image.
3552    </para>
3553   </listitem>
3554  </varlistentry>
3555
3556  <varlistentry>
3557   <term>Type:</term>
3558   <!-- boolean, parameterized, Multi-value -->
3559   <listitem>
3560    <para>Parameterized.</para>
3561   </listitem>
3562  </varlistentry>
3563
3564  <varlistentry>
3565   <term>Parameter:</term>
3566   <listitem>
3567    <para>
3568     <quote>last</quote> or <quote>first</quote>
3569    </para>
3570   </listitem>
3571  </varlistentry>
3572  
3573  <varlistentry>
3574   <term>Notes:</term>
3575   <listitem>
3576    <para>
3577     This will also shrink the images considerably (in bytes, not pixels!). If
3578     the option <quote>first</quote> is given, the first frame of the animation
3579     is used as the replacement. If <quote>last</quote> is given, the last
3580     frame of the animation is used instead, which probably makes more sense for
3581     most banner animations, but also has the risk of not showing the entire
3582     last frame (if it is only a delta to an earlier frame).
3583    </para>
3584    <para>
3585     You can safely use this action with patterns that will also match non-GIF
3586     objects, because no attempt will be made at anything that doesn't look like
3587     a GIF.
3588    </para>
3589   </listitem>
3590  </varlistentry>
3591
3592  <varlistentry>
3593   <term>Example usage:</term>
3594   <listitem>
3595     <para>
3596       <screen>+deanimate-gifs{last}</screen>
3597     </para>
3598   </listitem>
3599  </varlistentry>
3600 </variablelist>
3601 </sect3>
3602
3603 <!--   ~~~~~       New section      ~~~~~     -->
3604 <sect3 renderas="sect4" id="downgrade-http-version">
3605 <title>downgrade-http-version</title>
3606
3607 <variablelist>
3608  <varlistentry>
3609   <term>Typical use:</term>
3610   <listitem>
3611    <para>Work around (very rare) problems with HTTP/1.1</para>
3612   </listitem>
3613  </varlistentry>
3614
3615  <varlistentry>
3616   <term>Effect:</term>
3617   <listitem>
3618    <para>
3619     Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3620    </para>
3621   </listitem>
3622  </varlistentry>
3623
3624  <varlistentry>
3625   <term>Type:</term>
3626   <!-- boolean, parameterized, Multi-value -->
3627   <listitem>
3628    <para>Boolean.</para>
3629   </listitem>
3630  </varlistentry>
3631
3632  <varlistentry>
3633   <term>Parameter:</term>
3634   <listitem>
3635    <para>
3636     N/A
3637    </para>
3638   </listitem>
3639  </varlistentry>
3640  
3641 <varlistentry>
3642   <term>Notes:</term>
3643   <listitem>
3644    <para>
3645     This is a left-over from the time when <application>Privoxy</application>
3646     didn't support important HTTP/1.1 features well. It is left here for the
3647     unlikely case that you experience HTTP/1.1 related problems with some server
3648     out there. Not all HTTP/1.1 features and requirements are supported yet,
3649     so there is a chance you might need this action.
3650    </para>
3651   </listitem>
3652  </varlistentry>
3653
3654  <varlistentry>
3655   <term>Example usage (section):</term>
3656   <listitem>
3657     <para>
3658      <screen>{+downgrade-http-version}
3659 problem-host.example.com</screen>
3660     </para>
3661   </listitem>
3662  </varlistentry>
3663
3664 </variablelist>
3665 </sect3>
3666
3667 <!--   ~~~~~       New section      ~~~~~     -->
3668 <sect3 renderas="sect4" id="fast-redirects">
3669 <title>fast-redirects</title>
3670
3671 <variablelist>
3672  <varlistentry>
3673   <term>Typical use:</term>
3674   <listitem>
3675    <para>Fool some click-tracking scripts and speed up indirect links.</para>
3676   </listitem>
3677  </varlistentry>
3678
3679  <varlistentry>
3680   <term>Effect:</term>
3681   <listitem>
3682    <para>
3683     Detects redirection URLs and redirects the browser without contacting
3684     the redirection server first.
3685    </para>
3686   </listitem>
3687  </varlistentry>
3688
3689  <varlistentry>
3690   <term>Type:</term>
3691   <!-- boolean, parameterized, Multi-value -->
3692   <listitem>
3693    <para>Parameterized.</para>
3694   </listitem>
3695  </varlistentry>
3696
3697  <varlistentry>
3698   <term>Parameter:</term>
3699   <listitem>
3700    <itemizedlist>
3701     <listitem>
3702      <para>
3703       <quote>simple-check</quote> to just search for the string <quote>http://</quote>
3704       to detect redirection URLs.
3705      </para>
3706     </listitem>
3707     <listitem>
3708      <para>
3709       <quote>check-decoded-url</quote> to decode URLs (if necessary) before searching
3710       for redirection URLs.
3711      </para>
3712     </listitem>
3713    </itemizedlist>
3714   </listitem>
3715  </varlistentry>
3716
3717  <varlistentry>
3718   <term>Notes:</term>
3719   <listitem>
3720    <para>  
3721     Many sites, like yahoo.com, don't just link to other sites. Instead, they
3722     will link to some script on their own servers, giving the destination as a
3723     parameter, which will then redirect you to the final target. URLs
3724     resulting from this scheme typically look like:
3725     <quote>http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/</quote>.
3726   </para>
3727    <para>
3728     Sometimes, there are even multiple consecutive redirects encoded in the
3729     URL. These redirections via scripts make your web browsing more traceable,
3730     since the server from which you follow such a link can see where you go
3731     to. Apart from that, valuable bandwidth and time is wasted, while your
3732     browser asks the server for one redirect after the other. Plus, it feeds
3733     the advertisers.
3734    </para>
3735    <para>
3736     This feature is currently not very smart and is scheduled for improvement.
3737     If it is enabled by default, you will have to create some exceptions to
3738     this action. It can lead to failures in several ways: 
3739    </para>
3740    <para>
3741     Not every URLs with other URLs as parameters is evil.
3742     Some sites offer a real service that requires this information to work.
3743     For example a validation service needs to know, which document to validate.
3744     <literal>fast-redirects</literal> assumes that every URL parameter that
3745     looks like another URL is a redirection target, and will always redirect to
3746     the last one. Most of the time the assumption is correct, but if it isn't,
3747     the user gets redirected anyway.
3748    </para>
3749    <para>
3750     Another failure occurs if the URL contains other parameters after the URL parameter.
3751     The URL:
3752     <quote>http://www.example.org/?redirect=http%3a//www.example.net/&amp;foo=bar</quote>.
3753     contains the redirection URL <quote>http://www.example.net/</quote>,
3754     followed by another parameter. <literal>fast-redirects</literal> doesn't know that
3755     and will cause a redirect to <quote>http://www.example.net/&amp;foo=bar</quote>.
3756     Depending on the target server configuration, the parameter will be silently ignored
3757     or lead to a <quote>page not found</quote> error. You can prevent this problem by
3758     first using the <literal><link linkend="redirect">redirect</link></literal> action
3759     to remove the last part of the URL, but it requires a little effort.
3760    </para>
3761    <para>
3762     To detect a redirection URL, <literal>fast-redirects</literal> only
3763     looks for the string <quote>http://</quote>, either in plain text
3764     (invalid but often used) or encoded as <quote>http%3a//</quote>.
3765     Some sites use their own URL encoding scheme, encrypt the address
3766     of the target server or replace it with a database id. In theses cases
3767     <literal>fast-redirects</literal> is fooled and the request reaches the
3768     redirection server where it probably gets logged.
3769    </para>
3770   </listitem>
3771  </varlistentry>
3772
3773  <varlistentry>
3774   <term>Example usage:</term>
3775   <listitem>
3776     <para>
3777      <screen>
3778  { +fast-redirects{simple-check} }
3779    one.example.com 
3780
3781  { +fast-redirects{check-decoded-url} }
3782    another.example.com/testing</screen>
3783     </para>
3784   </listitem>
3785  </varlistentry>
3786
3787 </variablelist>
3788 </sect3>
3789
3790
3791 <!--   ~~~~~       New section      ~~~~~     -->
3792 <sect3 renderas="sect4" id="filter">
3793 <title>filter</title>
3794
3795 <variablelist>
3796  <varlistentry>
3797   <term>Typical use:</term>
3798   <listitem>
3799    <para>Get rid of HTML and JavaScript annoyances, banner advertisements (by size), 
3800          do fun text replacements, add personalized effects, etc.</para>
3801   </listitem>
3802  </varlistentry>
3803
3804  <varlistentry>
3805   <term>Effect:</term>
3806   <listitem>
3807    <para>
3808     All instances of text-based type, most notably HTML and JavaScript, to which
3809     this action applies, can be filtered on-the-fly through the specified regular
3810     expression based substitutions. (Note: as of version 3.0.3 plain text documents
3811     are exempted from filtering, because web servers often use the
3812    <literal>text/plain</literal> MIME type for all files whose type they don't know.)
3813    </para>
3814   </listitem>
3815  </varlistentry>
3816
3817  <varlistentry>
3818   <term>Type:</term>
3819   <!-- boolean, parameterized, Multi-value -->
3820   <listitem>
3821    <para>Parameterized.</para>
3822   </listitem>
3823  </varlistentry>
3824  
3825  <varlistentry>
3826   <term>Parameter:</term>
3827   <listitem>
3828    <para>
3829     The name of a content filter, as defined in the <link linkend="filter-file">filter file</link>.
3830     Filters can be defined in one or more  files as defined by the 
3831     <literal><link linkend="filterfile">filterfile</link></literal>
3832     option in the <link linkend="config">config file</link>. 
3833     <filename>default.filter</filename> is the collection of filters 
3834     supplied by the developers. Locally defined filters should go 
3835     in their own file, such as <filename>user.filter</filename>.
3836    </para>
3837    <para>
3838      When used in its negative form,
3839      and without parameters, <emphasis>all</emphasis> filtering is completely disabled.
3840   </para>
3841   </listitem>
3842  </varlistentry>
3843  
3844  <varlistentry>
3845   <term>Notes:</term>
3846   <listitem>
3847    <para>
3848     For your convenience, there are a number of pre-defined filters available 
3849     in the distribution filter file that you can use. See the examples below for
3850     a list.
3851    </para>
3852    <para>
3853     Filtering requires buffering the page content, which may appear to
3854     slow down page rendering since nothing is displayed until all content has
3855     passed the filters. (It does not really take longer, but seems that way
3856     since the page is not incrementally displayed.) This effect will be more
3857     noticeable on slower connections.
3858    </para>
3859    <para>
3860    <quote>Rolling your own</quote>
3861     filters requires a knowledge of 
3862      <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
3863      Expressions</quote></ulink> and 
3864       <ulink url="http://en.wikipedia.org/wiki/Html"><quote>HTML</quote></ulink>.
3865     This is very powerful feature, and potentially very intrusive. 
3866     Filters should be used with caution, and where an equivalent
3867     <quote>action</quote> is not available.
3868    </para>
3869    <para>
3870     The amount of data that can be filtered is limited to the 
3871     <literal><link linkend="buffer-limit">buffer-limit</link></literal>
3872     option in the main <link linkend="config">config file</link>. The 
3873     default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
3874     data, and all pending data, is passed through unfiltered. 
3875    </para>
3876    <para>
3877     Inappropriate MIME types, such as zipped files, are not filtered at all.
3878     (Again, only text-based types except plain text). Encrypted SSL data
3879     (from HTTPS servers) cannot be filtered either, since this would violate
3880     the integrity of the secure transaction. In some situations it might
3881     be necessary to protect certain text, like source code, from filtering
3882     by defining appropriate <literal>-filter</literal> exceptions.
3883    </para>
3884    <para>
3885     Compressed content can't be filtered either, unless &my-app;
3886     is compiled with zlib support (requires at least &my-app; 3.0.7),
3887     in which case &my-app; will decompress the content before filtering
3888     it.
3889    </para>
3890    <para>
3891     If you use a &my-app; version without zlib support, but want filtering to work on
3892     as much documents as possible, even those that would normally be sent compressed,
3893     you must use the <literal><link linkend="prevent-compression">prevent-compression</link></literal>
3894     action in conjunction with <literal>filter</literal>.
3895    </para>
3896    <para>
3897     Content filtering can achieve some of the same effects as the 
3898     <literal><link linkend="block">block</link></literal>
3899     action, i.e. it can be used to block ads and banners. But the mechanism 
3900     works quite differently. One effective use, is to block ad banners 
3901     based on their size (see below), since many of these seem to be somewhat 
3902     standardized.
3903    </para>
3904    <para>
3905     <link linkend="contact">Feedback</link> with suggestions for new or
3906     improved filters is particularly welcome!
3907    </para>
3908    <para>
3909     The below list has only the names and a one-line description of each
3910     predefined filter. There are <link linkend="predefined-filters">more
3911     verbose explanations</link> of what these filters do in the <link
3912     linkend="filter-file">filter file chapter</link>.
3913    </para>
3914   </listitem>
3915  </varlistentry>
3916
3917  <varlistentry>
3918   <term>Example usage (with filters from the distribution <filename>default.filter</filename> file).
3919   See <link linkend="PREDEFINED-FILTERS">the Predefined Filters section</link> for 
3920   more explanation on each:</term>
3921   <listitem>
3922    <para>
3923     <anchor id="filter-js-annoyances">
3924     <screen>+filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse</screen>
3925    </para>
3926    <para>
3927     <anchor id="filter-js-events">
3928     <screen>+filter{js-events}           # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</screen>
3929    </para>
3930    <para>
3931     <anchor id="filter-html-annoyances">
3932     <screen>+filter{html-annoyances}     # Get rid of particularly annoying HTML abuse</screen>
3933    </para>
3934    <para>
3935     <anchor id="filter-content-cookies">
3936     <screen>+filter{content-cookies}     # Kill cookies that come in the HTML or JS content</screen>
3937    </para>
3938    <para>
3939     <anchor id="filter-refresh-tags">
3940     <screen>+filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups)</screen>
3941    </para>
3942    <para>
3943     <anchor id="filter-unsolicited-popups">
3944     <screen>+filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.</screen>
3945    </para>
3946    <para>
3947     <anchor id="filter-all-popups">
3948     <screen>+filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.</screen>
3949    </para>
3950    <para>
3951     <anchor id="filter-img-reorder">
3952     <screen>+filter{img-reorder}         # Reorder attributes in &lt;img&gt; tags to make the banners-by-* filters more effective</screen>
3953    </para>
3954    <para>
3955     <anchor id="filter-banners-by-size">
3956     <screen>+filter{banners-by-size}     # Kill banners by size</screen>
3957    </para>
3958    <para>
3959     <anchor id="filter-banners-by-link">
3960     <screen>+filter{banners-by-link}     # Kill banners by their links to known clicktrackers</screen>
3961    </para>
3962    <para>
3963     <anchor id="filter-webbugs">
3964     <screen>+filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking)</screen>
3965    </para>
3966    <para>
3967     <anchor id="filter-tiny-textforms">
3968     <screen>+filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap</screen>
3969    </para>
3970    <para>
3971     <anchor id="filter-jumping-windows">
3972     <screen>+filter{jumping-windows}     # Prevent windows from resizing and moving themselves</screen>
3973    </para>
3974    <para>
3975     <anchor id="filter-frameset-borders">
3976     <screen>+filter{frameset-borders}    # Give frames a border and make them resizeable</screen>
3977    </para>
3978    <para>
3979     <anchor id="filter-demoronizer">
3980     <screen>+filter{demoronizer}         # Fix MS's non-standard use of standard charsets</screen>
3981    </para>
3982    <para>
3983     <anchor id="filter-shockwave-flash">
3984     <screen>+filter{shockwave-flash}     # Kill embedded Shockwave Flash objects</screen>
3985    </para>
3986    <para>
3987     <anchor id="filter-quicktime-kioskmode">
3988     <screen>+filter{quicktime-kioskmode} # Make Quicktime movies savable</screen>
3989    </para>
3990    <para>
3991     <anchor id="filter-fun">
3992     <screen>+filter{fun}                 # Text replacements for subversive browsing fun!</screen>
3993    </para>
3994    <para>
3995     <anchor id="filter-crude-parental">
3996     <screen>+filter{crude-parental}      # Crude parental filtering (demo only)</screen>
3997    </para>
3998    <para>
3999     <anchor id="filter-ie-exploits">
4000     <screen>+filter{ie-exploits}         # Disable a known Internet Explorer bug exploits</screen>
4001    </para>
4002    <para>
4003     <anchor id="filter-site-specifics">
4004     <screen>+filter{site-specifics}      # Custom filters for specific site related problems</screen>
4005    </para>
4006    <para>
4007     <anchor id="filter-google">
4008     <screen>+filter{google}              # Removes text ads and other Google specific improvements</screen>
4009    </para>
4010    <para>
4011     <anchor id="filter-yahoo">
4012     <screen>+filter{yahoo}               # Removes text ads and other Yahoo specific improvements</screen>
4013    </para>
4014    <para>
4015     <anchor id="filter-msn">
4016     <screen>+filter{msn}                 # Removes text ads and other MSN specific improvements</screen>
4017    </para>
4018    <para>
4019     <anchor id="filter-blogspot">
4020     <screen>+filter{blogspot}            # Cleans up Blogspot blogs</screen>
4021    </para>
4022    <para>
4023     <anchor id="filter-no-ping">
4024     <screen>+filter{no-ping}             # Removes non-standard ping attributes from anchor and area tags</screen>
4025    </para>
4026   </listitem>
4027  </varlistentry>
4028 </variablelist>
4029 </sect3>
4030
4031
4032 <!--   ~~~~~       New section      ~~~~~     -->
4033 <sect3 renderas="sect4" id="force-text-mode">
4034 <title>force-text-mode</title>
4035 <!--
4036 new action
4037 -->
4038 <variablelist>
4039  <varlistentry>
4040   <term>Typical use:</term>
4041   <listitem>
4042    <para>Force <application>Privoxy</application> to treat a document as if it was in some kind of <emphasis>text</emphasis> format.   </para>
4043   </listitem>
4044  </varlistentry>
4045
4046  <varlistentry>
4047   <term>Effect:</term>
4048   <listitem>
4049    <para>
4050     Declares a document as text, even if the <quote>Content-Type:</quote> isn't detected as such.
4051    </para>    
4052   </listitem>
4053  </varlistentry>
4054
4055  <varlistentry>
4056   <term>Type:</term>
4057   <!-- Boolean, Parameterized, Multi-value -->
4058   <listitem>
4059    <para>Boolean.</para>
4060   </listitem>
4061  </varlistentry>
4062
4063  <varlistentry>
4064   <term>Parameter:</term>
4065   <listitem>
4066    <para>
4067     N/A
4068    </para>
4069   </listitem>
4070  </varlistentry>
4071
4072  <varlistentry>
4073   <term>Notes:</term>
4074   <listitem>
4075    <para>
4076     As explained <literal><link linkend="filter">above</link></literal>,
4077     <application>Privoxy</application> tries to only filter files that are
4078     in some kind of text format. The same restrictions apply to
4079     <literal><link linkend="content-type-overwrite">content-type-overwrite</link></literal>.
4080     <literal>force-text-mode</literal> declares a document as text,
4081     without looking at the <quote>Content-Type:</quote> first.
4082    </para>
4083    <warning> 
4084     <para>
4085      Think twice before activating this action. Filtering binary data
4086      with regular expressions can cause file damage.
4087     </para>
4088    </warning>
4089   </listitem>
4090  </varlistentry>
4091  
4092  <varlistentry>
4093   <term>Example usage:</term>
4094   <listitem>
4095    <para>
4096      <screen>
4097 +force-text-mode
4098      </screen>
4099    </para>
4100   </listitem>
4101  </varlistentry>
4102 </variablelist>
4103 </sect3>
4104
4105
4106 <!--   ~~~~~       New section      ~~~~~     -->
4107 <sect3 renderas="sect4" id="forward-override">
4108 <title>forward-override</title>
4109 <!--
4110 new action
4111 -->
4112 <variablelist>
4113  <varlistentry>
4114   <term>Typical use:</term>
4115   <listitem>
4116    <para>Change the forwarding settings based on User-Agent or request origin</para>
4117   </listitem>
4118  </varlistentry>
4119
4120  <varlistentry>
4121   <term>Effect:</term>
4122   <listitem>
4123    <para>
4124     Overrules the forward directives in the configuration file.
4125    </para>    
4126   </listitem>
4127  </varlistentry>
4128
4129  <varlistentry>
4130   <term>Type:</term>
4131   <!-- Boolean, Parameterized, Multi-value -->
4132   <listitem>
4133    <para>Multi-value.</para>
4134   </listitem>
4135  </varlistentry>
4136
4137  <varlistentry>
4138   <term>Parameter:</term>
4139   <listitem>
4140    <itemizedlist>
4141     <listitem>
4142      <para><quote>forward .</quote> to use a direct connection without any additional proxies.</para>
4143     </listitem>
4144     <listitem>
4145      <para>
4146       <quote>forward 127.0.0.1:8123</quote> to use the HTTP proxy listening at 127.0.0.1 port 8123.
4147      </para>
4148     </listitem>
4149     <listitem>
4150      <para>
4151       <quote>forward-socks4a 127.0.0.1:9050 .</quote> to use the socks4a proxy listening at
4152       127.0.0.1 port 9050. Replace <quote>forward-socks4a</quote> with <quote>forward-socks4</quote>
4153       to use a socks4 connection  (with local DNS resolution) instead.
4154      </para>
4155     </listitem>
4156     <listitem>
4157      <para>
4158       <quote>forward-socks4a 127.0.0.1:9050 proxy.example.org:8000</quote> to use the socks4a proxy
4159       listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000.
4160       Replace <quote>forward-socks4a</quote> with <quote>forward-socks4</quote> to use a socks4 connection
4161       (with local DNS resolution) instead.
4162      </para>
4163     </listitem>
4164    </itemizedlist>
4165   </listitem>
4166  </varlistentry>
4167
4168  <varlistentry>
4169   <term>Notes:</term>
4170   <listitem>
4171    <para>
4172     This action takes parameters similar to the <!-- I hope this link actual works -->
4173     <link linkend="forwarding">forward</link> directives in the configuration
4174     file, but without the URL pattern. It can be used as replacement, but normally it's only
4175     used in cases where matching based on the request URL isn't sufficient.
4176    </para>
4177    <warning> 
4178     <para>
4179      Please read the description for the <link linkend="forwarding">forward</link> directives before
4180      using this action. Forwarding to the wrong people will reduce your privacy and increase the
4181      chances of man-in-the-middle attacks.
4182     </para>
4183     <para>
4184      If the ports are missing or invalid, default values will be used. This might change
4185      in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy
4186      to exit.
4187     </para>
4188     <para>
4189      Use the <ulink url="http://config.privoxy.org/show-url-info">show-url-info CGI page</ulink>
4190      to verify that your forward settings do what you thought the do.
4191     </para>
4192    </warning>
4193   </listitem>
4194  </varlistentry>
4195  
4196  <varlistentry>
4197   <term>Example usage:</term>
4198   <listitem>
4199    <para>
4200      <screen>
4201 # Always use direct connections for requests previously tagged as
4202 # <quote>User-Agent: fetch libfetch/2.0</quote> and make sure
4203 # resuming downloads continues to work.
4204 # This way you can continue to use Tor for your normal browsing,
4205 # without overloading the Tor network with your FreeBSD ports updates
4206 # or downloads of bigger files like ISOs.
4207 {+forward-override{forward .} \
4208  -hide-if-modified-since      \
4209  -overwrite-last-modified     \
4210 }
4211 TAG:^User-Agent: fetch libfetch/2\.0$
4212      </screen>
4213    </para>
4214   </listitem>
4215  </varlistentry>
4216 </variablelist>
4217 </sect3>
4218
4219
4220 <!--   ~~~~~       New section      ~~~~~     -->
4221 <sect3 renderas="sect4" id="handle-as-empty-document">
4222 <title>handle-as-empty-document</title>
4223 <!--
4224 new action
4225 -->
4226 <variablelist>
4227  <varlistentry>
4228   <term>Typical use:</term>
4229   <listitem>
4230    <para>Mark URLs that should be replaced by empty documents <emphasis>if they get blocked</emphasis></para>
4231   </listitem>
4232  </varlistentry>
4233
4234  <varlistentry>
4235   <term>Effect:</term>
4236   <listitem>
4237    <para>
4238     This action alone doesn't do anything noticeable. It just marks URLs.
4239     If the <literal><link linkend="block">block</link></literal> action <emphasis>also applies</emphasis>,
4240     the presence or absence of this mark decides whether an HTML <quote>BLOCKED</quote>
4241     page, or an empty document will be sent to the client as a substitute for the blocked content.
4242     The <emphasis>empty</emphasis> document isn't literally empty, but actually contains a single space.
4243    </para>
4244   </listitem>
4245  </varlistentry>
4246
4247  <varlistentry>
4248   <term>Type:</term>
4249   <!-- Boolean, Parameterized, Multi-value -->
4250   <listitem>
4251    <para>Boolean.</para>
4252   </listitem>
4253  </varlistentry>
4254
4255  <varlistentry>
4256   <term>Parameter:</term>
4257   <listitem>
4258    <para>
4259     N/A
4260    </para>
4261   </listitem>
4262  </varlistentry>
4263
4264  <varlistentry>
4265   <term>Notes:</term>
4266   <listitem>
4267    <para>
4268     Some browsers complain about syntax errors if JavaScript documents
4269     are blocked with <application>Privoxy's</application>
4270     default HTML page; this option can be used to silence them.
4271     And of course this action can also be used to eliminate the &my-app;
4272     BLOCKED message in frames.
4273    </para>
4274    <para>
4275     The content type for the empty document can be specified with
4276     <literal><link linkend="content-type-overwrite">content-type-overwrite{}</link></literal>,
4277     but usually this isn't necessary.
4278    </para>
4279   </listitem>
4280  </varlistentry>
4281
4282  <varlistentry>
4283   <term>Example usage:</term>
4284   <listitem>
4285    <para>
4286      <screen># Block all documents on example.org that end with ".js",
4287 # but send an empty document instead of the usual HTML message. 
4288 {+block +handle-as-empty-document}
4289 example.org/.*\.js$
4290      </screen>
4291    </para>
4292   </listitem>
4293  </varlistentry>
4294 </variablelist>
4295 </sect3>
4296
4297
4298 <!--   ~~~~~       New section      ~~~~~     -->
4299 <sect3 renderas="sect4" id="handle-as-image">
4300 <title>handle-as-image</title>
4301
4302 <variablelist>
4303  <varlistentry>
4304   <term>Typical use:</term>
4305   <listitem>
4306    <para>Mark URLs as belonging to images (so they'll be replaced by images <emphasis>if they do get blocked</emphasis>, rather than HTML pages)</para>
4307   </listitem>
4308  </varlistentry>
4309
4310  <varlistentry>
4311   <term>Effect:</term>
4312   <listitem>
4313    <para>
4314     This action alone doesn't do anything noticeable. It just marks URLs as images.
4315     If the <literal><link linkend="block">block</link></literal> action <emphasis>also applies</emphasis>,
4316     the presence or absence of this mark decides whether an HTML <quote>blocked</quote>
4317     page, or a replacement image (as determined by the <literal><link
4318     linkend="set-image-blocker">set-image-blocker</link></literal> action) will be sent to the
4319     client as a substitute for the blocked content.
4320    </para>
4321   </listitem>
4322  </varlistentry>
4323
4324  <varlistentry>
4325   <term>Type:</term>
4326   <!-- Boolean, Parameterized, Multi-value -->
4327   <listitem>
4328    <para>Boolean.</para>
4329   </listitem>
4330  </varlistentry>
4331
4332  <varlistentry>
4333   <term>Parameter:</term>
4334   <listitem>
4335    <para>
4336     N/A
4337    </para>
4338   </listitem>
4339  </varlistentry>
4340  
4341  <varlistentry>
4342   <term>Notes:</term>
4343   <listitem>
4344    <para>
4345     The below generic example section is actually part of <filename>default.action</filename>.
4346     It marks all URLs with well-known image file name extensions as images and should
4347     be left intact. 
4348    </para>
4349    <para>
4350     Users will probably only want to use the handle-as-image action in conjunction with
4351     <literal><link linkend="block">block</link></literal>, to block sources of banners, whose URLs don't
4352     reflect the file type, like in the second example section.
4353    </para>
4354    <para>
4355     Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
4356     frames require an HTML page to be sent, or they won't display properly.
4357     Forcing <literal>handle-as-image</literal> in this situation will not replace the
4358     ad frame with an image, but lead to error messages.
4359    </para>
4360   </listitem>
4361  </varlistentry>
4362
4363  <varlistentry>
4364   <term>Example usage (sections):</term>
4365   <listitem>
4366    <para>
4367      <screen># Generic image extensions:
4368 #
4369 {+handle-as-image}
4370 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4371
4372 # These don't look like images, but they're banners and should be
4373 # blocked as images:
4374 #
4375 {+block +handle-as-image}
4376 some.nasty-banner-server.com/junk.cgi\?output=trash
4377
4378 # Banner source! Who cares if they also have non-image content?
4379 ad.doubleclick.net 
4380 </screen>
4381    </para>
4382   </listitem>
4383  </varlistentry>
4384 </variablelist>
4385 </sect3>
4386
4387
4388 <!--   ~~~~~       New section      ~~~~~     -->
4389 <sect3 renderas="sect4" id="hide-accept-language">
4390 <title>hide-accept-language</title>
4391 <!--
4392 new action
4393 -->
4394 <variablelist>
4395  <varlistentry>
4396   <term>Typical use:</term>
4397   <listitem>
4398    <para>Pretend to use different language settings.</para>
4399   </listitem>
4400  </varlistentry>
4401
4402  <varlistentry>
4403   <term>Effect:</term>
4404   <listitem>
4405    <para>
4406     Deletes or replaces the <quote>Accept-Language:</quote> HTTP header in client requests.
4407    </para>
4408   </listitem>
4409  </varlistentry>
4410
4411  <varlistentry>
4412   <term>Type:</term>
4413   <!-- Boolean, Parameterized, Multi-value -->
4414   <listitem>
4415    <para>Parameterized.</para>
4416   </listitem>
4417  </varlistentry>
4418
4419  <varlistentry>
4420   <term>Parameter:</term>
4421   <listitem>
4422    <para>
4423     Keyword: <quote>block</quote>, or any user defined value.
4424    </para>    
4425   </listitem>
4426  </varlistentry>
4427  
4428  <varlistentry>
4429   <term>Notes:</term>
4430   <listitem>
4431    <para>
4432     Faking the browser's language settings can be useful to make a
4433     foreign User-Agent set with
4434     <literal><link linkend="hide-user-agent">hide-user-agent</link></literal>
4435     more believable.
4436    </para>
4437    <para>
4438     However some sites with content in different languages check the
4439     <quote>Accept-Language:</quote> to decide which one to take by default.
4440     Sometimes it isn't possible to later switch to another language without
4441     changing the <quote>Accept-Language:</quote> header first.
4442    </para>
4443    <para>
4444     Therefore it's a good idea to either only change the
4445     <quote>Accept-Language:</quote> header to languages you understand,
4446     or to languages that aren't wide spread.
4447    </para>
4448    <para>
4449     Before setting the <quote>Accept-Language:</quote> header
4450     to a rare language, you should consider that it helps to
4451     make your requests unique and thus easier to trace.
4452     If you don't plan to change this header frequently,
4453     you should stick to a common language. 
4454    </para>
4455   </listitem>
4456  </varlistentry>
4457
4458  <varlistentry>
4459   <term>Example usage (section):</term>
4460   <listitem>
4461     <para>
4462      <screen># Pretend to use Canadian language settings.
4463 {+hide-accept-language{en-ca} \
4464 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4465 }
4466 /   </screen>
4467    </para>
4468   </listitem>
4469  </varlistentry>
4470 </variablelist>
4471 </sect3>
4472
4473
4474 <!--   ~~~~~       New section      ~~~~~     -->
4475 <sect3 renderas="sect4" id="hide-content-disposition">
4476 <title>hide-content-disposition</title>
4477 <!--
4478 new action
4479 -->
4480 <variablelist>
4481  <varlistentry>
4482   <term>Typical use:</term>
4483   <listitem>
4484    <para>Prevent download menus for content you prefer to view inside the browser.</para>
4485   </listitem>
4486  </varlistentry>
4487
4488  <varlistentry>
4489   <term>Effect:</term>
4490   <listitem>
4491    <para>
4492     Deletes or replaces the <quote>Content-Disposition:</quote> HTTP header set by some servers.
4493    </para>
4494   </listitem>
4495  </varlistentry>
4496
4497  <varlistentry>
4498   <term>Type:</term>
4499   <!-- Boolean, Parameterized, Multi-value -->
4500   <listitem>
4501    <para>Parameterized.</para>
4502   </listitem>
4503  </varlistentry>
4504
4505  <varlistentry>
4506   <term>Parameter:</term>
4507   <listitem>
4508    <para>
4509     Keyword: <quote>block</quote>, or any user defined value.
4510    </para>    
4511   </listitem>
4512  </varlistentry>
4513  
4514  <varlistentry>
4515   <term>Notes:</term>
4516   <listitem>
4517    <para>
4518     Some servers set the <quote>Content-Disposition:</quote> HTTP header for
4519     documents they assume you want to save locally before viewing them.
4520     The <quote>Content-Disposition:</quote> header contains the file name
4521     the browser is supposed to use by default.
4522    </para>
4523    <para>
4524     In most browsers that understand this header, it makes it impossible to
4525     <emphasis>just view</emphasis> the document, without downloading it first,
4526     even if it's just a simple text file or an image.
4527    </para>
4528    <para>
4529     Removing the <quote>Content-Disposition:</quote> header helps
4530     to prevent this annoyance, but some browsers additionally check the
4531     <quote>Content-Type:</quote> header, before they decide if they can
4532     display a document without saving it first. In these cases, you have
4533     to change this header as well, before the browser stops displaying
4534     download menus.
4535    </para>
4536    <para>
4537     It is also possible to change the server's file name suggestion
4538     to another one, but in most cases it isn't worth the time to set
4539     it up.
4540    </para>
4541    <para>
4542     This action will probably be removed in the future,
4543     use server-header filters instead.
4544    </para>
4545   </listitem>
4546  </varlistentry>
4547
4548  <varlistentry>
4549   <term>Example usage:</term>
4550   <listitem>
4551     <para>
4552      <screen># Disarm the download link in Sourceforge's patch tracker
4553 { -filter \
4554  +content-type-overwrite{text/plain}\
4555  +hide-content-disposition{block} }
4556  .sourceforge.net/tracker/download\.php</screen>
4557    </para>
4558   </listitem>
4559  </varlistentry>
4560 </variablelist>
4561 </sect3>
4562
4563
4564 <!--   ~~~~~       New section      ~~~~~     -->
4565 <sect3 renderas="sect4" id="hide-if-modified-since">
4566 <title>hide-if-modified-since</title>
4567 <!--
4568 new action
4569 -->
4570 <variablelist>
4571  <varlistentry>
4572   <term>Typical use:</term>
4573   <listitem>
4574    <para>Prevent yet another way to track the user's steps between sessions.</para>
4575   </listitem>
4576  </varlistentry>
4577
4578  <varlistentry>
4579   <term>Effect:</term>
4580   <listitem>
4581    <para>
4582     Deletes the <quote>If-Modified-Since:</quote> HTTP client header or modifies its value. 
4583    </para>
4584   </listitem>
4585  </varlistentry>
4586
4587  <varlistentry>
4588   <term>Type:</term>
4589   <!-- Boolean, Parameterized, Multi-value -->
4590   <listitem>
4591    <para>Parameterized.</para>
4592   </listitem>
4593  </varlistentry>
4594
4595  <varlistentry>
4596   <term>Parameter:</term>
4597   <listitem>
4598    <para>
4599     Keyword: <quote>block</quote>, or a user defined value that specifies a range of hours.
4600    </para>    
4601   </listitem>
4602  </varlistentry>
4603  
4604  <varlistentry>
4605   <term>Notes:</term>
4606   <listitem>
4607    <para>
4608     Removing this header is useful for filter testing, where you want to force a real
4609     reload instead of getting status code <quote>304</quote>, which would cause the
4610     browser to use a cached copy of the page.
4611    </para>
4612    <para>
4613     Instead of removing the header, <literal>hide-if-modified-since</literal> can
4614     also add or subtract a random amount of time to/from the header's value.
4615     You specify a range of minutes where the random factor should be chosen from and
4616     <application>Privoxy</application> does the rest. A negative value means
4617     subtracting, a positive value adding.
4618    </para>
4619    <para>
4620     Randomizing the value of the <quote>If-Modified-Since:</quote> makes
4621     sure it isn't used as a cookie replacement, but you will run into
4622     caching problems if the random range is too high.  
4623    </para>
4624    <para>
4625     It is a good idea to only use a small negative value and let
4626     <literal><link linkend="overwrite-last-modified">overwrite-last-modified</link></literal>
4627     handle the greater changes.
4628    </para>
4629    <para>
4630     It is also recommended to use this action together with
4631     <literal><link linkend="crunch-if-none-match">crunch-if-none-match</link></literal>.
4632    </para>
4633   </listitem>
4634  </varlistentry>
4635
4636  <varlistentry>
4637   <term>Example usage (section):</term>
4638   <listitem>
4639     <para>
4640      <screen># Let the browser revalidate without being tracked across sessions
4641 { +hide-if-modified-since{-60} \
4642  +overwrite-last-modified{randomize} \
4643  +crunch-if-none-match}
4644 /</screen>
4645    </para>
4646   </listitem>
4647  </varlistentry>
4648 </variablelist>
4649 </sect3>
4650
4651
4652 <!--   ~~~~~       New section      ~~~~~     -->
4653 <sect3 renderas="sect4" id="hide-forwarded-for-headers">
4654 <title>hide-forwarded-for-headers</title>
4655 <variablelist>
4656  <varlistentry>
4657   <term>Typical use:</term>
4658   <listitem>
4659    <para>Improve privacy by not embedding the source of the request in the HTTP headers.</para>
4660   </listitem>
4661  </varlistentry>
4662
4663  <varlistentry>
4664   <term>Effect:</term>
4665   <listitem>
4666    <para>
4667     Deletes any existing <quote>X-Forwarded-for:</quote> HTTP header from client requests,
4668     and prevents adding a new one.
4669    </para>
4670   </listitem>
4671  </varlistentry>
4672
4673  <varlistentry>
4674   <term>Type:</term>
4675   <!-- Boolean, Parameterized, Multi-value -->
4676   <listitem>
4677    <para>Boolean.</para>
4678   </listitem>
4679  </varlistentry>
4680
4681  <varlistentry>
4682   <term>Parameter:</term>
4683   <listitem>
4684    <para>
4685     N/A
4686    </para>
4687   </listitem>
4688  </varlistentry>
4689  
4690  <varlistentry>
4691   <term>Notes:</term>
4692   <listitem>
4693    <para>
4694     It is safe to leave this on.
4695    </para>
4696   </listitem>
4697  </varlistentry>
4698
4699  <varlistentry>
4700   <term>Example usage:</term>
4701   <listitem>
4702     <para>
4703      <screen>+hide-forwarded-for-headers</screen>
4704    </para>
4705   </listitem>
4706  </varlistentry>
4707 </variablelist>
4708 </sect3>
4709
4710
4711 <!--   ~~~~~       New section      ~~~~~     -->
4712 <sect3 renderas="sect4" id="hide-from-header">
4713 <title>hide-from-header</title>
4714
4715 <variablelist>
4716  <varlistentry>
4717   <term>Typical use:</term>
4718   <listitem>
4719    <para>Keep your (old and ill) browser from telling web servers your email address</para>
4720   </listitem>
4721  </varlistentry>
4722
4723  <varlistentry>
4724   <term>Effect:</term>
4725   <listitem>
4726    <para>
4727     Deletes any existing <quote>From:</quote> HTTP header, or replaces it with the
4728     specified string.
4729    </para>
4730   </listitem>
4731  </varlistentry>
4732
4733  <varlistentry>
4734   <term>Type:</term>
4735   <!-- Boolean, Parameterized, Multi-value -->
4736   <listitem>
4737    <para>Parameterized.</para>
4738   </listitem>
4739  </varlistentry>
4740
4741  <varlistentry>
4742   <term>Parameter:</term>
4743   <listitem>
4744    <para>
4745     Keyword: <quote>block</quote>, or any user defined value.
4746    </para>
4747   </listitem>
4748  </varlistentry>
4749  
4750  <varlistentry>
4751   <term>Notes:</term>
4752   <listitem>
4753    <para>
4754     The keyword <quote>block</quote> will completely remove the header 
4755     (not to be confused with the <literal><link linkend="block">block</link></literal>
4756     action).
4757    </para>
4758    <para>
4759     Alternately, you can specify any value you prefer to be sent to the web
4760     server. If you do, it is a matter of fairness not to use any address that
4761     is actually used by a real person.
4762    </para>
4763    <para>
4764     This action is rarely needed, as modern web browsers don't send
4765     <quote>From:</quote> headers anymore.
4766    </para>
4767   </listitem>
4768  </varlistentry>
4769
4770  <varlistentry>
4771   <term>Example usage:</term>
4772   <listitem>
4773    <para>
4774     <screen>+hide-from-header{block}</screen> or
4775     <screen>+hide-from-header{spam-me-senseless@sittingduck.example.com}</screen>
4776    </para>
4777   </listitem>
4778  </varlistentry>
4779 </variablelist>
4780 </sect3>
4781
4782
4783 <!--   ~~~~~       New section      ~~~~~     -->
4784 <sect3 renderas="sect4" id="hide-referrer">
4785 <title>hide-referrer</title>
4786 <anchor id="hide-referer">
4787 <variablelist>
4788  <varlistentry>
4789   <term>Typical use:</term>
4790   <listitem>
4791    <para>Conceal which link you followed to get to a particular site</para>
4792   </listitem>
4793  </varlistentry>
4794
4795  <varlistentry>
4796   <term>Effect:</term>
4797   <listitem>
4798    <para>
4799     Deletes the <quote>Referer:</quote> (sic) HTTP header from the client request,
4800     or replaces it with a forged one.
4801    </para>
4802   </listitem>
4803  </varlistentry>
4804
4805  <varlistentry>
4806   <term>Type:</term>
4807   <!-- Boolean, Parameterized, Multi-value -->
4808   <listitem>
4809    <para>Parameterized.</para>
4810   </listitem>
4811  </varlistentry>
4812
4813  <varlistentry>
4814   <term>Parameter:</term>
4815   <listitem>
4816    <itemizedlist>
4817     <listitem>
4818      <para><quote>conditional-block</quote> to delete the header completely if the host has changed.</para>
4819     </listitem>
4820 <!--
4821     <listitem>
4822      <para><quote>conditional-forge</quote> to forge the header if the host has changed.</para>
4823     </listitem>
4824 -->
4825     <listitem>
4826      <para><quote>block</quote> to delete the header unconditionally.</para>
4827     </listitem>
4828     <listitem>
4829      <para><quote>forge</quote> to pretend to be coming from the homepage of the server we are talking to.</para>
4830     </listitem>
4831     <listitem>
4832      <para>Any other string to set a user defined referrer.</para>
4833     </listitem>
4834    </itemizedlist>
4835   </listitem>
4836  </varlistentry>
4837  
4838  <varlistentry>
4839   <term>Notes:</term>
4840   <listitem>
4841    <para>
4842     <literal>conditional-block</literal> is the only parameter,
4843     that isn't easily detected in the server's log file. If it blocks the
4844     referrer, the request will look like the visitor used a bookmark or
4845     typed in the address directly.
4846    </para>
4847    <para>
4848     Leaving the referrer unmodified for requests on the same host
4849     allows the server owner to see the visitor's <quote>click path</quote>,
4850     but in most cases she could also get that information by comparing
4851     other parts of the log file: for example the User-Agent if it isn't
4852     a very common one, or the user's IP address if it doesn't change between
4853     different requests.
4854    </para>
4855    <para>
4856     Always blocking the referrer, or using a custom one, can lead to
4857     failures on servers that check the referrer before they answer any
4858     requests, in an attempt to prevent their valuable content from being
4859     embedded or linked to elsewhere.
4860    </para>
4861    <para>
4862     Both <literal>conditional-block</literal> and <literal>forge</literal>
4863     will work with referrer checks, as long as content and valid referring page
4864     are on the same host. Most of the time that's the case.
4865    </para>
4866    <para>  
4867     <literal>hide-referer</literal> is an alternate spelling of
4868     <literal>hide-referrer</literal> and the two can be can be freely
4869     substituted with each other. (<quote>referrer</quote> is the
4870     correct English spelling, however the HTTP specification has a bug - it
4871     requires it to be spelled as <quote>referer</quote>.) 
4872    </para>
4873   </listitem>
4874  </varlistentry>
4875
4876  <varlistentry>
4877   <term>Example usage:</term>
4878   <listitem>
4879    <para>
4880      <screen>+hide-referrer{forge}</screen> or
4881      <screen>+hide-referrer{http://www.yahoo.com/}</screen>
4882    </para>
4883   </listitem>
4884  </varlistentry>
4885 </variablelist>
4886 </sect3>
4887
4888
4889 <!--   ~~~~~       New section      ~~~~~     -->
4890 <sect3 renderas="sect4" id="hide-user-agent">
4891 <title>hide-user-agent</title>
4892
4893 <variablelist>
4894  <varlistentry>
4895   <term>Typical use:</term>
4896   <listitem>
4897    <para>Conceal your type of browser and client operating system</para>
4898   </listitem>
4899  </varlistentry>
4900
4901  <varlistentry>
4902   <term>Effect:</term>
4903   <listitem>
4904    <para>
4905     Replaces the value of the <quote>User-Agent:</quote> HTTP header
4906     in client requests with the specified value.
4907    </para>
4908   </listitem>
4909  </varlistentry>
4910
4911  <varlistentry>
4912   <term>Type:</term>
4913   <!-- Boolean, Parameterized, Multi-value -->
4914   <listitem>
4915    <para>Parameterized.</para>
4916   </listitem>
4917  </varlistentry>
4918
4919  <varlistentry>
4920   <term>Parameter:</term>
4921   <listitem>
4922    <para>
4923     Any user-defined string.
4924    </para>
4925   </listitem>
4926  </varlistentry>
4927  
4928  <varlistentry>
4929   <term>Notes:</term>
4930   <listitem>
4931    <warning> 
4932     <para>
4933      This can lead to problems on web sites that depend on looking at this header in
4934      order to customize their content for different browsers (which, by the
4935      way, is <emphasis>NOT</emphasis> the right thing to do: good web sites
4936      work browser-independently). 
4937      <!-- 
4938      <ulink url="http://www.javascriptkit.com/javaindex.shtml">smart way to do
4939      that</ulink>!).
4940      -->
4941     </para>
4942    </warning>
4943    <para>
4944     Using this action in multi-user setups or wherever different types of
4945     browsers will access the same <application>Privoxy</application> is
4946     <emphasis>not recommended</emphasis>. In single-user, single-browser
4947     setups, you might use it to delete your OS version information from
4948     the headers, because it is an invitation to exploit known bugs for your
4949     OS. It is also occasionally useful to forge this in order to access 
4950     sites that won't let you in otherwise (though there may be a good 
4951     reason in some cases). Example of this: some MSN sites will not 
4952     let <application>Mozilla</application> enter, yet forging to a 
4953     <application>Netscape 6.1</application> user-agent works just fine.
4954     (Must be just a silly MS goof, I'm sure :-).
4955    </para>
4956    <para>
4957      More information on known user-agent strings can be found at 
4958      <ulink url="http://www.user-agents.org/">http://www.user-agents.org/</ulink>
4959      and 
4960      <ulink url="http://en.wikipedia.org/wiki/User_agent">http://en.wikipedia.org/wiki/User_agent</ulink>.
4961    </para>
4962    </listitem>
4963  </varlistentry>
4964
4965  <varlistentry>
4966   <term>Example usage:</term>
4967   <listitem>
4968    <para>
4969      <screen>+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</screen>
4970    </para>
4971   </listitem>
4972  </varlistentry>
4973 </variablelist>
4974 </sect3>
4975
4976
4977 <!--   ~~~~~       New section      ~~~~~     -->
4978 <sect3 renderas="sect4" id="inspect-jpegs">
4979 <title>inspect-jpegs</title>
4980 <!--
4981 new action
4982 -->
4983 <variablelist>
4984  <varlistentry>
4985   <term>Typical use:</term>
4986   <listitem>
4987    <para>To protect against the MS buffer over-run in JPEG processing</para>
4988   </listitem>
4989  </varlistentry>
4990
4991  <varlistentry>
4992   <term>Effect:</term>
4993   <listitem>
4994    <para>
4995     Protect against a known exploit
4996    </para>
4997   </listitem>
4998  </varlistentry>
4999
5000  <varlistentry>
5001   <term>Type:</term>
5002   <!-- Boolean, Parameterized, Multi-value -->
5003   <listitem>
5004    <para>Boolean.</para>
5005   </listitem>
5006  </varlistentry>
5007
5008  <varlistentry>
5009   <term>Parameter:</term>
5010   <listitem>
5011    <para>
5012     N/A
5013    </para>
5014   </listitem>
5015  </varlistentry>
5016  
5017  <varlistentry>
5018   <term>Notes:</term>
5019   <listitem>
5020    <para>
5021     See Microsoft Security Bulletin MS04-028. JPEG images are one of the most 
5022     common image types found across the Internet. The exploit as described can 
5023     allow execution of code on the target system, giving an attacker access 
5024     to the system in question by merely planting an altered JPEG image, which 
5025     would have no obvious indications of what lurks inside. This action
5026     prevents this exploit.
5027    </para>
5028    <para>
5029     Note that the described exploit is only one of many,
5030     using this action does not mean that you no longer
5031     have to patch the client.
5032    </para>
5033   
5034   </listitem>
5035  </varlistentry>
5036
5037  <varlistentry>
5038   <term>Example usage:</term>
5039   <listitem>
5040    <para><screen>+inspect-jpegs</screen></para>
5041   </listitem>
5042  </varlistentry>
5043 </variablelist>
5044 </sect3>
5045
5046
5047 <!--   ~~~~~       New section      ~~~~~     -->
5048 <sect3 renderas="sect4" id="kill-popups">
5049 <title>kill-popups<anchor id="kill-popup"></title>
5050
5051 <variablelist>
5052  <varlistentry>
5053   <term>Typical use:</term>
5054   <listitem>
5055    <para>Eliminate those annoying pop-up windows (deprecated)</para>
5056   </listitem>
5057  </varlistentry>
5058
5059  <varlistentry>
5060   <term>Effect:</term>
5061   <listitem>
5062    <para>
5063     While loading the document, replace JavaScript code that opens
5064     pop-up windows with (syntactically neutral) dummy code on the fly.
5065    </para>
5066   </listitem>
5067  </varlistentry>
5068
5069  <varlistentry>
5070   <term>Type:</term>
5071   <!-- Boolean, Parameterized, Multi-value -->
5072   <listitem>
5073    <para>Boolean.</para>
5074   </listitem>
5075  </varlistentry>
5076
5077  <varlistentry>
5078   <term>Parameter:</term>
5079   <listitem>
5080    <para>
5081     N/A
5082    </para>
5083   </listitem>
5084  </varlistentry>
5085  
5086  <varlistentry>
5087   <term>Notes:</term>
5088   <listitem>
5089    <para>
5090     This action is basically a built-in, hardwired special-purpose filter
5091     action, but there are important differences: For <literal>kill-popups</literal>,
5092     the document need not be buffered, so it can be incrementally rendered while
5093     downloading. But <literal>kill-popups</literal> doesn't catch as many pop-ups as
5094     <literal><link
5095     linkend="FILTER-ALL-POPUPS">filter{<replaceable>all-popups</replaceable>}</link></literal>
5096     does and is not as smart as <literal><link
5097     linkend="FILTER-UNSOLICITED-POPUPS">filter{<replaceable>unsolicited-popups</replaceable>}</link>
5098     </literal>is.
5099    </para>
5100    <para>
5101     Think of it as a fast and efficient replacement for a filter that you
5102     can use if you don't want any filtering at all. Note that it doesn't make
5103     sense to combine it with any <literal><link linkend="filter">filter</link></literal> action,
5104     since as soon as one <literal><link linkend="filter">filter</link></literal> applies,
5105     the whole document needs to be buffered anyway, which destroys the advantage of
5106     the <literal>kill-popups</literal> action over its filter equivalent.
5107    </para>
5108    <para>
5109     Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
5110     pop-ups to display forms, shopping carts etc, and the <literal><link
5111     linkend="FILTER-UNSOLICITED-POPUPS">filter{<replaceable>unsolicited-popups</replaceable>}</link>
5112     </literal> does a better job of catching only the unwanted ones.
5113    </para>
5114    <para>
5115     If the only kind of pop-ups that you want to kill are exit consoles (those
5116     <emphasis>really nasty</emphasis> windows that appear when you close an other
5117     one), you might want to use
5118     <literal><link
5119     linkend="filter">filter</link>{<replaceable>js-annoyances</replaceable>}</literal>
5120     instead. 
5121    </para>
5122    <para>
5123     This action is most appropriate for browsers that don't have any controls 
5124     for unwanted pop-ups. Not recommended for general usage.
5125    </para>
5126
5127   <!-- 
5128    <para>
5129     An alternate spelling is <literal>+kill-popup</literal>, which is 
5130     interchangeable.
5131    </para>
5132  --> 
5133   </listitem>
5134  </varlistentry>
5135
5136  <varlistentry>
5137   <term>Example usage:</term>
5138   <listitem>
5139    <para><screen>+kill-popups</screen></para>
5140   </listitem>
5141  </varlistentry>
5142 </variablelist>
5143 </sect3>
5144
5145
5146 <!--   ~~~~~       New section      ~~~~~     -->
5147 <sect3 renderas="sect4" id="limit-connect">
5148 <title>limit-connect</title>
5149
5150 <variablelist>
5151  <varlistentry>
5152   <term>Typical use:</term>
5153   <listitem>
5154    <para>Prevent abuse of <application>Privoxy</application> as a TCP proxy relay or disable SSL for untrusted sites</para>
5155   </listitem>
5156  </varlistentry>
5157
5158  <varlistentry>
5159   <term>Effect:</term>
5160   <listitem>
5161    <para>
5162     Specifies to which ports HTTP CONNECT requests are allowable.
5163    </para>
5164   </listitem>
5165  </varlistentry>
5166
5167  <varlistentry>
5168   <term>Type:</term>
5169   <!-- Boolean, Parameterized, Multi-value -->
5170   <listitem>
5171    <para>Parameterized.</para>
5172   </listitem>
5173  </varlistentry>
5174
5175  <varlistentry>
5176   <term>Parameter:</term>
5177   <listitem>
5178    <para>
5179     A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5180     defaulting to 0 and the maximum to 65K).
5181    </para>
5182   </listitem>
5183  </varlistentry>
5184  
5185  <varlistentry>
5186   <term>Notes:</term>
5187   <listitem>
5188    <para>
5189     By default, i.e. if no <literal>limit-connect</literal> action applies,
5190     <application>Privoxy</application> only allows HTTP CONNECT
5191     requests to port 443 (the standard, secure HTTPS port). Use 
5192     <literal>limit-connect</literal> if more fine-grained control is desired
5193     for some or all destinations.
5194    </para>
5195    <para>
5196     The CONNECT methods exists in HTTP to allow access to secure websites
5197     (<quote>https://</quote> URLs) through proxies. It works very simply:
5198     the proxy connects to the server on the specified port, and then
5199     short-circuits its connections to the client and to the remote server.
5200     This can be a big security hole, since CONNECT-enabled proxies can be
5201     abused as TCP relays very easily.
5202   </para>
5203   <para>
5204    <application>Privoxy</application> relays HTTPS traffic without seeing
5205    the decoded content. Websites can leverage this limitation to circumvent &my-app;'s
5206    filters. By specifying an invalid port range you can disable HTTPS entirely.
5207    If you plan to disable SSL by default, consider enabling 
5208    <literal><link linkend="treat-forbidden-connects-like-blocks ">treat-forbidden-connects-like-blocks</link></literal>
5209    as well, to be able to quickly create exceptions.
5210   </para>
5211   </listitem>
5212  </varlistentry>
5213
5214  <varlistentry>
5215   <term>Example usages:</term>
5216   <listitem>
5217    <!-- I had trouble getting the spacing to look right in my browser -->
5218    <!-- I probably have the wrong font setup, bollocks. -->
5219    <!-- Apparently the emphasis tag uses a proportional font no matter what -->
5220     <para>
5221      <screen>+limit-connect{443}                   # This is the default and need not be specified.
5222 +limit-connect{80,443}                # Ports 80 and 443 are OK.
5223 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5224 +limit-connect{-}                     # All ports are OK
5225 +limit-connect{,}                     # No HTTPS/SSL traffic is allowed</screen>
5226    </para>
5227   </listitem>
5228  </varlistentry>
5229 </variablelist>
5230 </sect3>
5231
5232 <!--   ~~~~~       New section      ~~~~~     -->
5233 <sect3 renderas="sect4" id="prevent-compression">
5234 <title>prevent-compression</title>
5235
5236 <variablelist>
5237  <varlistentry>
5238   <term>Typical use:</term>
5239   <listitem>
5240    <para>
5241     Ensure that servers send the content uncompressed, so it can be
5242     passed through <literal><link linkend="filter">filter</link></literal>s.
5243    </para>
5244   </listitem>
5245  </varlistentry>
5246
5247  <varlistentry>
5248   <term>Effect:</term>
5249   <listitem>
5250    <para>
5251     Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5252    </para>
5253   </listitem>
5254  </varlistentry>
5255
5256  <varlistentry>
5257   <term>Type:</term>
5258   <!-- Boolean, Parameterized, Multi-value -->
5259   <listitem>
5260    <para>Boolean.</para>
5261   </listitem>
5262  </varlistentry>
5263
5264  <varlistentry>
5265   <term>Parameter:</term>
5266   <listitem>
5267    <para>
5268     N/A
5269    </para>
5270   </listitem>
5271  </varlistentry>
5272  
5273  <varlistentry>
5274   <term>Notes:</term>
5275   <listitem>
5276    <para>
5277     More and more websites send their content compressed by default, which
5278     is generally a good idea and saves bandwidth. But the <literal><link
5279     linkend="filter">filter</link></literal>, <literal><link linkend="deanimate-gifs">deanimate-gifs</link></literal>
5280     and <literal><link linkend="kill-popups">kill-popups</link></literal> actions need
5281     access to the uncompressed data.
5282    </para>
5283    <para>
5284     When compiled with zlib support (available since &my-app; 3.0.7), content that should be
5285     filtered is decompressed on-the-fly and you don't have to worry about this action.
5286     If you are using an older &my-app; version, or one that hasn't been compiled with zlib
5287     support, this action can be used to convince the server to send the content uncompressed.
5288    </para>
5289    <para>
5290     Most text-based instances compress very well, the size is seldom decreased by less than 50%,
5291     for markup-heavy instances like news feeds saving more than 90% of the original size isn't
5292     unusual. 
5293    </para>
5294    <para>
5295     Not using compression will therefore slow down the transfer, and you should only
5296     enable this action if you really need it. As of &my-app; 3.0.7 it's disabled in all
5297     predefined action settings.
5298    </para>
5299    <para>
5300     Note that some (rare) ill-configured sites don't handle requests for uncompressed
5301     documents correctly. Broken PHP applications tend to send an empty document body,
5302     some IIS versions only send the beginning of the content. If you enable
5303     <literal>prevent-compression</literal> per default, you might want to add
5304     exceptions for those sites. See the example for how to do that.
5305    </para>
5306   </listitem>
5307  </varlistentry>
5308
5309  <varlistentry>
5310   <term>Example usage (sections):</term>
5311   <listitem>
5312    <para>
5313     <screen>
5314 # Selectively turn off compression, and enable a filter
5315 #
5316 { +filter{tiny-textforms} +prevent-compression }
5317 # Match only these sites
5318  .google.
5319  sourceforge.net
5320  sf.net
5321
5322 # Or instead, we could set a universal default:
5323 #
5324 { +prevent-compression }
5325  / # Match all sites
5326
5327 # Then maybe make exceptions for broken sites:
5328 #
5329 { -prevent-compression }
5330 .compusa.com/</screen>
5331    </para>
5332   </listitem>
5333  </varlistentry>
5334
5335 </variablelist>
5336 </sect3>
5337
5338
5339 <!--   ~~~~~       New section      ~~~~~     -->
5340 <sect3 renderas="sect4" id="overwrite-last-modified">
5341 <title>overwrite-last-modified</title>
5342 <!--
5343 new action
5344 -->
5345 <variablelist>
5346  <varlistentry>
5347   <term>Typical use:</term>
5348   <listitem>
5349    <para>Prevent yet another way to track the user's steps between sessions.</para>
5350   </listitem>
5351  </varlistentry>
5352
5353  <varlistentry>
5354   <term>Effect:</term>
5355   <listitem>
5356    <para>
5357     Deletes the <quote>Last-Modified:</quote> HTTP server header or modifies its value. 
5358    </para>
5359   </listitem>
5360  </varlistentry>
5361
5362  <varlistentry>
5363   <term>Type:</term>
5364   <!-- Boolean, Parameterized, Multi-value -->
5365   <listitem>
5366    <para>Parameterized.</para>
5367   </listitem>
5368  </varlistentry>
5369
5370  <varlistentry>
5371   <term>Parameter:</term>
5372   <listitem>
5373    <para>
5374     One of the keywords: <quote>block</quote>, <quote>reset-to-request-time</quote>
5375     and <quote>randomize</quote>
5376    </para>    
5377   </listitem>
5378  </varlistentry>
5379  
5380  <varlistentry>
5381   <term>Notes:</term>
5382   <listitem>
5383    <para>
5384     Removing the <quote>Last-Modified:</quote> header is useful for filter
5385     testing, where you want to force a real reload instead of getting status
5386     code <quote>304</quote>, which would cause the browser to reuse the old
5387     version of the page.
5388    </para>
5389    <para>
5390     The <quote>randomize</quote> option overwrites the value of the
5391     <quote>Last-Modified:</quote> header with a randomly chosen time
5392     between the original value and the current time. In theory the server
5393     could send each document with a different <quote>Last-Modified:</quote>
5394     header to track visits without using cookies. <quote>Randomize</quote>
5395     makes it impossible and the browser can still revalidate cached documents. 
5396    </para>
5397    <para>
5398     <quote>reset-to-request-time</quote> overwrites the value of the
5399     <quote>Last-Modified:</quote> header with the current time. You could use
5400     this option together with
5401     <literal><link linkend="hide-if-modified-since">hided-if-modified-since</link></literal>
5402     to further customize your random range.
5403    </para>
5404    <para>
5405     The preferred parameter here is <quote>randomize</quote>. It is safe
5406     to use, as long as the time settings are more or less correct.
5407     If the server sets the <quote>Last-Modified:</quote> header to the time
5408     of the request, the random range becomes zero and the value stays the same.
5409     Therefore you should later randomize it a second time with
5410     <literal><link linkend="hide-if-modified-since">hided-if-modified-since</link></literal>,
5411     just to be sure. 
5412    </para>
5413    <para>
5414     It is also recommended to use this action together with
5415     <literal><link linkend="crunch-if-none-match">crunch-if-none-match</link></literal>.
5416    </para>
5417   </listitem>
5418  </varlistentry>
5419
5420  <varlistentry>
5421   <term>Example usage:</term>
5422   <listitem>
5423     <para>
5424      <screen># Let the browser revalidate without being tracked across sessions
5425 { +hide-if-modified-since{-60} \
5426  +overwrite-last-modified{randomize} \
5427  +crunch-if-none-match}
5428 /</screen>
5429    </para>
5430   </listitem>
5431  </varlistentry>
5432 </variablelist>
5433 </sect3>
5434
5435
5436 <!--   ~~~~~       New section      ~~~~~     -->
5437 <sect3 renderas="sect4" id="redirect">
5438 <title>redirect</title>
5439 <!--
5440 new action
5441 -->
5442 <variablelist>
5443  <varlistentry>
5444   <term>Typical use:</term>
5445   <listitem>
5446    <para>
5447     Redirect requests to other sites.
5448    </para>
5449   </listitem>
5450  </varlistentry>
5451
5452  <varlistentry>
5453   <term>Effect:</term>
5454   <listitem>
5455    <para>
5456     Convinces the browser that the requested document has been moved
5457     to another location and the browser should get it from there.
5458    </para>
5459   </listitem>
5460  </varlistentry>
5461
5462  <varlistentry>
5463   <term>Type:</term>
5464   <!-- Boolean, Parameterized, Multi-value -->
5465   <listitem>
5466    <para>Parameterized</para>
5467   </listitem>
5468  </varlistentry>
5469
5470  <varlistentry>
5471   <term>Parameter:</term>
5472   <listitem>
5473    <para>
5474     An absolute URL or a single pcrs command.
5475    </para>
5476   </listitem>
5477  </varlistentry>
5478  
5479  <varlistentry>
5480   <term>Notes:</term>
5481   <listitem>
5482    <para>
5483     Requests to which this action applies are answered with a
5484     HTTP redirect to URLs of your choosing. The new URL is
5485     either provided as parameter, or derived by applying a
5486     single pcrs command to the original URL.
5487    </para>
5488    <para>
5489     This action will be ignored if you use it together with
5490     <literal><link linkend="block">block</link></literal>.
5491     It can be combined with
5492     <literal><link linkend="fast-redirects">fast-redirects{check-decoded-url}</link></literal>
5493     to redirect to a decoded version of a rewritten URL.
5494    </para>
5495    <para>
5496     Use this action carefully, make sure not to create redirection loops
5497     and be aware that using your own redirects might make it
5498     possible to fingerprint your requests.
5499    </para>
5500   </listitem>
5501  </varlistentry>
5502
5503  <varlistentry>
5504   <term>Example usages:</term>
5505   <listitem>
5506    <para>
5507     <screen># Replace example.com's style sheet with another one
5508 { +redirect{http://localhost/css-replacements/example.com.css} }
5509  example.com/stylesheet\.css
5510
5511 # Create a short, easy to remember nickname for a favorite site
5512 # (relies on the browser accept and forward invalid URLs to &my-app;)
5513 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
5514  a
5515
5516 # Always use the expanded view for Undeadly.org articles
5517 # (Note the $ at the end of the URL pattern to make sure
5518 # the request for the rewritten URL isn't redirected as well)
5519 {+redirect{s@$@&amp;mode=expanded@}}
5520 undeadly.org/cgi\?action=article&amp;sid=\d*$</screen>
5521    </para>
5522   </listitem>
5523  </varlistentry>
5524
5525 </variablelist>
5526 </sect3>
5527
5528
5529 <!--   ~~~~~       New section      ~~~~~     -->
5530 <sect3 renderas="sect4" id="send-vanilla-wafer">
5531 <title>send-vanilla-wafer</title>
5532
5533 <variablelist>
5534  <varlistentry>
5535   <term>Typical use:</term>
5536   <listitem>
5537    <para>
5538     Feed log analysis scripts with useless data.
5539    </para>
5540   </listitem>
5541  </varlistentry>
5542
5543  <varlistentry>
5544   <term>Effect:</term>
5545   <listitem>
5546    <para>
5547     Sends a cookie with each request stating that you do not accept any copyright
5548     on cookies sent to you, and asking the site operator not to track you.
5549    </para>
5550   </listitem>
5551  </varlistentry>
5552
5553  <varlistentry>
5554   <term>Type:</term>
5555   <!-- Boolean, Parameterized, Multi-value -->
5556   <listitem>
5557    <para>Boolean.</para>
5558   </listitem>
5559  </varlistentry>
5560
5561  <varlistentry>
5562   <term>Parameter:</term>
5563   <listitem>
5564    <para>
5565     N/A
5566    </para>
5567   </listitem>
5568  </varlistentry>
5569  
5570  <varlistentry>
5571   <term>Notes:</term>
5572   <listitem>
5573    <para>
5574     The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
5575    </para>
5576    <para>
5577     This action is rarely used and not enabled in the default configuration.
5578    </para>
5579   </listitem>
5580  </varlistentry>
5581
5582  <varlistentry>
5583   <term>Example usage:</term>
5584   <listitem>
5585    <para>
5586      <screen>+send-vanilla-wafer</screen>
5587    </para>
5588   </listitem>
5589  </varlistentry>
5590
5591 </variablelist>
5592 </sect3>
5593
5594
5595 <!--   ~~~~~       New section      ~~~~~     -->
5596 <sect3 renderas="sect4" id="send-wafer">
5597 <title>send-wafer</title>
5598
5599 <variablelist>
5600  <varlistentry>
5601   <term>Typical use:</term>
5602   <listitem>
5603    <para>
5604     Send custom cookies or feed log analysis scripts with even more useless data.
5605    </para>
5606   </listitem>
5607  </varlistentry>
5608
5609  <varlistentry>
5610   <term>Effect:</term>
5611   <listitem>
5612    <para>
5613     Sends a custom, user-defined cookie with each request.
5614    </para>
5615   </listitem>
5616  </varlistentry>
5617
5618  <varlistentry>
5619   <term>Type:</term>
5620   <!-- Boolean, Parameterized, Multi-value -->
5621   <listitem>
5622    <para>Multi-value.</para>
5623   </listitem>
5624  </varlistentry>
5625
5626  <varlistentry>
5627   <term>Parameter:</term>
5628   <listitem>
5629    <para>
5630     A string of the form <quote><replaceable class="option">name</replaceable>=<replaceable
5631     class="parameter">value</replaceable></quote>.
5632    </para>
5633   </listitem>
5634  </varlistentry>
5635  
5636  <varlistentry>
5637   <term>Notes:</term>
5638   <listitem>
5639    <para>
5640     Being multi-valued, multiple instances of this action can apply to the same request,
5641     resulting in multiple cookies being sent.
5642    </para>
5643    <para>
5644     This action is rarely used and not enabled in the default configuration.
5645    </para>
5646   </listitem>
5647  </varlistentry>
5648  <varlistentry>
5649   <term>Example usage (section):</term>
5650   <listitem>
5651    <para>
5652     <screen>{+send-wafer{UsingPrivoxy=true}}
5653 my-internal-testing-server.void</screen>
5654    </para>
5655   </listitem>
5656  </varlistentry>
5657 </variablelist>
5658 </sect3>
5659
5660
5661 <!--   ~~~~~       New section      ~~~~~     -->
5662 <sect3 renderas="sect4" id="server-header-filter">
5663 <title>server-header-filter</title>
5664
5665 <variablelist>
5666  <varlistentry>
5667   <term>Typical use:</term>
5668   <listitem>
5669    <para>
5670    Rewrite or remove single server headers.
5671    </para>
5672   </listitem>
5673  </varlistentry>
5674
5675  <varlistentry>
5676   <term>Effect:</term>
5677   <listitem>
5678    <para>
5679     All server headers to which this action applies are filtered on-the-fly
5680     through the specified regular expression based substitutions.
5681    </para>
5682   </listitem>
5683  </varlistentry>
5684
5685  <varlistentry>
5686   <term>Type:</term>
5687   <!-- boolean, parameterized, Multi-value -->
5688   <listitem>
5689    <para>Parameterized.</para>
5690   </listitem>
5691  </varlistentry>
5692
5693  <varlistentry>
5694   <term>Parameter:</term>
5695   <listitem>
5696    <para>
5697     The name of a server-header filter, as defined in one of the
5698     <link linkend="filter-file">filter files</link>.
5699    </para>
5700   </listitem>
5701  </varlistentry>
5702  
5703  <varlistentry>
5704   <term>Notes:</term>
5705   <listitem>
5706    <para>
5707     Server-header filters are applied to each header on its own, not to
5708     all at once. This makes it easier to diagnose problems, but on the downside
5709     you can't write filters that only change header x if header y's value is z.
5710     You can do that by using tags though.
5711    </para>
5712    <para>
5713     Server-header filters are executed after the other header actions have finished
5714     and use their output as input.
5715    </para>
5716    <para>
5717     Please refer to the <link linkend="filter-file">filter file chapter</link>
5718     to learn which server-header filters are available by default, and how to
5719     create your own.
5720    </para>
5721  </listitem>
5722  </varlistentry>
5723
5724  <varlistentry>
5725   <term>Example usage (section):</term>
5726   <listitem>
5727     <para>
5728      <screen>
5729 {+server-header-filter{html-to-xml}}
5730 example.org/xml-instance-that-is-delivered-as-html
5731
5732 {+server-header-filter{xml-to-html}}
5733 example.org/instance-that-is-delivered-as-xml-but-is-not
5734     </screen>
5735     </para>
5736   </listitem>
5737  </varlistentry>
5738
5739 </variablelist>
5740 </sect3>
5741
5742
5743 <!--   ~~~~~       New section      ~~~~~     -->
5744 <sect3 renderas="sect4" id="server-header-tagger">
5745 <title>server-header-tagger</title>
5746
5747 <variablelist>
5748  <varlistentry>
5749   <term>Typical use:</term>
5750   <listitem>
5751    <para>
5752    Disable or disable filters based on the Content-Type header.
5753    </para>
5754   </listitem>
5755  </varlistentry>
5756
5757  <varlistentry>
5758   <term>Effect:</term>
5759   <listitem>
5760    <para>
5761     Server headers to which this action applies are filtered on-the-fly through
5762     the specified regular expression based substitutions, the result is used as
5763     tag.
5764    </para>
5765   </listitem>
5766  </varlistentry>
5767
5768  <varlistentry>
5769   <term>Type:</term>
5770   <!-- boolean, parameterized, Multi-value -->
5771   <listitem>
5772    <para>Parameterized.</para>
5773   </listitem>
5774  </varlistentry>
5775
5776  <varlistentry>
5777   <term>Parameter:</term>
5778   <listitem>
5779    <para>
5780     The name of a server-header tagger, as defined in one of the
5781     <link linkend="filter-file">filter files</link>.
5782    </para>
5783   </listitem>
5784  </varlistentry>
5785  
5786  <varlistentry>
5787   <term>Notes:</term>
5788   <listitem>
5789    <para>
5790     Server-header taggers are applied to each header on its own,
5791     and as the header isn't modified, each tagger <quote>sees</quote>
5792     the original.
5793    </para>
5794    <para>
5795     Server-header taggers are executed before all other header actions
5796     that modify server headers. Their tags can be used to control
5797     all of the other server-header actions, the content filters
5798     and the crunch actions (<link linkend="redirect">redirect</link>
5799     and <link linkend="block">block</link>).
5800    </para>
5801    <para>
5802     Obviously crunching based on tags created by server-header taggers
5803     doesn't prevent the request from showing up in the server's log file.
5804    </para>
5805
5806  </listitem>
5807  </varlistentry>
5808
5809  <varlistentry>
5810   <term>Example usage (section):</term>
5811   <listitem>
5812     <para>
5813      <screen>
5814 # Tag every request with the declared content type
5815 {+client-header-tagger{content-type}}
5816 /
5817     </screen>
5818     </para>
5819   </listitem>
5820  </varlistentry>
5821
5822 </variablelist>
5823 </sect3>
5824
5825
5826 <!--   ~~~~~       New section      ~~~~~     -->
5827 <sect3 renderas="sect4" id="session-cookies-only">
5828 <title>session-cookies-only</title>
5829
5830 <variablelist>
5831  <varlistentry>
5832   <term>Typical use:</term>
5833   <listitem>
5834    <para>
5835     Allow only temporary <quote>session</quote> cookies (for the current
5836     browser session <emphasis>only</emphasis>). 
5837    </para>
5838   </listitem>
5839  </varlistentry>
5840
5841  <varlistentry>
5842   <term>Effect:</term>
5843   <listitem>
5844    <para>
5845     Deletes the <quote>expires</quote> field from <quote>Set-Cookie:</quote>
5846     server headers. Most browsers will not store such cookies permanently and
5847     forget them in between sessions.
5848    </para>
5849   </listitem>
5850  </varlistentry>
5851
5852 <varlistentry>
5853   <term>Type:</term>
5854   <!-- Boolean, Parameterized, Multi-value -->
5855   <listitem>
5856    <para>Boolean.</para>
5857   </listitem>
5858  </varlistentry>
5859
5860  <varlistentry>
5861   <term>Parameter:</term>
5862   <listitem>
5863    <para>
5864     N/A
5865    </para>
5866   </listitem>
5867  </varlistentry>
5868  
5869  <varlistentry>
5870   <term>Notes:</term>
5871   <listitem>
5872    <para>
5873     This is less strict than <literal><link linkend="crunch-incoming-cookies">crunch-incoming-cookies</link></literal> / 
5874     <literal><link linkend="crunch-outgoing-cookies">crunch-outgoing-cookies</link></literal> and allows you to browse
5875     websites that insist or rely on setting cookies, without compromising your privacy too badly.
5876    </para>
5877    <para>
5878     Most browsers will not permanently store cookies that have been processed by
5879     <literal>session-cookies-only</literal> and will forget about them between sessions.
5880     This makes profiling cookies useless, but won't break sites which require cookies so
5881     that you can log in for transactions. This is generally turned on for all 
5882     sites, and is the recommended setting.
5883    </para>
5884    <para>
5885     It makes <emphasis>no sense at all</emphasis> to use <literal>session-cookies-only</literal>
5886     together with <literal><link linkend="crunch-incoming-cookies">crunch-incoming-cookies</link></literal> or
5887     <literal><link linkend="crunch-outgoing-cookies">crunch-outgoing-cookies</link></literal>. If you do, cookies
5888     will be plainly killed.
5889    </para>
5890    <para>
5891     Note that it is up to the browser how it handles such cookies without an <quote>expires</quote>
5892     field. If you use an exotic browser, you might want to try it out to be sure.
5893    </para>
5894    <para>
5895     This setting also has no effect on cookies that may have been stored
5896     previously by the browser before starting <application>Privoxy</application>.
5897     These would have to be removed manually.
5898    </para>
5899    <para>
5900      <application>Privoxy</application> also uses  
5901      the <link linkend="filter-content-cookies">content-cookies filter</link> 
5902      to block some types of cookies. Content cookies are not effected by 
5903      <literal>session-cookies-only</literal>.
5904    </para>
5905   </listitem>
5906  </varlistentry>
5907
5908  <varlistentry>
5909   <term>Example usage:</term>
5910   <listitem>
5911    <para>
5912      <screen>+session-cookies-only</screen>
5913    </para>
5914   </listitem>
5915  </varlistentry>
5916 </variablelist>
5917 </sect3>
5918
5919
5920 <!--   ~~~~~       New section      ~~~~~     -->
5921 <sect3 renderas="sect4" id="set-image-blocker">
5922 <title>set-image-blocker</title>
5923
5924 <variablelist>
5925  <varlistentry>
5926   <term>Typical use:</term>
5927   <listitem>
5928    <para>Choose the replacement for blocked images</para>
5929   </listitem>
5930  </varlistentry>
5931
5932  <varlistentry>
5933   <term>Effect:</term>
5934   <listitem>
5935    <para>
5936      This action alone doesn't do anything noticeable. If <emphasis>both</emphasis>
5937      <literal><link linkend="block">block</link></literal> <emphasis>and</emphasis> <literal><link
5938      linkend="handle-as-image">handle-as-image</link></literal> <emphasis>also</emphasis>
5939      apply, i.e. if the request is to be blocked as an image,
5940      <emphasis>then</emphasis> the parameter of this action decides what will be
5941      sent as a replacement.
5942    </para>
5943   </listitem>
5944  </varlistentry>
5945
5946  <varlistentry>
5947   <term>Type:</term>
5948   <!-- Boolean, Parameterized, Multi-value -->
5949   <listitem>
5950    <para>Parameterized.</para>
5951   </listitem>
5952  </varlistentry>
5953
5954  <varlistentry>
5955   <term>Parameter:</term>
5956   <listitem>
5957    <itemizedlist>
5958     <listitem>
5959      <para>
5960       <quote>pattern</quote> to send a built-in checkerboard pattern image. The image is visually
5961       decent, scales very well, and makes it obvious where banners were busted.
5962      </para>
5963     </listitem>
5964     <listitem>
5965      <para>
5966       <quote>blank</quote> to send a built-in transparent image. This makes banners disappear
5967       completely, but makes it hard to detect where <application>Privoxy</application> has blocked
5968       images on a given page and complicates troubleshooting if <application>Privoxy</application>
5969       has blocked innocent images, like navigation icons.
5970      </para>
5971     </listitem>
5972     <listitem>
5973      <para>
5974       <quote><replaceable class="parameter">target-url</replaceable></quote> to
5975       send a redirect to <replaceable class="parameter">target-url</replaceable>. You can redirect
5976       to any image anywhere, even in your local filesystem via <quote>file:///</quote> URL. 
5977       (But note that not all browsers support redirecting to a local file system).
5978      </para>
5979      <para>
5980       A good application of redirects is to use special <application>Privoxy</application>-built-in
5981       URLs, which send the built-in images, as <replaceable class="parameter">target-url</replaceable>.
5982       This has the same visual effect as specifying <quote>blank</quote> or <quote>pattern</quote> in
5983       the first place, but enables your browser to cache the replacement image, instead of requesting
5984       it over and over again.
5985      </para>
5986     </listitem>
5987    </itemizedlist>
5988   </listitem>
5989  </varlistentry>
5990
5991  <varlistentry>
5992   <term>Notes:</term>
5993   <listitem>
5994    <para>
5995     The URLs for the built-in images are <quote>http://config.privoxy.org/send-banner?type=<replaceable
5996     class="parameter">type</replaceable></quote>, where <replaceable class="parameter">type</replaceable> is
5997     either <quote>blank</quote> or <quote>pattern</quote>.
5998    </para>
5999    <para>
6000     There is a third (advanced) type, called <quote>auto</quote>. It is <emphasis>NOT</emphasis> to be
6001     used in <literal>set-image-blocker</literal>, but meant for use from <link linkend="filter-file">filters</link>.
6002     Auto will select the type of image that would have applied to the referring page, had it been an image.
6003    </para>
6004   </listitem>
6005  </varlistentry>
6006
6007  <varlistentry>
6008   <term>Example usage:</term>
6009   <listitem>
6010    <para>
6011     Built-in pattern:
6012    </para>
6013    <para>
6014     <screen>+set-image-blocker{pattern}</screen>
6015    </para>
6016    <para>
6017     Redirect to the BSD daemon:
6018    </para>
6019    <para>
6020     <screen>+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</screen>
6021    </para>
6022    <para>
6023     Redirect to the built-in pattern for better caching:
6024    </para>
6025    <para>
6026     <screen>+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</screen>
6027    </para>
6028   </listitem>
6029  </varlistentry>
6030 </variablelist>
6031 </sect3>
6032
6033
6034 <!--   ~~~~~       New section      ~~~~~     -->
6035 <sect3 renderas="sect4" id="treat-forbidden-connects-like-blocks">
6036 <title>treat-forbidden-connects-like-blocks</title>
6037 <!--
6038 new action
6039 -->
6040 <variablelist>
6041  <varlistentry>
6042   <term>Typical use:</term>
6043   <listitem>
6044    <para>Block forbidden connects with an easy to find error message.</para>
6045   </listitem>
6046  </varlistentry>
6047
6048  <varlistentry>
6049   <term>Effect:</term>
6050   <listitem>
6051    <para>
6052     If this action is enabled, <application>Privoxy</application> no longer
6053     makes a difference between forbidden connects and ordinary blocks. 
6054    </para>
6055   </listitem>
6056  </varlistentry>
6057
6058  <varlistentry>
6059   <term>Type:</term>
6060   <!-- Boolean, Parameterized, Multi-value -->
6061   <listitem>
6062    <para>Boolean</para>
6063   </listitem>
6064  </varlistentry>
6065
6066  <varlistentry>
6067   <term>Parameter:</term>
6068   <listitem>
6069    <para>N/A</para>
6070   </listitem>
6071  </varlistentry>
6072
6073  <varlistentry>
6074   <term>Notes:</term>
6075   <listitem>
6076    <para>
6077     By default <application>Privoxy</application> answers
6078     <link linkend="limit-connect">forbidden <quote>Connect</quote> requests</link>
6079     with a short error message inside the headers. If the browser doesn't display
6080     headers (most don't), you just see an empty page.
6081    </para>
6082    <para>
6083     With this action enabled, <application>Privoxy</application> displays
6084     the message that is used for ordinary blocks instead. If you decide
6085     to make an exception for the page in question, you can do so by
6086     following the <quote>See why</quote> link.
6087    </para>
6088    <para>
6089     For <quote>Connect</quote> requests the clients tell
6090     <application>Privoxy</application> which host they are interested
6091     in, but not which document they plan to get later. As a result, the
6092     <quote>Go there anyway</quote> wouldn't work and is therefore suppressed.
6093    </para>
6094   </listitem>
6095  </varlistentry>
6096
6097  <varlistentry>
6098   <term>Example usage:</term>
6099   <listitem>
6100    <para>
6101     <screen>+treat-forbidden-connects-like-blocks</screen>
6102    </para>
6103   </listitem>
6104  </varlistentry>
6105 </variablelist>
6106 </sect3>
6107
6108
6109 <!--   ~~~~~       New section      ~~~~~     -->
6110 <sect3>
6111 <title>Summary</title>
6112 <para>
6113  Note that many of these actions have the potential to cause a page to
6114  misbehave, possibly even not to display at all. There are many ways 
6115  a site designer may choose to design his site, and what HTTP header 
6116  content, and other criteria, he may depend on. There is no way to have hard
6117  and fast rules for all sites. See the <link
6118  linkend="ACTIONSANAT">Appendix</link> for a brief example on troubleshooting
6119  actions.
6120 </para>
6121 </sect3>
6122 </sect2>
6123
6124 <!--   ~~~~~       New section      ~~~~~     -->
6125 <sect2 id="aliases">
6126 <title>Aliases</title>
6127 <para>
6128  Custom <quote>actions</quote>, known to <application>Privoxy</application>
6129  as <quote>aliases</quote>, can be defined by combining other actions.
6130  These can in turn be invoked just like the built-in actions.
6131  Currently, an alias name can contain any character except space, tab,
6132  <quote>=</quote>,
6133  <quote>{</quote> and <quote>}</quote>, but we <emphasis>strongly 
6134  recommend</emphasis> that you only use <quote>a</quote> to <quote>z</quote>,
6135  <quote>0</quote> to <quote>9</quote>, <quote>+</quote>, and <quote>-</quote>.
6136  Alias names are not case sensitive, and are not required to start with a
6137  <quote>+</quote> or <quote>-</quote> sign, since they are merely textually
6138  expanded.
6139 </para>
6140 <para>
6141  Aliases can be used throughout the actions file, but they <emphasis>must be
6142  defined in a special section at the top of the file!</emphasis>
6143  And there can only be one such section per actions file. Each actions file may
6144  have its own alias section, and the aliases defined in it are only visible
6145  within that file.
6146 </para>
6147 <para>
6148  There are two main reasons to use aliases: One is to save typing for frequently
6149  used combinations of actions, the other one is a gain in flexibility: If you
6150  decide once how you want to handle shops by defining an alias called
6151  <quote>shop</quote>, you can later change your policy on shops in
6152  <emphasis>one</emphasis> place, and your changes will take effect everywhere
6153  in the actions file where the <quote>shop</quote> alias is used. Calling aliases
6154  by their purpose also makes your actions files more readable.
6155 </para>
6156 <para>
6157  Currently, there is one big drawback to using aliases, though:
6158  <application>Privoxy</application>'s built-in web-based action file
6159  editor honors aliases when reading the actions files, but it expands
6160  them before writing. So the effects of your aliases are of course preserved,
6161  but the aliases themselves are lost when you edit sections that use aliases
6162  with it.
6163 </para>
6164
6165 <para>
6166  Now let's define some aliases...
6167 </para>
6168
6169 <para>
6170  <screen>
6171  # Useful custom aliases we can use later.
6172  #
6173  # Note the (required!) section header line and that this section
6174  # must be at the top of the actions file!
6175  #
6176  {{alias}}
6177
6178  # These aliases just save typing later:
6179  # (Note that some already use other aliases!)
6180  #
6181  +crunch-all-cookies = +<link linkend="CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</link> +<link linkend="CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</link>
6182  -crunch-all-cookies = -<link linkend="CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</link> -<link linkend="CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</link>
6183  +block-as-image      = +block +handle-as-image
6184  allow-all-cookies   = -crunch-all-cookies -<link linkend="SESSION-COOKIES-ONLY">session-cookies-only</link> -<link linkend="FILTER-CONTENT-COOKIES">filter{content-cookies}</link>
6185
6186  # These aliases define combinations of actions
6187  # that are useful for certain types of sites:
6188  #
6189  fragile     = -<link linkend="BLOCK">block</link> -<link linkend="FILTER">filter</link> -crunch-all-cookies -<link linkend="FAST-REDIRECTS">fast-redirects</link> -<link linkend="HIDE-REFERER">hide-referrer</link> -<link linkend="KILL-POPUPS">kill-popups</link> -<link linkend="PREVENT-COMPRESSION">prevent-compression</link>
6190
6191  shop        = -crunch-all-cookies -<link linkend="FILTER-ALL-POPUPS">filter{all-popups}</link> -<link linkend="KILL-POPUPS">kill-popups</link>
6192
6193  # Short names for other aliases, for really lazy people ;-)
6194  #
6195  c0 = +crunch-all-cookies
6196  c1 = -crunch-all-cookies</screen>
6197 </para>
6198
6199 <para>
6200  ...and put them to use. These sections would appear in the lower part of an 
6201  actions file and define exceptions to the default actions (as specified further
6202  up for the <quote>/</quote> pattern):
6203 </para>
6204
6205 <para>
6206  <screen>
6207  # These sites are either very complex or very keen on
6208  # user data and require minimal interference to work:
6209  #
6210  {fragile}
6211  .office.microsoft.com
6212  .windowsupdate.microsoft.com
6213  # Gmail is really mail.google.com, not gmail.com
6214  mail.google.com
6215
6216  # Shopping sites:
6217  # Allow cookies (for setting and retrieving your customer data)
6218  #           
6219  {shop}
6220  .quietpc.com
6221  .worldpay.com   # for quietpc.com
6222  mybank.example.com
6223
6224  # These shops require pop-ups:
6225  #
6226  {-kill-popups -filter{all-popups} -filter{unsolicited-popups}}
6227   .dabs.com
6228   .overclockers.co.uk</screen>
6229 </para>
6230
6231 <para>
6232  Aliases like <quote>shop</quote> and <quote>fragile</quote> are typically used for 
6233  <quote>problem</quote> sites that require more than one action to be disabled 
6234  in order to function properly.
6235 </para>
6236 </sect2>
6237 <!--
6238 hal stop here
6239 -->
6240 <!--   ~~~~~       New section      ~~~~~     -->
6241 <sect2 id="act-examples">
6242 <title>Actions Files Tutorial</title>
6243 <para>
6244  The above chapters have shown <link linkend="actions-file">which actions files
6245  there are and how they are organized</link>, how actions are <link
6246  linkend="actions">specified</link> and <link linkend="actions-apply">applied
6247  to URLs</link>, how <link linkend="af-patterns">patterns</link> work, and how to
6248  define and use <link linkend="aliases">aliases</link>. Now, let's look at an
6249  example <filename>default.action</filename> and <filename>user.action</filename>
6250  file and see how all these pieces come together:
6251 </para>
6252
6253 <sect3><title>default.action</title>
6254
6255 <para>
6256 Every config file should start with a short comment stating its purpose:
6257 </para>
6258
6259 <para>
6260  <screen># Sample default.action file &lt;ijbswa-developers@lists.sourceforge.net&gt;</screen>
6261 </para>
6262
6263 <para>
6264 Then, since this is the <filename>default.action</filename> file, the
6265 first section is a special section for internal use that you needn't
6266 change or worry about:
6267 </para>
6268
6269 <para>
6270  <screen>
6271 ##########################################################################
6272 # Settings -- Don't change! For internal Privoxy use ONLY.
6273 ##########################################################################
6274
6275 {{settings}}
6276 for-privoxy-version=3.0</screen>
6277 </para>
6278
6279 <para>
6280 After that comes the (optional) alias section. We'll use the example
6281 section from the above <link linkend="aliases">chapter on aliases</link>,
6282 that also explains why and how aliases are used:
6283 </para>
6284
6285 <para>
6286  <screen>
6287 ##########################################################################
6288 # Aliases
6289 ##########################################################################
6290 {{alias}}
6291
6292  # These aliases just save typing later:
6293  # (Note that some already use other aliases!)
6294  #
6295  +crunch-all-cookies = +<link linkend="CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</link> +<link linkend="CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</link>
6296  -crunch-all-cookies = -<link linkend="CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</link> -<link linkend="CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</link>
6297  +block-as-image      = +block +handle-as-image
6298  mercy-for-cookies   = -crunch-all-cookies -<link linkend="SESSION-COOKIES-ONLY">session-cookies-only</link> -<link linkend="FILTER-CONTENT-COOKIES">filter{content-cookies}</link>
6299
6300  # These aliases define combinations of actions
6301  # that are useful for certain types of sites:
6302  #
6303  fragile     = -<link linkend="BLOCK">block</link> -<link linkend="FILTER">filter</link> -crunch-all-cookies -<link linkend="FAST-REDIRECTS">fast-redirects</link> -<link linkend="HIDE-REFERER">hide-referrer</link> -<link linkend="KILL-POPUPS">kill-popups</link>
6304  shop        = -crunch-all-cookies -<link linkend="FILTER-ALL-POPUPS">filter{all-popups}</link> -<link linkend="KILL-POPUPS">kill-popups</link></screen>
6305 </para>
6306
6307 <para>
6308  Now come the regular sections, i.e. sets of actions, accompanied
6309  by URL patterns to which they apply. Remember <emphasis>all actions
6310  are disabled when matching starts</emphasis>, so we have to explicitly
6311  enable the ones we want.
6312 </para>
6313
6314 <para>
6315  The first regular section is probably the most important. It has only
6316  one pattern, <quote><literal>/</literal></quote>, but this pattern
6317  <link linkend="af-patterns">matches all URLs</link>. Therefore, the
6318  set of actions used in this <quote>default</quote> section <emphasis>will
6319  be applied to all requests as a start</emphasis>. It can  be partly or
6320  wholly overridden by later matches further down this file, or in user.action,
6321  but it will still be largely responsible for your overall browsing
6322  experience.
6323 </para>
6324
6325 <para>
6326  Again, at the start of matching, all actions are disabled, so there is
6327  no real need to disable any actions here, but we will do that nonetheless,
6328  to have a complete listing for your reference. (Remember: a <quote>+</quote>
6329  preceding the action name enables the action, a <quote>-</quote> disables!).
6330  Also note how this long line has been made more readable by splitting it into
6331  multiple lines with line continuation.
6332 </para> 
6333
6334 <para>
6335  <screen>
6336 ##########################################################################
6337 # "Defaults" section:
6338 ##########################################################################
6339  { \
6340  -<link linkend="ADD-HEADER">add-header</link> \
6341  -<link linkend="CLIENT-HEADER-FILTER">client-header-filter{hide-tor-exit-notation}</link> \
6342  -<link linkend="BLOCK">block</link> \
6343  -<link linkend="CONTENT-TYPE-OVERWRITE">content-type-overwrite</link> \
6344  -<link linkend="CRUNCH-CLIENT-HEADER">crunch-client-header</link> \
6345  -<link linkend="CRUNCH-IF-NONE-MATCH">crunch-if-none-match</link> \
6346  -<link linkend="CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</link> \
6347  -<link linkend="CRUNCH-SERVER-HEADER">crunch-server-header</link> \
6348  -<link linkend="CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</link> \
6349  +<link linkend="DEANIMATE-GIFS">deanimate-gifs</link> \
6350  -<link linkend="DOWNGRADE-HTTP-VERSION">downgrade-http-version</link> \
6351  -<link linkend="FAST-REDIRECTS">fast-redirects{check-decoded-url}</link> \
6352  -<link linkend="FILTER-JS-ANNOYANCES">filter{js-annoyances}</link> \
6353  -<link linkend="FILTER-JS-EVENTS">filter{js-events}</link> \
6354  +<link linkend="FILTER-HTML-ANNOYANCES">filter{html-annoyances}</link> \
6355  -<link linkend="FILTER-CONTENT-COOKIES">filter{content-cookies}</link> \
6356  +<link linkend="FILTER-REFRESH-TAGS">filter{refresh-tags}</link> \
6357  -<link linkend="FILTER-UNSOLICITED-POPUPS">filter{unsolicited-popups}</link> \
6358  -<link linkend="FILTER-ALL-POPUPS">filter{all-popups}</link> \
6359  -<link linkend="FILTER-IMG-REORDER">filter{img-reorder}</link> \
6360  -<link linkend="FILTER-BANNERS-BY-SIZE">filter{banners-by-size}</link> \
6361  -<link linkend="FILTER-BANNERS-BY-LINK">filter{banners-by-link}</link> \
6362  +<link linkend="FILTER-WEBBUGS">filter{webbugs}</link> \
6363  -<link linkend="FILTER-TINY-TEXTFORMS">filter{tiny-textforms}</link> \
6364  -<link linkend="FILTER-JUMPING-WINDOWS">filter{jumping-windows}</link> \
6365  -<link linkend="FILTER-FRAMESET-BORDERS">filter{frameset-borders}</link> \
6366  -<link linkend="FILTER-DEMORONIZER">filter{demoronizer}</link> \
6367  -<link linkend="FILTER-SHOCKWAVE-FLASH">filter{shockwave-flash}</link> \
6368  -<link linkend="FILTER-QUICKTIME-KIOSKMODE">filter{quicktime-kioskmode}</link> \
6369  -<link linkend="FILTER-FUN">filter{fun}</link> \
6370  -<link linkend="FILTER-CRUDE-PARENTAL">filter{crude-parental}</link> \
6371  +<link linkend="FILTER-IE-EXPLOITS">filter{ie-exploits}</link> \     
6372  -<link linkend="FILTER-GOOGLE">filter{google}</link> \
6373  -<link linkend="FILTER-YAHOO">filter{yahoo}</link> \
6374  -<link linkend="FILTER-MSN">filter{msn}</link> \
6375  -<link linkend="FILTER-BLOGSPOT">filter{blogspot}</link> \
6376  -<link linkend="FILTER-NO-PING">filter{no-ping}</link> \
6377  -<link linkend="FORCE-TEXT-MODE">force-text-mode</link> \
6378  -<link linkend="HANDLE-AS-EMPTY-DOCUMENT">handle-as-empty-document</link> \
6379  -<link linkend="HANDLE-AS-IMAGE">handle-as-image</link> \
6380  -<link linkend="HIDE-ACCEPT-LANGUAGE">hide-accept-language</link> \
6381  -<link linkend="HIDE-CONTENT-DISPOSITION">hide-content-disposition</link> \
6382  -<link linkend="HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</link> \
6383  +<link linkend="HIDE-FORWARDED-FOR-HEADERS">hide-forwarded-for-headers</link> \
6384  +<link linkend="HIDE-FROM-HEADER">hide-from-header{block}</link> \
6385  +<link linkend="HIDE-REFERER">hide-referrer{forge}</link> \
6386  -<link linkend="HIDE-USER-AGENT">hide-user-agent</link> \
6387  -<link linkend="INSPECT-JPEGS">inspect-jpegs</link> \
6388  -<link linkend="KILL-POPUPS">kill-popups</link> \
6389  -<link linkend="LIMIT-CONNECT">limit-connect</link> \
6390  +<link linkend="PREVENT-COMPRESSION">prevent-compression</link> \
6391  -<link linkend="OVERWRITE-LAST-MODIFIED">overwrite-last-modified</link> \
6392  -<link linkend="REDIRECT">redirect</link> \
6393  -<link linkend="SEND-VANILLA-WAFER">send-vanilla-wafer</link> \
6394  -<link linkend="SEND-WAFER">send-wafer</link> \
6395  -<link linkend="SERVER-HEADER-FILTER">server-header-filter{xml-to-html}</link> \
6396  -<link linkend="SERVER-HEADER-FILTER">server-header-filter{html-to-xml}</link> \
6397  +<link linkend="SESSION-COOKIES-ONLY">session-cookies-only</link> \
6398  +<link linkend="SET-IMAGE-BLOCKER">set-image-blocker{pattern}</link> \
6399  -<link linkend="TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS">treat-forbidden-connects-like-blocks</link> \
6400  }
6401  / # forward slash will match *all* potential URL patterns.</screen>
6402 </para>
6403
6404 <para>
6405  The default behavior is now set. Note that some actions, like not hiding
6406  the user agent, are part of a <quote>general policy</quote> that applies
6407  universally and won't get any exceptions defined later. Other choices,
6408  like not blocking (which is <emphasis>understandably</emphasis> the
6409  default!) need exceptions, i.e. we need to specify explicitly what we
6410  want to block in later sections.
6411 </para>
6412
6413 <para>
6414  The first of our specialized sections is concerned with <quote>fragile</quote>
6415  sites, i.e. sites that require minimum interference, because they are either
6416  very complex or very keen on tracking you (and have mechanisms in place that
6417  make them unusable for people who avoid being tracked). We will simply use
6418  our pre-defined <literal>fragile</literal> alias instead of stating the list
6419  of actions explicitly:
6420 </para>
6421
6422 <para>
6423  <screen>
6424 ##########################################################################
6425 # Exceptions for sites that'll break under the default action set:
6426 ##########################################################################
6427
6428 # "Fragile" Use a minimum set of actions for these sites (see alias above):
6429 #
6430 { fragile }
6431 .office.microsoft.com           # surprise, surprise!
6432 .windowsupdate.microsoft.com
6433 mail.google.com</screen>
6434 </para>
6435
6436 <para>
6437  Shopping sites are not as fragile, but they typically
6438  require cookies to log in, and pop-up windows for shopping
6439  carts or item details. Again, we'll use a pre-defined alias:
6440 </para>
6441  
6442 <para>
6443  <screen>
6444 # Shopping sites:
6445 #
6446 { shop }
6447 .quietpc.com 
6448 .worldpay.com   # for quietpc.com
6449 .jungle.com
6450 .scan.co.uk</screen>
6451 </para>
6452
6453 <!-- No longer needed BEGIN OF COMMENTED OUT BLOCK 
6454
6455 <para>
6456  Then, there are sites which rely on pop-up windows (yuck!) to work.
6457  Since we made pop-up-killing our default above, we need to make exceptions
6458  now. <ulink url="http://www.mozilla.org/">Mozilla</ulink> users, who
6459  can turn on smart handling of unwanted pop-ups in their browsers, can
6460  safely choose
6461  -<literal><link linkend="FILTER-ALL-POPUPS">filter{popups}</link></literal> (and
6462  -<literal><link linkend="KILL-POPUPS">kill-popups</link></literal>) above
6463  and hence don't need this section. Anyway, disabling an already disabled
6464  action doesn't hurt, so we'll define our exceptions regardless of what was
6465  chosen in the defaults section:
6466 </para>
6467
6468 <para>
6469  <screen>
6470 # These sites require pop-ups too :( 
6471 #
6472 { -<link linkend="KILL-POPUPS">kill-popups</link> -<link linkend="FILTER-ALL-POPUPS">filter{popups}</link> }
6473 .dabs.com
6474 .overclockers.co.uk
6475 .deutsche-bank-24.de</screen>
6476 </para>
6477
6478  END OF COMMENTED OUT BLOCK -->
6479
6480 <para>
6481  The <literal><link linkend="FAST-REDIRECTS">fast-redirects</link></literal>
6482  action, which we enabled per default above,  breaks some sites. So disable
6483  it for popular sites where we know it misbehaves:
6484 </para>
6485
6486 <para>
6487  <screen>
6488 { -<link linkend="FAST-REDIRECTS">fast-redirects</link> }
6489 login.yahoo.com
6490 edit.*.yahoo.com
6491 .google.com
6492 .altavista.com/.*(like|url|link):http
6493 .altavista.com/trans.*urltext=http
6494 .nytimes.com</screen>
6495 </para>
6496
6497 <para>
6498  It is important that <application>Privoxy</application> knows which
6499  URLs belong to images, so that <emphasis>if</emphasis> they are to
6500  be blocked, a substitute image can be sent, rather than an HTML page.
6501  Contacting the remote site to find out is not an option, since it
6502  would destroy the loading time advantage of banner blocking, and it
6503  would feed the advertisers (in terms of money <emphasis>and</emphasis>
6504  information). We can mark any URL as an image with the <literal><link
6505  linkend="handle-as-image">handle-as-image</link></literal> action,
6506  and marking all URLs that end in a known image file extension is a
6507  good start:
6508 </para>
6509
6510 <para>
6511  <screen>
6512 ##########################################################################
6513 # Images:
6514 ##########################################################################
6515
6516 # Define which file types will be treated as images, in case they get
6517 # blocked further down this file:
6518 #
6519 { +<link linkend="HANDLE-AS-IMAGE">handle-as-image</link> }
6520 /.*\.(gif|jpe?g|png|bmp|ico)$</screen>
6521 </para>
6522
6523 <para>
6524  And then there are known banner sources. They often use scripts to
6525  generate the banners, so it won't be visible from the URL that the
6526  request is for an image. Hence we block them <emphasis>and</emphasis>
6527  mark them as images in one go, with the help of our
6528  <literal>+block-as-image</literal> alias defined above. (We could of
6529  course just as well use <literal>+<link linkend="block">block</link>
6530  +<link linkend="handle-as-image">handle-as-image</link></literal> here.)
6531  Remember that the type of the replacement image is chosen by the
6532  <literal><link linkend="set-image-blocker">set-image-blocker</link></literal>
6533  action. Since all URLs have matched the default section with its
6534  <literal>+<link linkend="set-image-blocker">set-image-blocker</link>{pattern}</literal>
6535  action before, it still applies and needn't be repeated:
6536 </para>
6537
6538 <para>
6539  <screen>
6540 # Known ad generators:
6541 #
6542 { +block-as-image }
6543 ar.atwola.com 
6544 .ad.doubleclick.net
6545 .ad.*.doubleclick.net
6546 .a.yimg.com/(?:(?!/i/).)*$
6547 .a[0-9].yimg.com/(?:(?!/i/).)*$
6548 bs*.gsanet.com
6549 .qkimg.net</screen>
6550 </para>
6551
6552 <para>
6553  One of the most important jobs of <application>Privoxy</application>
6554  is to block banners. Many of these can be <quote>blocked</quote>
6555  by the <literal><link linkend="filter">filter</link>{banners-by-size}</literal>
6556  action, which we enabled above, and which deletes the references to banner
6557  images from the pages while they are loaded, so the browser doesn't request
6558  them anymore, and hence they don't need to be blocked here. But this naturally
6559  doesn't catch all banners, and some people choose not to use filters, so we
6560  need a comprehensive list of patterns for banner URLs here, and apply the
6561  <literal><link linkend="block">block</link></literal> action to them.
6562 </para>
6563 <para>
6564  First comes many generic patterns, which do most of the work, by
6565  matching typical domain and path name components of banners. Then comes
6566  a list of individual patterns for specific sites, which is omitted here
6567  to keep the example short:
6568 </para>
6569
6570 <para>
6571  <screen>
6572 ##########################################################################
6573 # Block these fine banners:
6574 ##########################################################################
6575 { <link linkend="BLOCK">+block</link> }
6576
6577 # Generic patterns:
6578
6579 ad*.
6580 .*ads.
6581 banner?.
6582 count*.
6583 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
6584 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
6585
6586 # Site-specific patterns (abbreviated):
6587 #
6588 .hitbox.com</screen>
6589 </para>
6590
6591 <para>
6592  It's quite remarkable how many advertisers actually call their banner
6593  servers ads.<replaceable>company</replaceable>.com, or call the directory
6594  in which the banners are stored simply <quote>banners</quote>. So the above
6595  generic patterns are surprisingly effective.
6596 </para>
6597 <para>
6598  But being very generic, they necessarily also catch URLs that we don't want
6599  to block. The pattern <literal>.*ads.</literal> e.g. catches 
6600  <quote>nasty-<emphasis>ads</emphasis>.nasty-corp.com</quote> as intended,
6601  but also <quote>downlo<emphasis>ads</emphasis>.sourcefroge.net</quote> or
6602  <quote><emphasis>ads</emphasis>l.some-provider.net.</quote> So here come some
6603  well-known exceptions to the <literal>+<link linkend="BLOCK">block</link></literal>
6604  section above.
6605 </para>
6606 <para>
6607  Note that these are exceptions to exceptions from the default! Consider the URL
6608  <quote>downloads.sourcefroge.net</quote>: Initially, all actions are deactivated,
6609  so it wouldn't get blocked. Then comes the defaults section, which matches the
6610  URL, but just deactivates the <literal><link linkend="BLOCK">block</link></literal>
6611  action once again. Then it matches <literal>.*ads.</literal>, an exception to the
6612  general non-blocking policy, and suddenly
6613  <literal><link linkend="BLOCK">+block</link></literal> applies. And now, it'll match
6614  <literal>.*loads.</literal>, where <literal><link linkend="BLOCK">-block</link></literal>
6615  applies, so (unless it matches <emphasis>again</emphasis> further down) it ends up
6616  with no <literal><link linkend="BLOCK">block</link></literal> action applying.
6617 </para>
6618
6619 <para>
6620  <screen>
6621 ##########################################################################
6622 # Save some innocent victims of the above generic block patterns:
6623 ##########################################################################
6624
6625 # By domain:
6626
6627 { -<link linkend="BLOCK">block</link> }
6628 adv[io]*.  # (for advogato.org and advice.*)
6629 adsl.      # (has nothing to do with ads)
6630 adobe.     # (has nothing to do with ads either)
6631 ad[ud]*.   # (adult.* and add.*)
6632 .edu       # (universities don't host banners (yet!))
6633 .*loads.   # (downloads, uploads etc)
6634
6635 # By path:
6636 #
6637 /.*loads/
6638
6639 # Site-specific:
6640 #
6641 www.globalintersec.com/adv # (adv = advanced)
6642 www.ugu.com/sui/ugu/adv</screen>
6643 </para>
6644
6645 <para>
6646  Filtering source code can have nasty side effects,
6647  so make an exception for our friends at sourceforge.net,
6648  and all paths with <quote>cvs</quote> in them. Note that
6649  <literal>-<link linkend="FILTER">filter</link></literal>
6650  disables <emphasis>all</emphasis> filters in one fell swoop!
6651 </para>
6652
6653 <para>
6654  <screen>
6655 # Don't filter code!
6656 #
6657 { -<link linkend="FILTER">filter</link> }
6658 /(.*/)?cvs
6659 bugzilla.
6660 developer.
6661 wiki.
6662 .sourceforge.net</screen>
6663 </para>
6664
6665 <para>
6666  The actual <filename>default.action</filename> is of course much more
6667  comprehensive, but we hope this example made clear how it works.
6668 </para>
6669
6670 </sect3>
6671
6672 <sect3><title>user.action</title>
6673
6674 <para>
6675  So far we are painting with a broad brush by setting general policies,
6676  which would be a reasonable starting point for many people. Now, 
6677  you might want to be more specific and have customized rules that
6678  are more suitable to your personal habits and preferences. These would
6679  be for narrowly defined situations like your ISP or your bank, and should
6680  be placed in <filename>user.action</filename>, which is parsed after all other 
6681  actions files and hence has the last word, over-riding any previously
6682  defined actions. <filename>user.action</filename> is also a 
6683  <emphasis>safe</emphasis> place for your personal settings, since
6684  <filename>default.action</filename> is actively maintained by the
6685  <application>Privoxy</application> developers and you'll probably want
6686  to install updated versions from time to time.
6687 </para>
6688
6689 <para>
6690  So let's look at a few examples of things that one might typically do in
6691  <filename>user.action</filename>: 
6692 </para>
6693
6694
6695 <!-- brief sample user.action here -->
6696
6697 <para>
6698  <screen>
6699 # My user.action file. &lt;fred@foobar.com&gt;</screen>
6700 </para>
6701
6702 <para>
6703  As <link linkend="aliases">aliases</link> are local to the actions
6704  file that they are defined in, you can't use the ones from
6705  <filename>default.action</filename>, unless you repeat them here:
6706 </para>
6707
6708 <para>
6709  <screen>
6710 # Aliases are local to the file they are defined in.
6711 # (Re-)define aliases for this file:
6712 #
6713 {{alias}}
6714
6715 # These aliases just save typing later, and the alias names should 
6716 # be self explanatory.
6717 #
6718 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
6719 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
6720  allow-all-cookies  = -crunch-all-cookies -session-cookies-only
6721  allow-popups       = -filter{all-popups} -kill-popups
6722 +block-as-image     = +block +handle-as-image
6723 -block-as-image     = -block
6724
6725 # These aliases define combinations of actions that are useful for
6726 # certain types of sites:
6727 #
6728 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
6729 shop        = -crunch-all-cookies allow-popups
6730
6731 # Allow ads for selected useful free sites:
6732 #
6733 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
6734
6735 # Alias for specific file types that are text, but might have conflicting
6736 # MIME types. We want the browser to force these to be text documents.
6737 handle-as-text = -<link linkend="FILTER">filter</link> +-<link linkend="content-type-overwrite">content-type-overwrite{text/plain}</link> +-<link linkend="FORCE-TEXT-MODE">force-text-mode</link> -<link linkend="HIDE-CONTENT-DISPOSITION">hide-content-disposition</link></screen>
6738
6739 </para>
6740
6741 <para>
6742  Say you have accounts on some sites that you visit regularly, and
6743  you don't want to have to log in manually each time. So you'd like
6744  to allow persistent cookies for these sites. The
6745  <literal>allow-all-cookies</literal> alias defined above does exactly
6746  that, i.e. it disables crunching of cookies in any direction, and the 
6747  processing of cookies to make them only temporary.
6748 </para>
6749
6750 <para>
6751  <screen>
6752 { allow-all-cookies }
6753  sourceforge.net
6754  .yahoo.com
6755  .msdn.microsoft.com
6756  .redhat.com</screen>
6757 </para>
6758
6759 <para>
6760  Your bank is allergic to some filter, but you don't know which, so you disable them all:
6761 </para>
6762
6763 <para>
6764  <screen>
6765 { -<link linkend="FILTER">filter</link> }
6766  .your-home-banking-site.com</screen>
6767 </para>
6768
6769 <para>
6770  Some file types you may not want to filter for various reasons:
6771 </para>
6772
6773 <para>
6774  <screen>
6775 # Technical documentation is likely to contain strings that might
6776 # erroneously get altered by the JavaScript-oriented filters:
6777 #
6778 .tldp.org
6779 /(.*/)?selfhtml/
6780
6781 # And this stupid host sends streaming video with a wrong MIME type,
6782 # so that Privoxy thinks it is getting HTML and starts filtering:
6783 #
6784 stupid-server.example.com/</screen>
6785 </para>
6786
6787 <para>
6788  Example of a simple <link linkend="BLOCK">block</link> action. Say you've
6789  seen an ad on your favourite page on example.com that you want to get rid of.
6790  You have right-clicked the image, selected <quote>copy image location</quote>
6791  and pasted the URL below while removing the leading http://, into a 
6792  <literal>{ +block }</literal> section. Note that <literal>{ +handle-as-image
6793  }</literal> need not be specified, since all URLs ending in
6794  <literal>.gif</literal> will be tagged as images by the general rules as set
6795  in default.action anyway:
6796 </para>
6797
6798 <para>
6799  <screen>
6800 { +<link linkend="BLOCK">block</link> }
6801  www.example.com/nasty-ads/sponsor\.gif
6802  another.popular.site.net/more/junk/here/</screen>
6803 </para>
6804
6805 <para>
6806  The URLs of dynamically generated banners, especially from large banner
6807  farms, often don't use the well-known image file name extensions, which
6808  makes it impossible for <application>Privoxy</application> to guess
6809  the file type just by looking at the URL. 
6810  You can use the <literal>+block-as-image</literal> alias defined above for
6811  these cases.
6812  Note that objects which match this rule but then turn out NOT to be an
6813  image are typically rendered as a <quote>broken image</quote> icon by the
6814  browser. Use cautiously.
6815 </para>
6816
6817 <para>
6818  <screen>
6819 { +block-as-image }
6820  .doubleclick.net
6821  .fastclick.net
6822  /Realmedia/ads/
6823  ar.atwola.com/</screen>
6824 </para>
6825
6826 <para>
6827  Now you noticed that the default configuration breaks Forbes Magazine,
6828  but you were too lazy to find out which action is the culprit, and you
6829  were again too lazy to give <link linkend="contact">feedback</link>, so
6830  you just used the <literal>fragile</literal> alias on the site, and
6831  -- <emphasis>whoa!</emphasis> -- it worked. The <literal>fragile</literal>
6832  aliases disables those actions that are most likely to break a site. Also,
6833  good for testing purposes to see if it is <application>Privoxy</application>
6834  that is causing the problem or not. We later find other regular sites 
6835  that misbehave, and add those to our personalized list of troublemakers:
6836 </para>
6837
6838 <para>
6839 <screen>
6840 { fragile }
6841  .forbes.com
6842  webmail.example.com
6843  .mybank.com</screen>
6844 </para>
6845
6846 <para>
6847  You like the <quote>fun</quote> text replacements in <filename>default.filter</filename>,
6848  but it is disabled in the distributed actions file. (My colleagues on the team just
6849  don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
6850  update-safe config, once and for all:
6851 </para>
6852
6853 <para>
6854 <screen>
6855 { +<link linkend="filter-fun">filter{fun}</link> }
6856  / # For ALL sites!</screen>
6857 </para>
6858
6859 <para>
6860  Note that the above is not really a good idea: There are exceptions
6861  to the filters in <filename>default.action</filename> for things that
6862  really shouldn't be filtered, like code on CVS->Web interfaces. Since
6863  <filename>user.action</filename> has the last word, these exceptions
6864  won't be valid for the <quote>fun</quote> filtering specified here.
6865 </para>
6866
6867 <para>
6868  You might also worry about how your favourite free websites are
6869  funded, and find that they rely on displaying banner advertisements
6870  to survive. So you might want to specifically allow banners for those
6871  sites that you feel provide value to you:
6872 </para>
6873
6874 <para>
6875 <screen>
6876 { allow-ads }
6877  .sourceforge.net
6878  .slashdot.org
6879  .osdn.net</screen>   
6880 </para>
6881
6882 <para>
6883  Note that <literal>allow-ads</literal> has been aliased to 
6884  <literal>-<link linkend="block">block</link></literal>, 
6885  <literal>-<link linkend="filter-banners-by-size">filter{banners-by-size}</link></literal>, and 
6886  <literal>-<link linkend="filter-banners-by-link">filter{banners-by-link}</link></literal> above.
6887 </para>
6888
6889 <para>
6890  Invoke another alias here to force an over-ride of the MIME type <literal>
6891  application/x-sh</literal> which typically would open a download type 
6892  dialog. In my case, I want to look at the shell script, and then I can save
6893  it should I choose to.
6894 </para>
6895
6896 <para>
6897 <screen>
6898 { handle-as-text }
6899  /.*\.sh$</screen>   
6900 </para>
6901
6902 <para>
6903  <filename>user.action</filename> is generally the best place to define
6904  exceptions and additions to the default policies of
6905  <filename>default.action</filename>. Some actions are safe to have their
6906  default policies set here though. So let's set a default policy to have a
6907  <quote>blank</quote> image as opposed to the checkerboard pattern for
6908  <emphasis>ALL</emphasis> sites. <quote>/</quote> of course matches all URL
6909  paths and patterns:
6910 </para>
6911
6912 <para>
6913 <screen>
6914 { +<link linkend="set-image-blocker">set-image-blocker{blank}</link> }
6915 / # ALL sites</screen>
6916 </para>
6917
6918 </sect3>
6919 </sect2>
6920
6921 <!--  ~  End section  ~  -->
6922
6923 </sect1>
6924
6925 <!--  ~  End section  ~  -->
6926
6927 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
6928
6929 <sect1 id="filter-file">
6930 <title>Filter Files</title>
6931
6932 <para>
6933  On-the-fly text substitutions need
6934  to be defined in a <quote>filter file</quote>. Once defined, they 
6935  can then be invoked as an <quote>action</quote>.
6936 </para>
6937
6938 <para>
6939  &my-app; supports three different filter actions:
6940  <literal><link linkend="filter">filter</link></literal> to
6941  rewrite the content that is send to the client,
6942  <literal><link linkend="client-header-filter">client-header-filter</link></literal>
6943  to rewrite headers that are send by the client, and
6944  <literal><link linkend="server-header-filter">server-header-filter</link></literal>
6945  to rewrite headers that are send by the server, and
6946 </para>
6947
6948 <para>
6949  &my-app; also supports two tagger actions:
6950  <literal><link linkend="client-header-tagger">client-header-tagger</link></literal>
6951  and
6952  <literal><link linkend="server-header-tagger">server-header-tagger</link></literal>.
6953  Taggers and filters use the same syntax in the filter files, the differnce
6954  is that taggers don't modify the text they are filtering, but use a rewritten
6955  version of the filtered text as tag. The tags can then be used to change the
6956  applying actions through sections with <link linkend="tag-pattern">tag-patterns</link>.
6957 </para>
6958
6959
6960 <para>
6961  Multiple filter files can be defined through the <literal> <link
6962  linkend="filterfile">filterfile</link></literal> config directive. The filters
6963  as supplied by the developers will be found in
6964  <filename>default.filter</filename>. It is recommended that any locally
6965  defined or modified filters go in a separately defined file such as
6966  <filename>user.filter</filename>.
6967  
6968 </para>
6969
6970 <para>
6971  Command tasks for content filters are to eliminate common annoyances in
6972  HTML and JavaScript, such as pop-up windows,
6973  exit consoles, crippled windows without navigation tools, the
6974  infamous &lt;BLINK&gt; tag etc, to suppress images with certain
6975  width and height attributes (standard banner sizes or web-bugs),
6976  or just to have fun.
6977 </para>
6978
6979 <para>
6980  Content filtering works on any text-based document type, including 
6981  HTML, JavaScript, CSS etc. (all <literal>text/*</literal>
6982  MIME types, <emphasis>except</emphasis> <literal>text/plain</literal>).
6983  Substitutions are made at the source level, so if you want to <quote>roll
6984  your own</quote> filters, you should first be familiar with HTML syntax, 
6985  and, of course, regular expressions.
6986 </para>
6987
6988 <para>
6989  Just like the <link linkend="actions-file">actions files</link>, the
6990  filter file is organized in sections, which are called <emphasis>filters</emphasis>
6991  here. Each filter consists of a heading line, that starts with one of the
6992  <emphasis>keywords</emphasis> <literal>FILTER:</literal>,
6993  <literal>CLIENT-HEADER-FILTER:</literal> or <literal>SERVER-HEADER-FILTER:</literal>
6994  followed by the filter's <emphasis>name</emphasis>, and a short (one line) 
6995  <emphasis>description</emphasis> of what it does. Below that line
6996  come the <emphasis>jobs</emphasis>, i.e. lines that define the actual
6997  text substitutions. By convention, the name of a filter
6998  should describe what the filter <emphasis>eliminates</emphasis>. The
6999  comment is used in the <ulink url="http://config.privoxy.org/">web-based
7000  user interface</ulink>.
7001 </para>
7002
7003 <para>
7004  Once a filter called <replaceable>name</replaceable> has been defined
7005  in the filter file, it can be invoked by using an action of the form
7006  +<literal><link linkend="filter">filter</link>{<replaceable>name</replaceable>}</literal>
7007  in any <link linkend="actions-file">actions file</link>.
7008 </para>
7009  
7010 <para>
7011  Filter definitions start with a header line that contains the filter
7012  type, the filter name and the filter description.
7013  A content filter header line for a filter called <quote>foo</quote> could look
7014  like this:
7015 </para>
7016
7017 <para>
7018  <screen>FILTER: foo Replace all "foo" with "bar"</screen>
7019 </para>
7020
7021 <para>
7022  Below that line, and up to the next header line, come the jobs that
7023  define what text replacements the filter executes. They are specified
7024  in a syntax that imitates <ulink url="http://www.perl.org/">Perl</ulink>'s
7025  <literal>s///</literal> operator. If you are familiar with Perl, you
7026  will find this to be quite intuitive, and may want to look at the
7027  PCRS documentation for the subtle differences to Perl behaviour. Most
7028  notably, the non-standard option letter <literal>U</literal> is supported,
7029  which turns the default to ungreedy matching.
7030 </para>
7031
7032 <para>
7033  If you are new to 
7034   <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
7035   Expressions</quote></ulink>, you might want to take a look at
7036  the <link linkend="regex">Appendix on regular expressions</link>, and
7037  see the <ulink url="http://perldoc.perl.org/perlre.html">Perl
7038  manual</ulink> for
7039  <ulink url="http://perldoc.perl.org/perlop.html">the 
7040  <literal>s///</literal> operator's syntax</ulink> and <ulink
7041  url="http://perldoc.perl.org/perlre.html">Perl-style regular
7042  expressions</ulink> in general.
7043  The below examples might also help to get you started.
7044 </para>
7045
7046
7047 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
7048
7049 <sect2><title>Filter File Tutorial</title>
7050 <para>
7051  Now, let's complete our <quote>foo</quote> content filter. We have already defined
7052  the heading, but the jobs are still missing. Since all it does is to replace
7053  <quote>foo</quote> with <quote>bar</quote>, there is only one (trivial) job
7054  needed:
7055 </para>
7056
7057 <para>
7058  <screen>s/foo/bar/</screen>
7059 </para>
7060
7061 <para>
7062  But wait! Didn't the comment say that <emphasis>all</emphasis> occurrences
7063  of <quote>foo</quote> should be replaced? Our current job will only take
7064  care of the first <quote>foo</quote> on each page. For global substitution,
7065  we'll need to add the <literal>g</literal> option:
7066 </para>
7067
7068 <para>
7069  <screen>s/foo/bar/g</screen>
7070 </para>
7071
7072 <para>
7073  Our complete filter now looks like this:
7074 </para>
7075 <para>
7076  <screen>FILTER: foo Replace all "foo" with "bar"
7077 s/foo/bar/g</screen>
7078 </para>
7079
7080 <para>
7081  Let's look at some real filters for more interesting examples. Here you see
7082  a filter that protects against some common annoyances that arise from JavaScript
7083  abuse. Let's look at its jobs one after the other:
7084 </para>
7085
7086
7087 <para>
7088  <screen>
7089 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
7090
7091 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
7092 #
7093 s|(&lt;script.*)document\.referrer(.*&lt;/script&gt;)|$1"Not Your Business!"$2|Usg</screen>
7094 </para>
7095
7096 <para>
7097  Following the header line and a comment, you see the job. Note that it uses
7098  <literal>|</literal> as the delimiter instead of <literal>/</literal>, because
7099  the pattern contains a forward slash, which would otherwise have to be escaped
7100  by a backslash (<literal>\</literal>).
7101 </para>
7102
7103 <para>
7104  Now, let's examine the pattern: it starts with the text <literal>&lt;script.*</literal>
7105  enclosed in parentheses. Since the dot matches any character, and <literal>*</literal>
7106  means: <quote>Match an arbitrary number of the element left of myself</quote>, this
7107  matches <quote>&lt;script</quote>, followed by <emphasis>any</emphasis> text, i.e.
7108  it matches the whole page, from the start of the first &lt;script&gt; tag.
7109 </para>
7110
7111 <para>
7112  That's more than we want, but the pattern continues: <literal>document\.referrer</literal>
7113  matches only the exact string <quote>document.referrer</quote>. The dot needed to
7114  be <emphasis>escaped</emphasis>, i.e. preceded by a backslash, to take away its
7115  special meaning as a joker, and make it just a regular dot. So far, the meaning is:
7116  Match from the start of the first &lt;script&gt; tag in a the page, up to, and including,
7117  the text <quote>document.referrer</quote>, if <emphasis>both</emphasis> are present
7118  in the page (and appear in that order).
7119 </para>
7120
7121 <para>
7122  But there's still more pattern to go. The next element, again enclosed in parentheses,
7123  is <literal>.*&lt;/script&gt;</literal>. You already know what <literal>.*</literal>
7124  means, so the whole pattern translates to: Match from the start of the first  &lt;script&gt;
7125  tag in a page to the end of the last &lt;script&gt; tag, provided that the text
7126  <quote>document.referrer</quote> appears somewhere in between.
7127 </para>
7128
7129 <para>
7130  This is still not the whole story, since we have ignored the options and the parentheses:
7131  The portions of the page matched by sub-patterns that are enclosed in parentheses, will be
7132  remembered and be available through the variables <literal>$1, $2, ...</literal> in
7133  the substitute. The <literal>U</literal> option switches to ungreedy matching, which means
7134  that the first <literal>.*</literal> in the pattern will only <quote>eat up</quote> all
7135  text in between <quote>&lt;script</quote> and the <emphasis>first</emphasis> occurrence
7136  of <quote>document.referrer</quote>, and that the second <literal>.*</literal> will
7137  only span the text up to the <emphasis>first</emphasis> <quote>&lt;/script&gt;</quote>
7138  tag. Furthermore, the <literal>s</literal> option says that the match may span
7139  multiple lines in the page, and the <literal>g</literal> option again means that the
7140  substitution is global.
7141 </para>
7142
7143 <para>
7144  So, to summarize, the pattern means: Match all scripts that contain the text
7145  <quote>document.referrer</quote>. Remember the parts of the script from
7146  (and including) the start tag up to (and excluding) the string
7147  <quote>document.referrer</quote> as <literal>$1</literal>, and the part following
7148  that string, up to and including the closing tag, as <literal>$2</literal>.
7149 </para>
7150
7151 <para>
7152  Now the pattern is deciphered, but wasn't this about substituting things? So
7153  lets look at the substitute: <literal>$1"Not Your Business!"$2</literal> is
7154  easy to read: The text remembered as <literal>$1</literal>, followed by 
7155  <literal>"Not Your Business!"</literal> (<emphasis>including</emphasis>
7156  the quotation marks!), followed by the text remembered as <literal>$2</literal>.
7157  This produces an exact copy of the original string, with the middle part
7158  (the <quote>document.referrer</quote>) replaced by <literal>"Not Your
7159  Business!"</literal>.
7160 </para>
7161
7162 <para>
7163  The whole job now reads: Replace <quote>document.referrer</quote> by
7164  <literal>"Not Your Business!"</literal> wherever it appears inside a
7165  &lt;script&gt tag. Note that this job won't break JavaScript syntax,
7166  since both the original and the replacement are syntactically valid
7167  string objects. The script just won't have access to the referrer
7168  information anymore.
7169 </para>
7170
7171 <para>
7172  We'll show you two other jobs from the JavaScript taming department, but
7173  this time only point out the constructs of special interest:
7174 </para>
7175
7176 <para>
7177  <screen>
7178 # The status bar is for displaying link targets, not pointless blahblah
7179 #
7180 s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig</screen>
7181 </para>
7182
7183 <para>
7184  <literal>\s</literal> stands for whitespace characters (space, tab, newline,
7185  carriage return, form feed), so that <literal>\s*</literal> means: <quote>zero
7186  or more whitespace</quote>. The <literal>?</literal> in <literal>.*?</literal>
7187  makes this matching of arbitrary text ungreedy. (Note that the <literal>U</literal>
7188  option is not set). The <literal>['"]</literal> construct means: <quote>a single
7189  <emphasis>or</emphasis> a double quote</quote>. Finally, <literal>\1</literal> is
7190  a back-reference to the first parenthesis just like <literal>$1</literal> above,
7191  with the difference that in the <emphasis>pattern</emphasis>, a backslash indicates
7192  a back-reference, whereas in the <emphasis>substitute</emphasis>, it's the dollar.
7193 </para>
7194
7195 <para>
7196  So what does this job do? It replaces assignments of single- or double-quoted
7197  strings to the <quote>window.status</quote> object with a dummy assignment
7198  (using a variable name that is hopefully odd enough not to conflict with
7199  real variables in scripts). Thus, it catches many cases where e.g. pointless
7200  descriptions are displayed in the status bar instead of the link target when
7201  you move your mouse over links.
7202 </para>
7203
7204 <para>
7205  <screen>
7206 # Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
7207 #
7208 s/(&lt;body [^&gt;]*)onunload(.*&gt;)/$1never$2/iU</screen>
7209 </para>
7210
7211 <para>
7212  Including the
7213  <ulink url="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-eventgroupings-htmlevents">OnUnload
7214  event binding</ulink> in the HTML DOM was a <emphasis>CRIME</emphasis>.
7215  When I close a browser window, I want it to close and die. Basta.
7216  This job replaces the <quote>onunload</quote> attribute in
7217  <quote>&lt;body&gt</quote> tags with the dummy word <literal>never</literal>.
7218  Note that the <literal>i</literal> option makes the pattern matching
7219  case-insensitive. Also note that ungreedy matching alone doesn't always guarantee
7220  a minimal match: In the first parenthesis, we had to use <literal>[^&gt;]*</literal>
7221  instead of <literal>.*</literal> to prevent the match from exceeding the 
7222  &lt;body&gt tag if it doesn't contain <quote>OnUnload</quote>, but the page's
7223  content does.
7224 </para>
7225
7226 <para>
7227  The last example is from the fun department:
7228 </para>
7229
7230 <para>
7231  <screen>
7232 FILTER: fun Fun text replacements
7233
7234 # Spice the daily news:
7235 #
7236 s/microsoft(?!\.com)/MicroSuck/ig</screen>
7237 </para>
7238
7239 <para>
7240  Note the <literal>(?!\.com)</literal> part (a so-called negative lookahead)
7241  in the job's pattern, which means: Don't match, if the string 
7242  <quote>.com</quote> appears directly following <quote>microsoft</quote>
7243  in the page. This prevents links to microsoft.com from being trashed, while
7244  still replacing the word everywhere else.
7245 </para>
7246
7247 <para>
7248  <screen>
7249 # Buzzword Bingo (example for extended regex syntax)
7250 #
7251 s* industry[ -]leading \
7252 |  cutting[ -]edge \
7253 |  customer[ -]focused \
7254 |  market[ -]driven \
7255 |  award[ -]winning # Comments are OK, too! \
7256 |  high[ -]performance \
7257 |  solutions[ -]based \
7258 |  unmatched \
7259 |  unparalleled \
7260 |  unrivalled \
7261 *&lt;font color="red"&gt;&lt;b&gt;BINGO!&lt;/b&gt;&lt;/font&gt; \
7262 *igx</screen>
7263 </para>
7264
7265 <para>
7266  The <literal>x</literal> option in this job turns on extended syntax, and allows for
7267  e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting. 
7268 </para>
7269
7270 <para>
7271  You get the idea?
7272 </para>
7273 </sect2>
7274
7275 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
7276
7277 <sect2 id="predefined-filters"><title>The Pre-defined Filters</title>
7278
7279 <!-- 
7280
7281  Note each filter is also listed in the +filter action section above. Please
7282  keep these listings in sync.
7283  
7284 -->
7285
7286 <para>
7287 The distribution <filename>default.filter</filename> file contains a selection of
7288 pre-defined filters for your convenience:
7289 </para>
7290
7291 <variablelist>
7292  <varlistentry>
7293   <term><emphasis>js-annoyances</emphasis></term>
7294   <listitem>
7295    <para>
7296     The purpose of this filter is to get rid of particularly annoying JavaScript abuse.
7297     To that end, it
7298    <itemizedlist>
7299     <listitem>
7300      <para>
7301       replaces JavaScript references to the browser's referrer information
7302       with the string "Not Your Business!". This compliments the <literal><link
7303       linkend="hide-referrer">hide-referrer</link></literal> action on the content level.
7304      </para>
7305     </listitem>
7306     <listitem>
7307      <para>
7308       removes the bindings to the DOM's
7309       <ulink url="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-eventgroupings-htmlevents">unload
7310       event</ulink> which we feel has no right to exist and is responsible for most <quote>exit consoles</quote>, i.e.
7311       nasty windows that pop up when you close another one.
7312      </para>
7313     </listitem>
7314     <listitem>
7315      <para>
7316       removes code that causes new windows to be opened with undesired properties, such as being
7317       full-screen, non-resizeable, without location, status or menu bar etc.
7318      </para>
7319     </listitem>
7320    </itemizedlist>
7321    </para>
7322    <para>
7323     Use with caution. This is an aggressive filter, and can break sites that 
7324     rely heavily on JavaScript.
7325    </para>
7326   </listitem>
7327  </varlistentry>
7328  
7329  <varlistentry>
7330   <term><emphasis>js-events</emphasis></term>
7331   <listitem>
7332    <para>
7333     This is a very radical measure. It removes virtually all JavaScript event bindings, which
7334     means that scripts can not react to user actions such as mouse movements or clicks, window
7335     resizing etc, anymore. Use with caution!
7336    </para>
7337    <para>
7338     We <emphasis>strongly discourage</emphasis> using this filter as a default since it breaks
7339     many legitimate scripts. It is meant for use only on extra-nasty sites (should you really
7340     need to go there).
7341    </para>
7342   </listitem>
7343  </varlistentry>
7344
7345 <varlistentry>
7346   <term><emphasis>html-annoyances</emphasis></term>
7347   <listitem>
7348    <para>
7349     This filter will undo many common instances of HTML based abuse.
7350    </para>
7351    <para>
7352     The <literal>BLINK</literal> and <literal>MARQUEE</literal> tags 
7353     are neutralized (yeah baby!), and browser windows will be created as
7354     resizeable (as of course they should be!), and will have location,
7355     scroll and menu bars -- even if specified otherwise.
7356    </para>
7357   </listitem>
7358  </varlistentry>
7359
7360  <varlistentry>
7361   <term><emphasis>content-cookies</emphasis></term>
7362   <listitem>
7363    <para>
7364     Most cookies are set in the HTTP dialog, where they can be intercepted
7365     by the
7366     <literal><link linkend="crunch-incoming-cookies">crunch-incoming-cookies</link></literal>
7367     and <literal><link linkend="crunch-outgoing-cookies">crunch-outgoing-cookies</link></literal>
7368     actions. But web sites increasingly make use of HTML meta tags and JavaScript
7369     to sneak cookies to the browser on the content level.
7370    </para>
7371    <para>
7372     This filter disables most HTML and JavaScript code that reads or sets
7373     cookies. It cannot detect all clever uses of these types of code, so it 
7374     should not be relied on as an absolute fix. Use it wherever you would also
7375     use the cookie crunch actions. 
7376    </para>
7377   </listitem>
7378  </varlistentry>
7379
7380  <varlistentry>
7381   <term><emphasis>refresh tags</emphasis></term>
7382   <listitem>
7383    <para>
7384     Disable any refresh tags if the interval is greater than nine seconds (so 
7385     that redirections done via refresh tags are not destroyed). This is useful 
7386     for dial-on-demand setups, or for those who find this HTML feature
7387     annoying.
7388    </para>
7389   </listitem>
7390  </varlistentry>
7391
7392  <varlistentry>
7393   <term><emphasis>unsolicited-popups</emphasis></term>
7394   <listitem>
7395    <para>
7396     This filter attempts to prevent only <quote>unsolicited</quote> pop-up 
7397     windows from opening, yet still allow pop-up windows that the user 
7398     has explicitly chosen to open. It was added in version 3.0.1, 
7399     as an improvement over earlier such filters.
7400    </para>
7401    <para>
7402     Technical note: The filter works by redefining the window.open JavaScript
7403     function to a dummy function, <literal>PrivoxyWindowOpen()</literal>,
7404     during the loading and rendering phase of each HTML page access, and
7405     restoring the function afterward.
7406    </para>
7407    <para>
7408     This is recommended only for browsers that cannot perform this function
7409     reliably themselves. And be aware that some sites require such windows 
7410     in order to function normally. Use with caution.
7411    </para>
7412   </listitem>
7413  </varlistentry>
7414
7415  <varlistentry>
7416   <term><emphasis>all-popups</emphasis></term>
7417   <listitem>
7418    <para>
7419     Attempt to prevent <emphasis>all</emphasis> pop-up windows from opening.
7420     Note this should be used with even more discretion than the above, since
7421     it is more likely to break some sites that require pop-ups for normal
7422     usage. Use with caution.
7423    </para>
7424   </listitem>
7425  </varlistentry>
7426
7427  <varlistentry>
7428   <term><emphasis>img-reorder</emphasis></term>
7429   <listitem>
7430    <para>
7431     This is a helper filter that has no value if used alone. It makes the
7432     <literal>banners-by-size</literal> and <literal>banners-by-link</literal>
7433     (see below) filters more effective and should be enabled together with them.
7434    </para>
7435   </listitem>
7436  </varlistentry>
7437
7438  <varlistentry>
7439   <term><emphasis>banners-by-size</emphasis></term>
7440   <listitem>
7441    <para>
7442     This filter removes image tags purely based on what size they are. Fortunately 
7443     for us, many ads and banner images tend to conform to certain standardized
7444     sizes, which makes this filter quite effective for ad stripping purposes.
7445    </para>
7446    <para>
7447     Occasionally this filter will cause false positives on images that are not ads,
7448     but just happen to be of one of the standard banner sizes.
7449    </para>
7450    <para>
7451     Recommended only for those who require extreme ad blocking. The default 
7452     block rules should catch 95+% of all ads <emphasis>without</emphasis> this filter enabled.
7453    </para>
7454   </listitem>
7455  </varlistentry>
7456
7457  <varlistentry>
7458   <term><emphasis>banners-by-link</emphasis></term>
7459   <listitem>
7460    <para>
7461     This is an experimental filter that attempts to kill any banners if 
7462     their URLs seem to point to known or suspected click trackers. It is currently
7463     not of much value and is not recommended for use by default.
7464    </para>
7465   </listitem>
7466  </varlistentry>
7467
7468  <varlistentry>
7469   <term><emphasis>webbugs</emphasis></term>
7470   <listitem>
7471    <para>
7472     Webbugs are small, invisible images (technically 1X1 GIF images), that 
7473     are used to track users across websites, and collect information on them.
7474     As an HTML page is loaded by the browser, an embedded image tag causes the
7475     browser to contact a third-party site, disclosing the tracking information
7476     through the requested URL and/or cookies for that third-party domain, without
7477     the user ever becoming aware of the interaction with the third-party site.
7478     HTML-ized spam also uses a similar technique to verify email addresses.
7479    </para>
7480    <para>
7481     This filter removes the HTML code that loads such <quote>webbugs</quote>.
7482    </para>
7483   </listitem>
7484  </varlistentry>
7485
7486  <varlistentry>
7487   <term><emphasis>tiny-textforms</emphasis></term>
7488   <listitem>
7489    <para>
7490     A rather special-purpose filter that can be used to enlarge textareas (those
7491     multi-line text boxes in web forms) and turn off hard word wrap in them. 
7492     It was written for the sourceforge.net tracker system where such boxes are
7493     a nuisance, but it can be handy on other sites, too.
7494    </para>
7495    <para>
7496     It is not recommended to use this filter as a default.
7497    </para>
7498   </listitem>
7499  </varlistentry>
7500
7501  <varlistentry>
7502   <term><emphasis>jumping-windows</emphasis></term>
7503   <listitem>
7504    <para>
7505     Many consider windows that move, or resize themselves to be abusive. This filter
7506     neutralizes the related JavaScript code. Note that some sites might not display
7507     or behave as intended when using this filter. Use with caution.
7508    </para>
7509   </listitem>
7510  </varlistentry>
7511
7512  <varlistentry>
7513   <term><emphasis>frameset-borders</emphasis></term>
7514   <listitem>
7515    <para>
7516     Some web designers seem to assume that everyone in the world will view their
7517     web sites using the same browser brand and version, screen resolution etc,
7518     because only that assumption could explain why they'd use static frame sizes,
7519     yet prevent their frames from being resized by the user, should they be too
7520     small to show their whole content.
7521    </para>
7522    <para>
7523     This filter removes the related HTML code. It should only be applied to sites
7524     which need it.
7525    </para>
7526   </listitem>
7527  </varlistentry>
7528
7529  <varlistentry>
7530   <term><emphasis>demoronizer</emphasis></term>
7531   <listitem>
7532    <para>
7533     Many Microsoft products that generate HTML use non-standard extensions (read:
7534     violations) of the ISO 8859-1 aka Latin-1 character set. This can cause those
7535     HTML documents to display with errors on standard-compliant platforms. 
7536    </para>
7537    <para>
7538     This filter translates the MS-only characters into Latin-1 equivalents. 
7539     It is not necessary when using MS products, and will cause corruption of  
7540     all documents that use 8-bit character sets other than Latin-1. It's mostly
7541     worthwhile for Europeans on non-MS platforms, if weird garbage characters
7542     sometimes appear on some pages, or user agents that don't correct for this on 
7543     the fly.
7544 <!--
7545     My version of Mozilla (ancient) shows litte square boxes for quote
7546     characters, and apostrophes on moronized pages. So many pages have this, I
7547     can read them fine now. HB 08/27/06
7548 --> 
7549    </para>
7550   </listitem>
7551  </varlistentry>
7552
7553  <varlistentry>
7554   <term><emphasis>shockwave-flash</emphasis></term>
7555   <listitem>
7556    <para>
7557     A filter for shockwave haters. As the name suggests, this filter strips code
7558     out of web pages that is used to embed shockwave flash objects. 
7559    </para>
7560    <para>
7561    </para>
7562   </listitem>
7563  </varlistentry>
7564
7565  <varlistentry>
7566   <term><emphasis>quicktime-kioskmode</emphasis></term>
7567   <listitem>
7568    <para>
7569     Change HTML code that embeds Quicktime objects so that kioskmode, which
7570     prevents saving, is disabled.
7571    </para>
7572   </listitem>
7573  </varlistentry>
7574
7575  <varlistentry>
7576   <term><emphasis>fun</emphasis></term>
7577   <listitem>
7578    <para>
7579     Text replacements for subversive browsing fun. Make fun of your favorite
7580     Monopolist or play buzzword bingo.
7581    </para>
7582   </listitem>
7583  </varlistentry>
7584
7585  <varlistentry>
7586   <term><emphasis>crude-parental</emphasis></term>
7587   <listitem>
7588    <para>
7589     A demonstration-only filter that shows how <application>Privoxy</application>
7590     can be used to delete web content on a keyword basis.
7591    </para>
7592   </listitem>
7593  </varlistentry>
7594
7595  <varlistentry>
7596   <term><emphasis>ie-exploits</emphasis></term>
7597   <listitem>
7598    <para>
7599     An experimental collection of text replacements to disable malicious HTML and JavaScript
7600     code that exploits known security holes in Internet Explorer.
7601    </para>
7602    <para>
7603     Presently, it only protects against Nimda and a cross-site scripting bug, and
7604     would need active maintenance to provide more substantial protection.
7605    </para>
7606   </listitem>
7607  </varlistentry>
7608
7609  <varlistentry>
7610   <term><emphasis>site-specifics</emphasis></term>
7611   <listitem>
7612    <para>
7613     Some web sites have very specific problems, the cure for which doesn't apply
7614     anywhere else, or could even cause damage on other sites.
7615    </para>
7616    <para>
7617     This is a collection of such site-specific cures which should only be applied
7618     to the sites they were intended for, which is what the supplied
7619     <filename>default.action</filename> file does. Users shouldn't need to change
7620     anything regarding this filter.
7621    </para>
7622   </listitem>
7623  </varlistentry>
7624
7625  <varlistentry>
7626   <term><emphasis>google</emphasis></term>
7627   <listitem>
7628    <para>
7629     A CSS based block for Google text ads. Also removes a width limitation
7630     and the toolbar advertisement.
7631    </para>
7632   </listitem>
7633  </varlistentry>
7634  
7635   <varlistentry>
7636   <term><emphasis>yahoo</emphasis></term>
7637   <listitem>
7638    <para>
7639     Another CSS based block, this time for Yahoo text ads. And removes 
7640     a width limitation as well.
7641    </para>
7642   </listitem>
7643  </varlistentry>
7644
7645   <varlistentry>
7646   <term><emphasis>msn</emphasis></term>
7647   <listitem>
7648    <para>
7649     Another CSS based block, this time for MSN text ads. And removes 
7650     tracking URLs, as well as a width limitation.
7651    </para>
7652   </listitem>
7653  </varlistentry>
7654
7655  <varlistentry>
7656   <term><emphasis>blogspot</emphasis></term>
7657   <listitem>
7658    <para>
7659     Cleans up some Blogspot blogs. Read the fine print before using this one!
7660    </para>
7661    <para>
7662     This filter also intentionally removes some navigation stuff and sets the
7663     page width to 100%. As a result, some rounded <quote>corners</quote> would
7664     appear to early or not at all and as fixing this would require a browser
7665     that understands background-size (CSS3), they are removed instead.
7666    </para>
7667   </listitem>
7668  </varlistentry>
7669
7670   <varlistentry>
7671   <term><emphasis>xml-to-html</emphasis></term>
7672   <listitem>
7673    <para>
7674     Server-header filter to change the Content-Type from xml to html.
7675    </para>
7676   </listitem>
7677  </varlistentry>
7678  
7679   <varlistentry>
7680   <term><emphasis>html-to-xml</emphasis></term>
7681   <listitem>
7682    <para>
7683     Server-header filter to change the Content-Type from html to xml.
7684    </para>
7685   </listitem>
7686  </varlistentry>
7687
7688   <varlistentry>
7689   <term><emphasis>no-ping</emphasis></term>
7690   <listitem>
7691    <para>
7692     Removes the non-standard <literal>ping</literal> attribute from
7693     anchor and area HTML tags.
7694    </para>
7695   </listitem>
7696  </varlistentry>
7697
7698   <varlistentry>
7699   <term><emphasis>hide-tor-exit-notation</emphasis></term>
7700   <listitem>
7701    <para>
7702     Client-header filter to remove the <command>Tor</command> exit node notation
7703     found in Host and Referer headers.
7704    </para>
7705    <para>
7706     If &my-app; and <command>Tor</command> are chained and &my-app;
7707     is configured to use socks4a, one can use <quote>http://www.example.org.foobar.exit/</quote>
7708     to access the host <quote>www.example.org</quote> through the
7709     <command>Tor</command> exit node <quote>foobar</quote>.
7710    </para>
7711    <para>
7712     As the HTTP client isn't aware of this notation, it treats the
7713     whole string <quote>www.example.org.foobar.exit</quote> as host and uses it
7714     for the <quote>Host</quote> and <quote>Referer</quote> headers. From the
7715     server's point of view the resulting headers are invalid and can cause problems.
7716    </para>
7717    <para>
7718     An invalid <quote>Referer</quote> header can trigger <quote>hot-linking</quote>
7719     protections, an invalid <quote>Host</quote> header will make it impossible for
7720     the server to find the right vhost (several domains hosted on the same IP address).
7721    </para>
7722    <para>
7723     This client-header filter removes the <quote>foo.exit</quote> part in those headers
7724     to prevent the mentioned problems. Note that it only modifies
7725     the HTTP headers, it doesn't make it impossible for the server
7726     to detect your <command>Tor</command> exit node based on the IP address
7727     the request is coming from.
7728    </para>
7729   </listitem>
7730  </varlistentry>
7731
7732 <!--
7733  <varlistentry>
7734   <term><emphasis> </emphasis></term>
7735   <listitem>
7736    <para>
7737    </para>
7738    <para>
7739    </para>
7740   </listitem>
7741  </varlistentry>
7742 -->
7743 </variablelist>
7744
7745 </sect2>
7746 </sect1>
7747
7748 <!--  ~  End section  ~  -->
7749
7750
7751
7752 <!--   ~~~~~       New section      ~~~~~     -->
7753
7754 <sect1 id="templates">
7755 <title>Privoxy's Template Files</title>
7756 <para>
7757  All <application>Privoxy</application> built-in pages, i.e. error pages such as the 
7758  <ulink url="http://show-the-404-error.page"><quote>404 - No Such Domain</quote>
7759  error page</ulink>, the <ulink
7760  url="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"><quote>BLOCKED</quote>
7761  page</ulink>
7762  and all pages of its <ulink url="http://config.privoxy.org/">web-based
7763  user interface</ulink>, are generated from <emphasis>templates</emphasis>. 
7764  (<application>Privoxy</application> must be running for the above links to work as
7765  intended.)
7766 </para>
7767
7768 <para>
7769  These templates are stored in a subdirectory of the <link linkend="confdir">configuration
7770  directory</link> called <filename>templates</filename>. On Unixish platforms,
7771  this is typically
7772  <ulink url="file:///etc/privoxy/templates/"><filename>/etc/privoxy/templates/</filename></ulink>.
7773 </para>
7774
7775 <para>
7776  The templates are basically normal HTML files, but with place-holders (called symbols
7777  or exports), which <application>Privoxy</application> fills at run time. You can
7778  edit the templates with a normal text editor, should you want to customize them.
7779  (<emphasis>Not recommended for the casual user</emphasis>). Note that
7780  just like in configuration files, lines starting with <literal>#</literal> are
7781  ignored when the templates are filled in.
7782 </para>
7783
7784 <para>
7785  The place-holders are of the form <literal>@name@</literal>, and you will
7786  find a list of available symbols, which vary from template to template,
7787  in the comments at the start of each file. Note that these comments are not
7788  always accurate, and that it's probably best to look at the existing HTML
7789  code to find out which symbols are supported and what they are filled in with.
7790 </para>
7791
7792 <para>
7793  A special application of this substitution mechanism is to make whole
7794  blocks of HTML code disappear when a specific symbol is set. We use this
7795  for many purposes, one of them being to include the beta warning in all
7796  our user interface (CGI) pages when <application>Privoxy</application>
7797  is in an alpha or beta development stage:
7798 </para>
7799
7800 <para>
7801  <screen>
7802 &lt;!-- @if-unstable-start --&gt;
7803
7804   ... beta warning HTML code goes here ...
7805
7806 &lt;!-- if-unstable-end@ --&gt;</screen>
7807 </para>
7808
7809 <para>
7810  If the "unstable" symbol is set, everything in between and including
7811  <literal>@if-unstable-start</literal> and <literal>if-unstable-end@</literal>
7812  will disappear, leaving nothing but an empty comment:
7813 </para>
7814
7815 <para>
7816  <screen>&lt;!--  --&gt;</screen>
7817 </para>
7818
7819 <para>
7820  There's also an if-then-else construct and an <literal>#include</literal>
7821  mechanism, but you'll sure find out if you are inclined to edit the
7822  templates ;-)
7823 </para>
7824
7825 <para>
7826  All templates refer to a style located at
7827  <ulink url="http://config.privoxy.org/send-stylesheet"><literal>http://config.privoxy.org/send-stylesheet</literal></ulink>.
7828  This is, of course, locally served by <application>Privoxy</application>
7829  and the source for it can be found and edited in the
7830  <filename>cgi-style.css</filename> template.
7831 </para>
7832
7833 </sect1>
7834
7835 <!--  ~  End section  ~  -->
7836
7837
7838
7839 <!--   ~~~~~       New section      ~~~~~     -->
7840
7841 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
7842 Requests</title>
7843
7844 <!-- Include contacting.sgml boilerplate: -->
7845  &contacting;
7846 <!-- end boilerplate -->
7847
7848 </sect1>
7849
7850 <!--  ~  End section  ~  -->
7851
7852
7853 <!--   ~~~~~       New section      ~~~~~     -->
7854 <sect1 id="copyright"><title>Privoxy Copyright, License and History</title>
7855
7856 <!-- Include copyright.sgml: -->
7857  &copyright;
7858 <!-- end copyright -->
7859
7860 <!--   ~~~~~       New section      ~~~~~     -->
7861 <sect2><title>License</title>
7862 <!-- Include copyright.sgml: -->
7863  &license;
7864 <!-- end copyright -->
7865 </sect2>
7866 <!--  ~  End section  ~  -->
7867
7868
7869 <!--   ~~~~~       New section      ~~~~~     -->
7870
7871 <sect2 id="history"><title>History</title>
7872 <!-- Include history.sgml: -->
7873  &history;
7874 <!-- end history -->
7875 </sect2>
7876
7877 <sect2 id="authors"><title>Authors</title>
7878 <!-- Include p-authors.sgml: -->
7879  &p-authors;
7880 <!-- end authors -->
7881 </sect2>
7882
7883 </sect1>
7884
7885 <!--  ~  End section  ~  -->
7886
7887
7888 <!--   ~~~~~       New section      ~~~~~     -->
7889 <sect1 id="seealso"><title>See Also</title>
7890 <!-- Include seealso.sgml: -->
7891  &seealso;
7892 <!-- end seealso -->
7893 </sect1>
7894
7895
7896
7897 <!--   ~~~~~       New section      ~~~~~     -->
7898 <sect1 id="appendix"><title>Appendix</title>
7899
7900
7901 <!--   ~~~~~       New section      ~~~~~     -->
7902 <sect2 id="regex">
7903 <title>Regular Expressions</title>
7904 <para>
7905  <application>Privoxy</application> uses Perl-style <quote>regular
7906  expressions</quote> in its <link linkend="actions-file">actions
7907  files</link> and <link linkend="filter-file">filter file</link>,
7908  through the <ulink url="http://www.pcre.org/">PCRE</ulink> and
7909 <!-- 
7910  dead 08/27/06
7911  <ulink url="http://www.oesterhelt.org/pcrs/">PCRS</ulink> libraries.
7912 -->
7913  <application>PCRS</application> libraries.
7914 </para>
7915
7916 <para>
7917  If you are reading this, you probably don't understand what <quote>regular
7918  expressions</quote> are, or what they can do. So this will be a very brief
7919  introduction only. A full explanation would require a <ulink
7920  url="http://www.oreilly.com/catalog/regex/">book</ulink> ;-)
7921 </para>
7922
7923 <para>
7924  Regular expressions provide a language to describe patterns that can be
7925  run against strings of characters (letter, numbers, etc), to see if they
7926  match the string or not. The  patterns are themselves (sometimes complex)
7927  strings of literal characters, combined with  wild-cards, and other special
7928  characters, called meta-characters. The <quote>meta-characters</quote> have
7929  special meanings and are used to build complex patterns to be matched against.
7930  Perl Compatible Regular Expressions are an especially convenient
7931  <quote>dialect</quote> of the regular expression language.
7932 </para>
7933
7934 <para>
7935  To make a simple analogy, we do something similar when we use wild-card
7936  characters when listing files with the <command>dir</command> command in DOS. 
7937  <literal>*.*</literal> matches all filenames. The <quote>special</quote>
7938  character here is the asterisk which matches any and all characters. We can be
7939  more specific and use <literal>?</literal> to match just individual
7940  characters. So <quote>dir file?.text</quote> would match
7941  <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
7942  matching, using a similar technique to <quote>regular expressions</quote>!
7943 </para>
7944
7945 <para>
7946  Regular expressions do essentially the same thing, but are much, much more
7947  powerful. There are many more <quote>special characters</quote> and ways of 
7948  building complex patterns however. Let's look at a few of the common ones,
7949  and then some examples:
7950 </para>
7951
7952 <para><simplelist>
7953  <member>
7954   <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
7955   <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
7956  </member>
7957 </simplelist></para>
7958
7959 <para><simplelist>
7960  <member>
7961   <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
7962   times. Either/or.
7963  </member>
7964 </simplelist></para>
7965
7966 <para><simplelist>
7967  <member>
7968   <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
7969   times.
7970  </member>
7971 </simplelist></para>
7972
7973 <para><simplelist>
7974  <member>
7975   <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
7976   times.
7977  </member>
7978 </simplelist></para>
7979
7980 <para><simplelist>
7981  <member>
7982   <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
7983   the following character should be taken literally. This is used where one of the 
7984   special characters (e.g. <quote>.</quote>) needs to be taken literally and
7985   not as a special meta-character. Example: <quote>example\.com</quote>, makes 
7986   sure the period is recognized only as a period (and not expanded to its 
7987   meta-character meaning of any single character).
7988  </member>
7989 </simplelist></para>
7990
7991 <para><simplelist>
7992  <member>
7993   <emphasis>[ ]</emphasis> - Characters enclosed in brackets will be matched if
7994   any of the enclosed characters are encountered. For instance, <quote>[0-9]</quote>
7995   matches any numeric digit (zero through nine). As an example, we can combine 
7996   this with <quote>+</quote> to match any digit one of more times: <quote>[0-9]+</quote>.
7997  </member>
7998 </simplelist></para>
7999
8000 <para><simplelist>
8001  <member>
8002   <emphasis>( )</emphasis> - parentheses are used to group a sub-expression,
8003   or multiple sub-expressions.
8004  </member>
8005 </simplelist></para>
8006
8007 <para><simplelist>
8008  <member>
8009   <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
8010   <quote>or</quote> conditional statement. A match is successful if the
8011   sub-expression on either side of <quote>|</quote> matches. As an example:
8012   <quote>/(this|that) example/</quote> uses grouping and the bar character 
8013   and would match either <quote>this example</quote> or <quote>that
8014   example</quote>, and nothing else.
8015  </member>
8016 </simplelist></para>
8017
8018 <para>
8019  These are just some of the ones you are likely to use when matching URLs with 
8020  <application>Privoxy</application>, and is a long way from a definitive
8021  list. This is enough to get us started with a few simple examples which may
8022  be more illuminating:
8023 </para>
8024
8025 <para>
8026  <emphasis><literal>/.*/banners/.*</literal></emphasis> - A  simple example
8027  that uses the common combination of <quote>.</quote> and <quote>*</quote> to 
8028  denote any character, zero or more times. In other words, any string at all.
8029  So we start with a literal forward slash, then our regular expression pattern 
8030  (<quote>.*</quote>) another literal forward slash, the string
8031  <quote>banners</quote>, another forward slash, and lastly another
8032  <quote>.*</quote>. We are building 
8033  a directory path here. This will match any file with the path that has a
8034  directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
8035  any characters, and this could conceivably be more forward slashes, so it
8036  might expand into a much longer looking path. For example, this could match:
8037  <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
8038  <quote>/banners/annoying.html</quote>, or almost an infinite number of other
8039  possible combinations, just so it has <quote>banners</quote> in the path
8040  somewhere.
8041 </para>
8042
8043 <para>
8044  And now something a little more complex:
8045 </para>
8046
8047 <para>
8048  <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> - 
8049  We have several literal forward slashes again (<quote>/</quote>), so we are
8050  building another expression that is a file path statement. We have another 
8051  <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
8052  it matches our expression. The only true literal that <emphasis>must
8053  match</emphasis> our pattern is <application>adv</application>, together with
8054  the forward slashes. What comes after the <quote>adv</quote> string is the
8055  interesting part. 
8056 </para>
8057
8058 <para>
8059  Remember the <quote>?</quote> means the preceding expression (either a
8060  literal character or anything grouped with <quote>(...)</quote> in this case)
8061  can exist or not, since this means either zero or one match. So
8062  <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
8063  individual sub-expressions: <quote>(er)</quote>,
8064  <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
8065  means <quote>or</quote>. We have two of those. For instance, 
8066  <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote> 
8067  <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
8068  attempt at matching as many variations of <quote>advertisement</quote>, and 
8069  similar, as possible. So this would expand to match just <quote>adv</quote>,
8070  or <quote>advert</quote>, or <quote>adverts</quote>, or
8071  <quote>advertising</quote>, or <quote>advertisement</quote>, or
8072  <quote>advertisements</quote>. You get the idea. But it would not match 
8073  <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
8074  changing our regular expression to: 
8075  <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
8076  either spelling.
8077 </para>
8078
8079 <para>
8080  <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again 
8081  another path statement with forward slashes. Anything in the square brackets 
8082  <quote>[ ]</quote> can be matched. This is using <quote>0-9</quote> as a
8083  shorthand expression to mean any digit one through nine. It is the same as
8084  saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
8085  means one or more of the preceding expression must be included. The preceding 
8086  expression here is what is in the square brackets -- in this case, any digit 
8087  one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>. 
8088  This includes a <quote>|</quote>, so this needs to match the expression on
8089  either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
8090  side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
8091  since the <quote>?</quote> means the letter <quote>e</quote> is optional and
8092  can be matched once or not at all. So we are building an expression here to
8093  match image GIF or JPEG type image file. It must include the literal
8094  string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
8095  (which is now a literal, and not a special character, since it is escaped
8096  with <quote>\</quote>), and lastly either <quote>gif</quote>, or
8097  <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
8098  include: <quote>//advert1.jpg</quote>,
8099  <quote>/nasty/ads/advert1234.gif</quote>,
8100  <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
8101  <quote>advert1.gif</quote> (no leading slash), or
8102  <quote>/adverts232.jpg</quote> (the expression does not include an
8103  <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
8104  in the expression anywhere).
8105 </para>
8106
8107 <para>
8108  We are barely scratching the surface of regular expressions here so that you
8109  can understand the default <application>Privoxy</application>
8110  configuration files, and maybe use this knowledge to customize your own
8111  installation. There is much, much more that can be done with regular
8112  expressions. Now that you know enough to get started, you can learn more on
8113  your own :/
8114 </para>
8115
8116 <para>
8117  More reading on Perl Compatible Regular expressions: 
8118  <ulink url="http://perldoc.perl.org/perlre.html">http://perldoc.perl.org/perlre.html</ulink>
8119 </para>
8120
8121 <para>
8122  For information on regular expression based substitutions and their applications
8123  in filters, please see the <link linkend="filter-file">filter file tutorial</link>
8124  in this manual.
8125 </para>
8126 </sect2>
8127
8128 <!--  ~  End section  ~  -->
8129
8130
8131 <!--   ~~~~~       New section      ~~~~~     -->
8132 <sect2>
8133 <title>Privoxy's Internal Pages</title>
8134
8135 <para>
8136  Since <application>Privoxy</application> proxies each requested 
8137  web page, it is easy for <application>Privoxy</application> to 
8138  trap certain special URLs. In this way, we can talk directly to
8139  <application>Privoxy</application>, and see how it is 
8140  configured, see how our rules are being applied, change these 
8141  rules and other configuration options, and even turn
8142  <application>Privoxy's</application> filtering off, all with 
8143  a web browser.
8144
8145 </para>
8146
8147 <para>
8148  The URLs listed below are the special ones that allow direct access 
8149  to <application>Privoxy</application>. Of course,
8150  <application>Privoxy</application> must be running to access these. If 
8151  not, you will get a friendly error message. Internet access is not 
8152  necessary either.
8153 </para>
8154
8155 <para>
8156  <itemizedlist>
8157
8158  <listitem>
8159   <para>  
8160    Privoxy main page: 
8161   </para>
8162   <blockquote>
8163    <para> 
8164      <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
8165    </para>
8166   </blockquote>
8167   <para>
8168    There is a shortcut: <ulink url="http://p.p/">http://p.p/</ulink> (But it
8169    doesn't provide a fall-back to a real page, in case the request is not
8170    sent through <application>Privoxy</application>)
8171   </para>
8172  </listitem>
8173
8174  <listitem>
8175   <para>  
8176     Show information about the current configuration, including viewing and 
8177     editing of actions files:
8178   </para>
8179    <blockquote>
8180    <para> 
8181     <ulink url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
8182    </para>
8183   </blockquote>
8184  </listitem>
8185  
8186  <listitem>
8187   <para>  
8188     Show the source code version numbers:
8189   </para>
8190   <blockquote>
8191    <para> 
8192     <ulink url="http://config.privoxy.org/show-version">http://config.privoxy.org/show-version</ulink>
8193    </para>
8194   </blockquote>
8195  </listitem>
8196  
8197  <listitem>
8198   <para>  
8199    Show the browser's request headers:
8200   </para>
8201   <blockquote>
8202    <para> 
8203     <ulink url="http://config.privoxy.org/show-request">http://config.privoxy.org/show-request</ulink>
8204    </para>
8205   </blockquote>
8206  </listitem>
8207  
8208  <listitem>
8209   <para>  
8210    Show which actions apply to a URL and why:
8211   </para>
8212    <blockquote>
8213    <para> 
8214     <ulink url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>
8215    </para>
8216   </blockquote>
8217  </listitem>
8218  
8219  <listitem>
8220   <para>  
8221    Toggle Privoxy on or off. In this case, <quote>Privoxy</quote> continues 
8222    to run, but only as a pass-through proxy, with no actions taking place:
8223   </para>
8224    <blockquote>
8225    <para> 
8226     <ulink url="http://config.privoxy.org/toggle">http://config.privoxy.org/toggle</ulink>
8227    </para>
8228   </blockquote>
8229   <para>
8230    Short cuts. Turn off, then on: 
8231   </para>
8232    <blockquote>
8233    <para> 
8234      <ulink url="http://config.privoxy.org/toggle?set=disable">http://config.privoxy.org/toggle?set=disable</ulink>
8235    </para>
8236   </blockquote>
8237    <blockquote>
8238    <para> 
8239      <ulink url="http://config.privoxy.org/toggle?set=enable">http://config.privoxy.org/toggle?set=enable</ulink>
8240    </para>
8241   </blockquote>
8242  </listitem>
8243  
8244  </itemizedlist>
8245 </para>
8246
8247 <para>
8248  These may be bookmarked for quick reference. See next.
8249
8250 </para>
8251
8252 <sect3 id="bookmarklets">
8253 <title>Bookmarklets</title>
8254 <para>
8255  Below are some <quote>bookmarklets</quote> to allow you to easily access a
8256  <quote>mini</quote> version of some of <application>Privoxy's</application>
8257  special pages. They are designed for MS Internet Explorer, but should work
8258  equally well in Netscape, Mozilla, and other browsers which support
8259  JavaScript. They are designed to run directly from your bookmarks - not by
8260  clicking the links below (although that should work for testing).
8261 </para>
8262 <para>
8263  To save them, right-click the link and choose <quote>Add to Favorites</quote>
8264  (IE) or <quote>Add Bookmark</quote> (Netscape). You will get a warning that
8265  the bookmark <quote>may not be safe</quote> - just click OK. Then you can run the
8266  Bookmarklet directly from your favorites/bookmarks. For even faster access,
8267  you can put them on the <quote>Links</quote> bar (IE) or the <quote>Personal
8268  Toolbar</quote> (Netscape), and run them with a single click. 
8269 </para>
8270
8271 <para>
8272  <itemizedlist>
8273
8274   <listitem>
8275    <para>
8276     <ulink
8277     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=enabled','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Enable</ulink>
8278    </para>
8279   </listitem> 
8280
8281   <listitem>
8282    <para>
8283     <ulink
8284     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=disabled','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Disable</ulink>
8285    </para>
8286   </listitem> 
8287
8288   <listitem>
8289    <para>
8290     <ulink
8291     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=toggle','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Toggle Privoxy</ulink> (Toggles between enabled and disabled)
8292    </para>
8293   </listitem> 
8294
8295   <listitem>
8296    <para>
8297     <ulink
8298     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y','ijbstatus','width=250,height=2,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy- View Status</ulink>
8299    </para>
8300   </listitem> 
8301 <!--
8302   <listitem>
8303    <para>
8304     <ulink url="javascript:w=Math.floor(screen.width/2);h=Math.floor(screen.height*0.9);void(window.open('http://www.privoxy.org/actions/index.php?url='+escape(location.href),'Feedback','screenx='+w+',width='+w+',height='+h+',scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Submit Actions File Feedback</ulink>
8305    </para>
8306   </listitem> 
8307  --> 
8308   <listitem>
8309    <para>
8310     <ulink url="javascript:void(window.open('http://config.privoxy.org/show-url-info?url='+escape(location.href),'Why').focus());">Privoxy - Why?</ulink>
8311    </para>
8312   </listitem> 
8313  </itemizedlist>
8314 </para>
8315
8316 <para>
8317  Credit: The site which gave us the general idea for these bookmarklets is
8318  <ulink url="http://www.bookmarklets.com/">www.bookmarklets.com</ulink>. They
8319  have more information about bookmarklets. 
8320 </para>
8321
8322
8323 </sect3>
8324
8325 </sect2>
8326
8327
8328 <!--   ~~~~~       New section      ~~~~~     -->
8329 <sect2 id="chain">
8330 <title>Chain of Events</title>
8331 <para>
8332  Let's take a quick look at how some of <application>Privoxy's</application> 
8333  core features are triggered, and the ensuing sequence of events when a web
8334  page is requested by your browser:
8335 </para>
8336
8337 <para>
8338  <itemizedlist>
8339  <listitem>
8340   <para>
8341    First, your web browser requests a web page. The browser knows to send 
8342    the request to <application>Privoxy</application>, which will in turn, 
8343    relay the request to the remote web server after passing the following 
8344    tests: 
8345   </para>
8346  </listitem> 
8347  <listitem>
8348   <para>
8349    <application>Privoxy</application> traps any request for its own internal CGI 
8350    pages (e.g <ulink url="http://p.p/">http://p.p/</ulink>) and sends the CGI page back to the browser.
8351   </para>
8352  </listitem> 
8353  <listitem>
8354   <para>
8355    Next, <application>Privoxy</application> checks to see if the URL 
8356    matches any <link
8357    linkend="BLOCK"><quote>+block</quote></link> patterns. If
8358    so, the URL is then blocked, and the remote web server will not be contacted.
8359    <link linkend="HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></link> 
8360    and 
8361    <link linkend="HANDLE-AS-EMPTY-DOCUMENT"><quote>+handle-as-empty-document</quote></link>
8362    are then checked, and if there is no match, an 
8363    HTML <quote>BLOCKED</quote> page is sent back to the browser. Otherwise, if
8364    it does match, an image is returned for the former, and an empty text
8365    document for the latter. The type of image would depend on the setting of
8366    <link linkend="SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></link>
8367    (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere).
8368   </para>
8369  </listitem> 
8370  <listitem>
8371   <para>
8372    Untrusted URLs are blocked. If URLs are being added to the
8373    <filename>trust</filename> file, then that is done.
8374   </para>
8375  </listitem> 
8376  <listitem>
8377   <para>
8378    If the URL pattern matches the <link
8379    linkend="FAST-REDIRECTS"><quote>+fast-redirects</quote></link> action,
8380    it is then processed. Unwanted parts of the requested URL are stripped.
8381   </para>
8382  </listitem> 
8383  <listitem>
8384   <para>
8385    Now the rest of the client browser's request headers are processed. If any
8386    of these match any of the relevant actions (e.g. <link
8387    linkend="HIDE-USER-AGENT"><quote>+hide-user-agent</quote></link>,
8388    etc.), headers are suppressed or forged as determined by these actions and
8389    their parameters.
8390   </para>
8391  </listitem> 
8392  <listitem>
8393   <para>
8394    Now the web server starts sending its response back (i.e. typically a web
8395    page).
8396   </para>
8397  </listitem> 
8398  <listitem>
8399   <para>
8400    First, the server headers are read and processed to determine, among other
8401    things, the MIME type (document type) and encoding. The headers are then
8402    filtered as determined by the 
8403    <link linkend="CRUNCH-INCOMING-COOKIES"><quote>+crunch-incoming-cookies</quote></link>,
8404    <link linkend="SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></link>,
8405    and <link linkend="DOWNGRADE-HTTP-VERSION"><quote>+downgrade-http-version</quote></link>
8406    actions.
8407   </para>
8408  </listitem> 
8409  <listitem>
8410   <para>
8411    If the <link linkend="KILL-POPUPS"><quote>+kill-popups</quote></link>
8412    action applies, and it is an HTML or JavaScript document, the popup-code in the
8413    response is filtered on-the-fly as it is received.
8414   </para>
8415  </listitem> 
8416  <listitem>
8417   <para>
8418    If any <link linkend="FILTER"><quote>+filter</quote></link> action
8419    or <link
8420    linkend="DEANIMATE-GIFS"><quote>+deanimate-gifs</quote></link>
8421    action applies (and the document type fits the action), the rest of the page is
8422    read into memory (up to a configurable limit). Then the filter rules (from
8423    <filename>default.filter</filename> and any other filter files) are
8424    processed against the buffered content. Filters are applied in the order
8425    they are specified in one of the filter files. Animated GIFs, if present,
8426    are reduced to either the first or last frame, depending on the action
8427    setting.The entire page, which is now filtered, is then sent by
8428    <application>Privoxy</application> back to your browser. 
8429   </para>
8430   <para>
8431    If neither a <link linkend="FILTER"><quote>+filter</quote></link> action
8432    or <link
8433    linkend="DEANIMATE-GIFS"><quote>+deanimate-gifs</quote></link>
8434    matches, then <application>Privoxy</application> passes the raw data through 
8435    to the client browser as it becomes available.
8436   </para>
8437  </listitem> 
8438  <listitem>
8439   <para>
8440    As the browser receives the now (possibly filtered) page content, it 
8441    reads and then requests any URLs that may be embedded within the page
8442    source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
8443    frames), sounds, etc. For each of these objects, the browser issues a
8444    separate request (this is easily viewable in <application>Privoxy's</application>
8445    logs). And each such request is in turn processed just as above. Note that a
8446    complex web page will have many, many such embedded URLs. If these 
8447    secondary requests are to a different server, then quite possibly a very 
8448    differing set of actions is triggered.
8449   </para>
8450  </listitem> 
8451  
8452  </itemizedlist>
8453 </para>
8454 <para>
8455  NOTE: This is somewhat of a simplistic overview of what happens with each URL
8456  request. For the sake of brevity and simplicity, we have focused on 
8457  <application>Privoxy's</application> core features only.
8458 </para>
8459
8460 </sect2>
8461
8462
8463 <!--   ~~~~~       New section      ~~~~~     -->
8464 <sect2 id="actionsanat">
8465 <title>Troubleshooting: Anatomy of an Action</title>
8466
8467 <para>
8468  The way <application>Privoxy</application> applies 
8469  <link linkend="ACTIONS">actions</link> and <link linkend="FILTER">filters</link>
8470  to any given URL can be complex, and not always so
8471  easy to understand what is happening. And sometimes we need to be able to
8472  <emphasis>see</emphasis> just what <application>Privoxy</application> is
8473  doing. Especially, if something <application>Privoxy</application> is doing
8474  is causing us a problem inadvertently. It can be a little daunting to look at
8475  the actions and filters files themselves, since they tend to be filled with
8476  <link linkend="regex">regular expressions</link> whose consequences are not
8477  always so obvious. 
8478 </para>
8479
8480 <para>
8481  One quick test to see if <application>Privoxy</application> is causing a problem 
8482  or not, is to disable it temporarily. This should be the first troubleshooting 
8483  step. See <link linkend="bookmarklets">the Bookmarklets</link> section on a quick 
8484  and easy way to do this (be sure to flush caches afterward!). Looking at the 
8485  logs is a good idea too.
8486 </para>
8487 <para>
8488  Another easy troubleshooting step to try is if you have done any
8489  customization of your installation, revert back to the installed
8490  defaults and see if that helps. There are times the developers get complaints
8491  about one thing or another, and the problem is more related to a customized
8492  configuration issue.
8493 </para>
8494
8495 <para>
8496  <application>Privoxy</application> also provides the 
8497  <ulink url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>
8498  page that can show us very specifically how <application>actions</application>
8499  are being applied to any given URL. This is a big help for troubleshooting.
8500 </para>
8501
8502 <para>
8503  First, enter one URL (or partial URL) at the prompt, and then
8504  <application>Privoxy</application> will tell us 
8505  how the current configuration will handle it. This will not
8506  help with filtering effects (i.e. the <link
8507  linkend="FILTER"><quote>+filter</quote></link> action) from
8508  one of the filter files since this is handled very
8509  differently and not so easy to trap! It also will not tell you about any other
8510  URLs that may be embedded within the URL you are testing. For instance, images
8511  such as ads are expressed as URLs within the raw page source of HTML pages. So
8512  you will only get info for the actual URL that is pasted into the prompt area
8513  -- not any sub-URLs. If you want to know about embedded URLs like ads, you
8514  will have to dig those out of the HTML source. Use your browser's <quote>View
8515  Page Source</quote> option for this. Or right click on the ad, and grab the
8516  URL.
8517 </para>
8518
8519 <para>
8520  Let's try an example, <ulink url="http://google.com">google.com</ulink>, 
8521  and look at it one section at a time in a sample configuration (your real 
8522  configuration may vary):
8523 </para>
8524
8525 <para>
8526  <screen>
8527  Matches for http://www.google.com:
8528
8529  In file: default.action <guibutton>[ View ]</guibutton> <guibutton>[ Edit ]</guibutton>
8530
8531  {+deanimate-gifs {last}
8532  +fast-redirects {check-decoded-url}
8533  +filter {refresh-tags}
8534  +filter {img-reorder}
8535  +filter {banners-by-size}
8536  +filter {webbugs}
8537  +filter {jumping-windows}
8538  +filter {ie-exploits}
8539  +hide-forwarded-for-headers
8540  +hide-from-header {block}
8541  +hide-referrer {forge}
8542  +session-cookies-only
8543  +set-image-blocker {pattern}
8544 /
8545  
8546  { -session-cookies-only }
8547  .google.com
8548
8549  { -fast-redirects }
8550  .google.com
8551
8552 In file: user.action <guibutton>[ View ]</guibutton> <guibutton>[ Edit ]</guibutton>
8553 (no matches in this file)  
8554 </screen>
8555 </para>
8556
8557 <para>
8558  This is telling us how we have defined our 
8559  <link linkend="ACTIONS"><quote>actions</quote></link>, and
8560  which ones match for our test case, <quote>google.com</quote>. 
8561  Displayed is all the actions that are available to us. Remember,
8562  the <literal>+</literal> sign denotes <quote>on</quote>. <literal>-</literal>
8563  denotes <quote>off</quote>. So some are <quote>on</quote> here, but many 
8564  are <quote>off</quote>. Each example we try may provide a slightly different
8565  end result, depending on our configuration directives.
8566 </para>
8567 <para>
8568  The first listing
8569   is for our <filename>default.action</filename> file. The large, multi-line
8570   listing, is how the actions are set to match for all URLs, i.e. our default
8571   settings. If you look at your <quote>actions</quote> file, this would be the
8572   section just below the <quote>aliases</quote> section near the top. This
8573   will apply to all URLs as signified by the single forward slash at the end
8574   of the listing -- <quote> / </quote>.
8575 </para>
8576
8577 <para>
8578  But we have defined additional actions that would be exceptions to these general
8579  rules, and then we list specific URLs (or patterns) that these exceptions
8580  would apply to. Last match wins. Just below this then are two explicit
8581  matches for <quote>.google.com</quote>. The first is negating our previous
8582  cookie setting, which was for <link
8583  linkend="SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></link>
8584  (i.e. not persistent). So we will allow persistent cookies for google, at
8585  least that is how it is in this example. The second turns
8586  <emphasis>off</emphasis> any <link
8587  linkend="FAST-REDIRECTS"><quote>+fast-redirects</quote></link>
8588  action, allowing this to take place unmolested. Note that there is a leading
8589  dot here -- <quote>.google.com</quote>. This will match any hosts and
8590  sub-domains, in the google.com domain also, such as
8591  <quote>www.google.com</quote> or <quote>mail.google.com</quote>. But it would not 
8592  match <quote>www.google.de</quote>! So, apparently, we have these two actions
8593  defined as exceptions to the general rules at the top somewhere in the lower
8594  part of our <filename>default.action</filename> file, and
8595  <quote>google.com</quote> is referenced somewhere in these latter sections.
8596 </para>
8597
8598 <para>
8599  Then, for our <filename>user.action</filename> file, we again have no hits.
8600  So there is nothing google-specific that we might have added to our own, local
8601  configuration. If there was, those actions would over-rule any actions from 
8602  previously processed files, such as <filename>default.action</filename>.
8603  <filename>user.action</filename> typically has the last word. This is the
8604  best place to put hard and fast exceptions,
8605 </para>
8606
8607 <para>
8608  And finally we pull it all together in the bottom section and summarize how
8609  <application>Privoxy</application> is applying all its <quote>actions</quote> 
8610  to <quote>google.com</quote>:
8611
8612 </para>
8613
8614 <para>
8615  <screen>
8616
8617  Final results:
8618  
8619  -add-header
8620  -block
8621  -client-header-filter{hide-tor-exit-notation}
8622  -content-type-overwrite
8623  -crunch-client-header
8624  -crunch-if-none-match
8625  -crunch-incoming-cookies
8626  -crunch-outgoing-cookies
8627  -crunch-server-header
8628  +deanimate-gifs {last}
8629  -downgrade-http-version
8630  -fast-redirects
8631  -filter {js-events}
8632  -filter {content-cookies}
8633  -filter {all-popups}
8634  -filter {banners-by-link}
8635  -filter {tiny-textforms}
8636  -filter {frameset-borders}
8637  -filter {demoronizer}
8638  -filter {shockwave-flash}
8639  -filter {quicktime-kioskmode}
8640  -filter {fun}
8641  -filter {crude-parental}
8642  -filter {site-specifics}
8643  -filter {js-annoyances}
8644  -filter {html-annoyances}
8645  +filter {refresh-tags}
8646  -filter {unsolicited-popups}
8647  +filter {img-reorder}
8648  +filter {banners-by-size}
8649  +filter {webbugs}
8650  +filter {jumping-windows}
8651  +filter {ie-exploits}
8652  -filter {google}
8653  -filter {yahoo}
8654  -filter {msn}
8655  -filter {blogspot}
8656  -filter {no-ping}
8657  -force-text-mode
8658  -handle-as-empty-document
8659  -handle-as-image
8660  -hide-accept-language
8661  -hide-content-disposition
8662  +hide-forwarded-for-headers
8663  +hide-from-header {block}
8664  -hide-if-modified-since
8665  +hide-referrer {forge}
8666  -hide-user-agent
8667  -inspect-jpegs
8668  -kill-popups
8669  -limit-connect
8670  -overwrite-last-modified
8671  -prevent-compression
8672  -redirect
8673  -send-vanilla-wafer
8674  -send-wafer
8675  -server-header-filter{xml-to-html}
8676  -server-header-filter{html-to-xml} 
8677  -session-cookies-only
8678  +set-image-blocker {pattern}
8679  -treat-forbidden-connects-like-blocks </screen>
8680 </para>
8681
8682 <para>
8683  Notice the only difference here to the previous listing, is to 
8684  <quote>fast-redirects</quote> and <quote>session-cookies-only</quote>,
8685  which are activated specifically for this site in our configuration, 
8686  and thus show in the <quote>Final Results</quote>.
8687 </para>
8688
8689 <para>
8690  Now another example, <quote>ad.doubleclick.net</quote>:
8691 </para>
8692
8693 <para>
8694  <screen>
8695
8696  { +block }
8697   ad*.
8698
8699  { +block }
8700   .ad.
8701
8702  { +block +handle-as-image }
8703   .[a-vx-z]*.doubleclick.net
8704 </screen>
8705 </para>
8706
8707 <para>
8708  We'll just show the interesting part here - the explicit matches. It is 
8709  matched three different times. Two <quote>+block</quote> sections, 
8710  and a <quote>+block +handle-as-image</quote>,
8711  which is the expanded form of one of our aliases that had been defined as: 
8712  <quote>+block-as-image</quote>. (<link
8713  linkend="ALIASES"><quote>Aliases</quote></link> are defined in
8714  the first section of the actions file and typically used to combine more 
8715  than one action.)
8716 </para>
8717
8718 <para>
8719  Any one of these would have done the trick and blocked this as an unwanted 
8720  image. This is unnecessarily redundant since the last case effectively 
8721  would also cover the first. No point in taking chances with these guys 
8722  though ;-) Note that if you want an ad or obnoxious 
8723  URL to be invisible, it should be defined as <quote>ad.doubleclick.net</quote>
8724  is done here -- as both a <link
8725  linkend="BLOCK"><quote>+block</quote></link>
8726  <emphasis>and</emphasis> an 
8727  <link linkend="HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></link>.
8728  The custom alias <quote><literal>+block-as-image</literal></quote> just
8729  simplifies the process and make it more readable.
8730 </para>
8731
8732 <para>
8733  One last example. Let's try <quote>http://www.example.net/adsl/HOWTO/</quote>.
8734  This one is giving us problems. We are getting a blank page. Hmmm ...
8735 </para>
8736
8737 <para>
8738  <screen>
8739
8740  Matches for http://www.example.net/adsl/HOWTO/:
8741
8742  In file: default.action <guibutton>[ View ]</guibutton> <guibutton>[ Edit ]</guibutton>
8743
8744  {-add-header 
8745   -block
8746   -client-header-filter{hide-tor-exit-notation}
8747   -content-type-overwrite
8748   -crunch-client-header
8749   -crunch-if-none-match
8750   -crunch-incoming-cookies
8751   -crunch-outgoing-cookies
8752   -crunch-server-header
8753   +deanimate-gifs 
8754   -downgrade-http-version 
8755   +fast-redirects {check-decoded-url}
8756   -filter {js-events}
8757   -filter {content-cookies}
8758   -filter {all-popups}
8759   -filter {banners-by-link}
8760   -filter {tiny-textforms}
8761   -filter {frameset-borders}
8762   -filter {demoronizer}
8763   -filter {shockwave-flash}
8764   -filter {quicktime-kioskmode}
8765   -filter {fun}
8766   -filter {crude-parental}
8767   -filter {site-specifics}
8768   -filter {js-annoyances}
8769   -filter {html-annoyances}
8770   +filter {refresh-tags}
8771   -filter {unsolicited-popups}
8772   +filter {img-reorder}
8773   +filter {banners-by-size}
8774   +filter {webbugs}
8775   +filter {jumping-windows}
8776   +filter {ie-exploits}
8777   -filter {google}
8778   -filter {yahoo}
8779   -filter {msn}
8780   -filter {blogspot}
8781   -filter {no-ping}
8782   -force-text-mode
8783   -handle-as-empty-document
8784   -handle-as-image 
8785   -hide-accept-language
8786   -hide-content-disposition  
8787   +hide-forwarded-for-headers 
8788   +hide-from-header{block} 
8789   +hide-referer{forge} 
8790   -hide-user-agent 
8791   -inspect-jpegs
8792   -kill-popups 
8793   -overwrite-last-modified
8794   +prevent-compression 
8795   -redirect
8796   -send-vanilla-wafer 
8797   -send-wafer
8798   -server-header-filter{xml-to-html}
8799   -server-header-filter{html-to-xml} 
8800   +session-cookies-only 
8801   +set-image-blocker{blank} 
8802   -treat-forbidden-connects-like-blocks }
8803    /
8804
8805  { +block +handle-as-image }
8806   /ads
8807 </screen>
8808 </para>
8809
8810 <para>
8811  Ooops, the <quote>/adsl/</quote> is matching <quote>/ads</quote> in our 
8812  configuration! But we did not want this at all! Now we see why we get the
8813  blank page. It is actually triggering two different actions here, and 
8814  the effects are aggregated so that the URL is blocked, and &my-app; is told 
8815  to treat the block as if it were an image. But this is, of course, all wrong.
8816   We could now add a new action below this (or better in our own
8817   <filename>user.action</filename> file) that explicitly
8818   <emphasis>un</emphasis> blocks (
8819   <link linkend="BLOCK"><quote>{-block}</quote></link>) paths with
8820   <quote>adsl</quote> in them (remember, last match in the configuration
8821   wins). There are various ways to handle such exceptions. Example:
8822 </para>
8823
8824 <para>
8825  <screen>
8826
8827  { -block }
8828   /adsl
8829 </screen>
8830 </para>
8831
8832 <para>
8833  Now the page displays ;-) 
8834  Remember to flush your browser's caches when making these kinds of changes to
8835  your configuration to insure that you get a freshly delivered page! Or, try
8836  using <literal>Shift+Reload</literal>.
8837 </para>
8838
8839 <para>
8840  But now what about a situation where we get no explicit matches like 
8841  we did with:
8842 </para>
8843
8844 <para>
8845  <screen>
8846
8847  { +block +handle-as-image }
8848  /ads
8849 </screen>
8850 </para>
8851
8852 <para>
8853  That actually was very helpful and pointed us quickly to where the problem
8854  was. If you don't get this kind of match, then it means one of the default 
8855  rules in the first section of <filename>default.action</filename> is causing
8856  the problem. This would require some guesswork, and maybe a little trial and
8857  error to isolate the offending rule. One likely cause would be one of the
8858  <link linkend="FILTER"><quote>+filter</quote></link> actions.
8859  These tend to be harder to troubleshoot.
8860  Try adding the URL for the site to one of aliases that turn off
8861  <link linkend="FILTER"><quote>+filter</quote></link>:
8862 </para>
8863
8864 <para>
8865  <screen>
8866
8867  { shop }
8868  .quietpc.com
8869  .worldpay.com   # for quietpc.com
8870  .jungle.com
8871  .scan.co.uk
8872  .forbes.com
8873 </screen>
8874 </para>
8875
8876 <para>
8877  <quote><literal>{ shop }</literal></quote> is an <quote>alias</quote> that expands to 
8878  <quote><literal>{ -filter -session-cookies-only }</literal></quote>.
8879  Or you could do your own exception to negate filtering:
8880
8881 </para>
8882
8883 <para>
8884  <screen>
8885
8886  { -filter }
8887  # Disable ALL filter actions for sites in this section
8888  .forbes.com
8889  developer.ibm.com
8890  localhost
8891 </screen>
8892 </para>
8893
8894 <para>
8895  This would turn off all filtering for these sites. This is best
8896  put in <filename>user.action</filename>, for local site
8897  exceptions. Note that when a simple domain pattern is used by itself (without
8898  the subsequent path portion), all sub-pages within that domain are included 
8899  automatically in the scope of the action.
8900 </para>
8901
8902 <para>
8903  Images that are inexplicably being blocked, may well be hitting the 
8904 <link linkend="FILTER-BANNERS-BY-SIZE"><quote>+filter{banners-by-size}</quote></link>
8905  rule, which assumes 
8906  that images of certain sizes are ad banners (works well 
8907  <emphasis>most of the time</emphasis>  since these tend to be standardized).
8908 </para>
8909
8910 <para>
8911  <quote><literal>{ fragile }</literal></quote> is an alias that disables most
8912  actions that are the most likely to cause trouble. This can be used as a
8913  last resort for problem sites. 
8914 </para> 
8915 <para>
8916  <screen>
8917
8918  { fragile }
8919  # Handle with care: easy to break
8920  mail.google.
8921  mybank.example.com</screen>
8922 </para>
8923  
8924
8925 <para>
8926  <emphasis>Remember to flush caches!</emphasis> Note that the 
8927  <literal>mail.google</literal> reference lacks the TLD portion (e.g. 
8928  <quote>.com</quote>. This will effectively match any TLD with 
8929  <literal>google</literal> in it, such as <literal>mail.google.de</literal>, 
8930  just as an example.
8931 </para>
8932 <para> 
8933  If this still does not work, you will have to go through the remaining
8934  actions one by one to find which one(s) is causing the problem.
8935 </para>
8936
8937 </sect2>
8938
8939 </sect1>
8940
8941  <!--
8942
8943  This program is free software; you can redistribute it 
8944  and/or modify it under the terms of the GNU General
8945  Public License as published by the Free Software
8946  Foundation; either version 2 of the License, or (at
8947  your option) any later version.
8948
8949  This program is distributed in the hope that it will
8950  be useful, but WITHOUT ANY WARRANTY; without even the
8951  implied warranty of MERCHANTABILITY or FITNESS FOR A
8952  PARTICULAR PURPOSE.  See the GNU General Public
8953  License for more details.
8954
8955  The GNU General Public License should be included with
8956  this file.  If not, you can view it at
8957  http://www.gnu.org/copyleft/gpl.html
8958  or write to the Free Software Foundation, Inc., 
8959  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
8960  USA
8961
8962  $Log: user-manual.sgml,v $
8963  Revision 2.39  2007/11/05 02:34:49  hal9
8964  Various changes in preparation for the upcoming release. Much yet to be done.
8965
8966  Revision 2.38  2007/09/22 16:01:42  fabiankeil
8967  Update embedded show-url-info output.
8968
8969  Revision 2.37  2007/08/27 16:09:55  fabiankeil
8970  Fix pre-chroot-nslookup description which I failed to
8971  copy and paste properly. Reported by Stephen Gildea.
8972
8973  Revision 2.36  2007/08/26 16:47:14  fabiankeil
8974  Add Stephen Gildea's pre-chroot-nslookup patch [#1276666],
8975  extensive comments moved to user manual.
8976
8977  Revision 2.35  2007/08/26 14:59:49  fabiankeil
8978  Minor rewordings and fixes.
8979
8980  Revision 2.34  2007/08/05 15:19:50  fabiankeil
8981  - Don't claim HTTP/1.1 compliance.
8982  - Use $ in some of the path pattern examples.
8983  - Use a hide-user-agent example argument without
8984    leading and trailing space.
8985  - Make it clear that the cookie actions work with
8986    HTTP cookies only.
8987  - Rephrase the inspect-jpegs text to underline
8988    that it's only meant to protect against a single
8989    exploit.
8990
8991  Revision 2.33  2007/07/27 10:57:35  hal9
8992  Add references for user-agent strings for hide-user-agenet
8993
8994  Revision 2.32  2007/06/07 12:36:22  fabiankeil
8995  Apply Roland's 29_usermanual.dpatch to fix a bunch
8996  of syntax errors I collected over the last months.
8997
8998  Revision 2.31  2007/06/02 14:01:37  fabiankeil
8999  Start to document forward-override{}.
9000
9001  Revision 2.30  2007/04/25 15:10:36  fabiankeil
9002  - Describe installation for FreeBSD.
9003  - Start to document taggers and tag patterns.
9004  - Don't confuse devils and daemons.
9005
9006  Revision 2.29  2007/04/05 11:47:51  fabiankeil
9007  Some updates regarding header filtering,
9008  handling of compressed content and redirect's
9009  support for pcrs commands.
9010
9011  Revision 2.28  2006/12/10 23:42:48  hal9
9012  Fix various typos reported by Adam P. Thanks.
9013
9014  Revision 2.27  2006/11/14 01:57:47  hal9
9015  Dump all docs prior to 3.0.6 release. Various minor changes to faq and user
9016  manual.
9017
9018  Revision 2.26  2006/10/24 11:16:44  hal9
9019  Add new filters.
9020
9021  Revision 2.25  2006/10/18 10:50:33  hal9
9022  Add note that since filters are off in Cautious, compression is ON. Turn off
9023  compression to make filters work on all sites.
9024
9025  Revision 2.24  2006/10/03 11:13:54  hal9
9026  More references to the new filters. Include html this time around.
9027
9028  Revision 2.23  2006/10/02 22:43:53  hal9
9029  Contains new filter definitions from Fabian, and few other miscellaneous
9030  touch-ups.
9031
9032  Revision 2.22  2006/09/22 01:27:55  hal9
9033  Final commit of probably various minor changes here and there. Unless
9034  something changes this should be ready for pending release.
9035
9036  Revision 2.21  2006/09/20 03:21:36  david__schmidt
9037  Just the tiniest tweak.  Wafer thin!
9038
9039  Revision 2.20  2006/09/10 14:53:54  hal9
9040  Results of spell check. User manual has some updates to standard.actions file
9041  info.
9042
9043  Revision 2.19  2006/09/08 12:19:02  fabiankeil
9044  Adjust hide-if-modified-since example values
9045  to reflect the recent changes.
9046
9047  Revision 2.18  2006/09/08 02:38:57  hal9
9048  Various changes:
9049   -Fix a number of broken links.
9050   -Migrate the new Windows service command line options, and reference as
9051    needed.
9052   -Rebuild so that can be used with the new "user-manual" config capabilities.
9053   -Etc.
9054
9055  Revision 2.17  2006/09/05 13:25:12  david__schmidt
9056  Add Windows service invocation stuff (duplicated) in FAQ and in user manual under Windows startup.  One probably ought to reference the other.
9057
9058  Revision 2.16  2006/09/02 12:49:37  hal9
9059  Various small updates for new actions, filterfiles, etc.
9060
9061  Revision 2.15  2006/08/30 11:15:22  hal9
9062  More work on the new actions, especially filter-*-headers, and What's New
9063  section. User Manual is close to final form for 3.0.4 release. Some tinkering
9064  and proof reading left to do.
9065
9066  Revision 2.14  2006/08/29 10:59:36  hal9
9067  Add a "Whats New in this release" Section. Further work on multiple filter
9068  files, and assorted other minor changes.
9069
9070  Revision 2.13  2006/08/22 11:04:59  hal9
9071  Silence warnings and errors. This should build now. New filters were only
9072  stubbed in. More to be done.
9073
9074  Revision 2.12  2006/08/14 08:40:39  fabiankeil
9075  Documented new actions that were part of
9076  the "minor Privoxy improvements".
9077
9078  Revision 2.11  2006/07/18 14:48:51  david__schmidt
9079  Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
9080  with what was really the latest development (the v_3_0_branch branch)
9081
9082  Revision 1.123.2.43  2005/05/23 09:59:10  hal9
9083  Fix typo 'loose'
9084
9085  Revision 1.123.2.42  2004/12/04 14:39:57  hal9
9086  Fix two minor typos per bug SF report.
9087
9088  Revision 1.123.2.41  2004/03/23 12:58:42  oes
9089  Fixed an inaccuracy
9090
9091  Revision 1.123.2.40  2004/02/27 12:48:49  hal9
9092  Add comment re: redirecting to local file system for set-image-blocker may
9093  is dependent on browser.
9094
9095  Revision 1.123.2.39  2004/01/30 22:31:40  oes
9096  Added a hint re bookmarklets to Quickstart section
9097
9098  Revision 1.123.2.38  2004/01/30 16:47:51  oes
9099  Some minor clarifications
9100
9101  Revision 1.123.2.37  2004/01/29 22:36:11  hal9
9102  Updates for no longer filtering text/plain, and demoronizer default settings,
9103  and copyright notice dates.
9104
9105  Revision 1.123.2.36  2003/12/10 02:26:26  hal9
9106  Changed the demoronizer filter description.
9107
9108  Revision 1.123.2.35  2003/11/06 13:36:37  oes
9109  Updated link to nightly CVS tarball
9110
9111  Revision 1.123.2.34  2003/06/26 23:50:16  hal9
9112  Add a small bit on filtering and problems re: source code being corrupted.
9113
9114  Revision 1.123.2.33  2003/05/08 18:17:33  roro
9115  Use apt-get instead of dpkg to install Debian package, which is more
9116  solid, uses the correct and most recent Debian version automatically.
9117
9118  Revision 1.123.2.32  2003/04/11 03:13:57  hal9
9119  Add small note about only one filterfile (as opposed to multiple actions
9120  files).
9121
9122  Revision 1.123.2.31  2003/03/26 02:03:43  oes
9123  Updated hard-coded copyright dates
9124
9125  Revision 1.123.2.30  2003/03/24 12:58:56  hal9
9126  Add new section on Predefined Filters.
9127
9128  Revision 1.123.2.29  2003/03/20 02:45:29  hal9
9129  More problems with \-\-chroot causing markup problems :(
9130
9131  Revision 1.123.2.28  2003/03/19 00:35:24  hal9
9132  Manual edit of revision log because 'chroot' (even inside a comment) was
9133  causing Docbook to hang here (due to double hyphen and the processor thinking
9134  it was a comment).
9135
9136  Revision 1.123.2.27  2003/03/18 19:37:14  oes
9137  s/Advanced|Radical/Adventuresome/g to avoid complaints re fun filter
9138
9139  Revision 1.123.2.26  2003/03/17 16:50:53  oes
9140  Added documentation for new chroot option
9141
9142  Revision 1.123.2.25  2003/03/15 18:36:55  oes
9143  Adapted to the new filters
9144
9145  Revision 1.123.2.24  2002/11/17 06:41:06  hal9
9146  Move default profiles table from FAQ to U-M, and other minor related changes.
9147  Add faq on cookies.
9148
9149  Revision 1.123.2.23  2002/10/21 02:32:01  hal9
9150  Updates to the user.action examples section. A few new ones.
9151
9152  Revision 1.123.2.22  2002/10/12 00:51:53  hal9
9153  Add demoronizer to filter section.
9154
9155  Revision 1.123.2.21  2002/10/10 04:09:35  hal9
9156  s/Advanced/Radical/ and added very brief note.
9157
9158  Revision 1.123.2.20  2002/10/10 03:49:21  hal9
9159  Add notes to session-cookies-only and Quickstart about pre-existing
9160  cookies. Also, note content-cookies work differently.
9161
9162  Revision 1.123.2.19  2002/09/26 01:25:36  hal9
9163  More explanation on Privoxy patterns, more on content-cookies and SSL.
9164
9165  Revision 1.123.2.18  2002/08/22 23:47:58  hal9
9166  Add 'Documentation' to Privoxy Menu shot in Configuration section to match
9167  CGIs.
9168
9169  Revision 1.123.2.17  2002/08/18 01:13:05  hal9
9170  Spell checked (only one typo this time!).
9171
9172  Revision 1.123.2.16  2002/08/09 19:20:54  david__schmidt
9173  Update to Mac OSX startup script name
9174
9175  Revision 1.123.2.15  2002/08/07 17:32:11  oes
9176  Converted some internal links from ulink to link for PDF creation; no content changed
9177
9178  Revision 1.123.2.14  2002/08/06 09:16:13  oes
9179  Nits re: actions file download
9180
9181  Revision 1.123.2.13  2002/08/02 18:23:19  g_sauthoff
9182  Just 2 small corrections to the Gentoo sections
9183
9184  Revision 1.123.2.12  2002/08/02 18:17:21  g_sauthoff
9185  Added 2 Gentoo sections
9186
9187  Revision 1.123.2.11  2002/07/26 15:20:31  oes
9188  - Added version info to title
9189  - Added info on new filters
9190  - Revised parts of the filter file tutorial
9191  - Added info on where to get updated actions files
9192
9193  Revision 1.123.2.10  2002/07/25 21:42:29  hal9
9194  Add brief notes on not proxying non-HTTP protocols.
9195
9196  Revision 1.123.2.9  2002/07/11 03:40:28  david__schmidt
9197
9198  Updated Mac OSX sections due to installation location change
9199
9200  Revision 1.123.2.8  2002/06/09 16:36:32  hal9
9201  Clarifications on filtering and MIME. Hardcode 'latest release' in index.html.
9202
9203  Revision 1.123.2.7  2002/06/09 00:29:34  hal9
9204  Touch ups on filtering, in actions section and Anatomy.
9205
9206  Revision 1.123.2.6  2002/06/06 23:11:03  hal9
9207  Fix broken link. Linkchecked all docs.
9208
9209  Revision 1.123.2.5  2002/05/29 02:01:02  hal9
9210  This is break out of the entire config section from u-m, so it can
9211  eventually be used to generate the comments, etc in the main config file
9212  so that these are in sync with each other.
9213
9214  Revision 1.123.2.4  2002/05/27 03:28:45  hal9
9215  Ooops missed something from David.
9216
9217  Revision 1.123.2.3  2002/05/27 03:23:17  hal9
9218  Fix FIXMEs for OS2 and OSX startup. Fix Redhat typos (should be Red Hat).
9219  That's a wrap, I think.
9220
9221  Revision 1.123.2.2  2002/05/26 19:02:09  hal9
9222  Move Amiga stuff around to take of FIXME in start up section.
9223
9224  Revision 1.123.2.1  2002/05/26 17:04:25  hal9
9225  -Spellcheck, very minor edits, and sync across branches
9226
9227  Revision 1.123  2002/05/24 23:19:23  hal9
9228  Include new image (Proxy setup). More fun with guibutton.
9229  Minor corrections/clarifications here and there.
9230
9231  Revision 1.122  2002/05/24 13:24:08  oes
9232  Added Bookmarklet for one-click pre-filled access to show-url-info
9233
9234  Revision 1.121  2002/05/23 23:20:17  oes
9235   - Changed more (all?) references to actions to the
9236     <literal><link> style.
9237   - Small fixes in the actions chapter
9238   - Small clarifications in the quickstart to ad blocking
9239   - Removed <emphasis> from <title>s since the new doc CSS
9240     renders them red (bad in TOC).
9241
9242  Revision 1.120  2002/05/23 19:16:43  roro
9243  Correct Debian specials (installation and startup).
9244
9245  Revision 1.119  2002/05/22 17:17:05  oes
9246  Added Security hint
9247
9248  Revision 1.118  2002/05/21 04:54:55  hal9
9249  -New Section: Quickstart to Ad Blocking
9250  -Reformat Actions Anatomy to match new CGI layout
9251
9252  Revision 1.117  2002/05/17 13:56:16  oes
9253   - Reworked & extended Templates chapter
9254   - Small changes to Regex appendix
9255   - #included authors.sgml into (C) and hist chapter
9256
9257  Revision 1.116  2002/05/17 03:23:46  hal9
9258  Fixing merge conflict in Quickstart section.
9259
9260  Revision 1.115  2002/05/16 16:25:00  oes
9261  Extended the Filter File chapter & minor fixes
9262
9263  Revision 1.114  2002/05/16 09:42:50  oes
9264  More ulink->link, added some hints to Quickstart section
9265
9266  Revision 1.113  2002/05/15 21:07:25  oes
9267  Extended and further commented the example actions files
9268
9269  Revision 1.112  2002/05/15 03:57:14  hal9
9270  Spell check. A few minor edits here and there for better syntax and
9271  clarification.
9272
9273  Revision 1.111  2002/05/14 23:01:36  oes
9274  Fixing the fixes   
9275
9276  Revision 1.110  2002/05/14 19:10:45  oes
9277  Restored alphabetical order of actions
9278
9279  Revision 1.109  2002/05/14 17:23:11  oes
9280  Renamed the prevent-*-cookies actions, extended aliases section and moved it before the example AFs
9281
9282  Revision 1.108  2002/05/14 15:29:12  oes
9283  Completed proofreading the actions chapter
9284
9285  Revision 1.107  2002/05/12 03:20:41  hal9
9286  Small clarifications for 127.0.0.1 vs localhost for listen-address since this
9287  apparently an important distinction for some OS's.
9288
9289  Revision 1.106  2002/05/10 01:48:20  hal9
9290  This is mostly proposed copyright/licensing additions and changes. Docs
9291  are still GPL, but licensing and copyright are more visible. Also, copyright
9292  changed in doc header comments (eliminate references to JB except FAQ).
9293
9294  Revision 1.105  2002/05/05 20:26:02  hal9
9295  Sorting out license vs copyright in these docs.
9296
9297  Revision 1.104  2002/05/04 08:44:45  swa
9298  bumped version
9299
9300  Revision 1.103  2002/05/04 00:40:53  hal9
9301  -Remove the TOC first page kludge. It's fixed proper now in ldp.dsl.in.
9302  -Some minor additions to Quickstart.
9303
9304  Revision 1.102  2002/05/03 17:46:00  oes
9305  Further proofread & reactivated short build instructions
9306
9307  Revision 1.101  2002/05/03 03:58:30  hal9
9308  Move the user-manual config directive to top of section. Add note about
9309  Privoxy needing read permissions for configs, and write for logs.
9310
9311  Revision 1.100  2002/04/29 03:05:55  hal9
9312  Add clarification on differences of new actions files.
9313
9314  Revision 1.99  2002/04/28 16:59:05  swa
9315  more structure in starting section
9316
9317  Revision 1.98  2002/04/28 05:43:59  hal9
9318  This is the break up of configuration.html into multiple files. This
9319  will probably break links elsewhere :(
9320
9321  Revision 1.97  2002/04/27 21:04:42  hal9
9322  -Rewrite of Actions File example.
9323  -Add section for user-manual directive in config.
9324
9325  Revision 1.96  2002/04/27 05:32:00  hal9
9326  -Add short section to Filter Files to tie in with +filter action.
9327  -Start rewrite of examples in Actions Examples (not finished).
9328
9329  Revision 1.95  2002/04/26 17:23:29  swa
9330  bookmarks cleaned, changed structure of user manual, screen and programlisting cleanups, and numerous other changes that I forgot
9331
9332  Revision 1.94  2002/04/26 05:24:36  hal9
9333  -Add most of Andreas suggestions to Chain of Events section.
9334  -A few other minor corrections and touch up.
9335
9336  Revision 1.92  2002/04/25 18:55:13  hal9
9337  More catchups on new actions files, and new actions names.
9338  Other assorted cleanups, and minor modifications.
9339
9340  Revision 1.91  2002/04/24 02:39:31  hal9
9341  Add 'Chain of Events' section.
9342
9343  Revision 1.90  2002/04/23 21:41:25  hal9
9344  Linuxconf is deprecated on RH, substitute chkconfig.
9345
9346  Revision 1.89  2002/04/23 21:05:28  oes
9347  Added hint for startup on Red Hat
9348
9349  Revision 1.88  2002/04/23 05:37:54  hal9
9350  Add AmigaOS install stuff.
9351
9352  Revision 1.87  2002/04/23 02:53:15  david__schmidt
9353  Updated OSX installation section
9354  Added a few English tweaks here an there
9355
9356  Revision 1.86  2002/04/21 01:46:32  hal9
9357  Re-write actions section.
9358
9359  Revision 1.85  2002/04/18 21:23:23  hal9
9360  Fix ugly typo (mine).
9361
9362  Revision 1.84  2002/04/18 21:17:13  hal9
9363  Spell Redhat correctly (ie Red Hat). A few minor grammar corrections.
9364
9365  Revision 1.83  2002/04/18 18:21:12  oes
9366  Added RPM install detail
9367
9368  Revision 1.82  2002/04/18 12:04:50  oes
9369  Cosmetics
9370
9371  Revision 1.81  2002/04/18 11:50:24  oes
9372  Extended Install section - needs fixing by packagers
9373
9374  Revision 1.80  2002/04/18 10:45:19  oes
9375  Moved text to buildsource.sgml, renamed some filters, details
9376
9377  Revision 1.79  2002/04/18 03:18:06  hal9
9378  Spellcheck, and minor touchups.
9379
9380  Revision 1.78  2002/04/17 18:04:16  oes
9381  Proofreading part 2
9382
9383  Revision 1.77  2002/04/17 13:51:23  oes
9384  Proofreading, part one
9385
9386  Revision 1.76  2002/04/16 04:25:51  hal9
9387  -Added 'Note to Upgraders' and re-ordered the 'Quickstart' section.
9388  -Note about proxy may need requests to re-read config files.
9389
9390  Revision 1.75  2002/04/12 02:08:48  david__schmidt
9391  Remove OS/2 building info... it is already in the developer-manual
9392
9393  Revision 1.74  2002/04/11 00:54:38  hal9
9394  Add small section on submitting actions.
9395
9396  Revision 1.73  2002/04/10 18:45:15  swa
9397  generated
9398
9399  Revision 1.72  2002/04/10 04:06:19  hal9
9400  Added actions feedback  to Bookmarklets section
9401
9402  Revision 1.71  2002/04/08 22:59:26  hal9
9403  Version update. Spell chkconfig correctly :)
9404
9405  Revision 1.70  2002/04/08 20:53:56  swa
9406  ?
9407
9408  Revision 1.69  2002/04/06 05:07:29  hal9
9409  -Add privoxy-man-page.sgml, for man page.
9410  -Add authors.sgml for AUTHORS (and p-authors.sgml)
9411  -Reworked various aspects of various docs.
9412  -Added additional comments to sub-docs.
9413
9414  Revision 1.68  2002/04/04 18:46:47  swa
9415  consistent look. reuse of copyright, history et. al.
9416
9417  Revision 1.67  2002/04/04 17:27:57  swa
9418  more single file to be included at multiple points. make maintaining easier
9419
9420  Revision 1.66  2002/04/04 06:48:37  hal9
9421  Structural changes to allow for conditional inclusion/exclusion of content
9422  based on entity toggles, e.g. 'entity % p-not-stable  "INCLUDE"'. And
9423  definition of internal entities, e.g. 'entity p-version "2.9.13"' that will
9424  eventually be set by Makefile.
9425  More boilerplate text for use across multiple docs.
9426
9427  Revision 1.65  2002/04/03 19:52:07  swa
9428  enhance squid section due to user suggestion
9429
9430  Revision 1.64  2002/04/03 03:53:43  hal9
9431  A few minor bug fixes, and touch ups. Ready for review.
9432
9433  Revision 1.63  2002/04/01 16:24:49  hal9
9434  Define entities to include boilerplate text. See doc/source/*.
9435
9436  Revision 1.62  2002/03/30 04:15:53  hal9
9437  - Fix privoxy.org/config links.
9438  - Paste in Bookmarklets from Toggle page.
9439  - Move Quickstart nearer top, and minor rework.
9440
9441  Revision 1.61  2002/03/29 01:31:08  hal9
9442  Minor update.
9443
9444  Revision 1.60  2002/03/27 01:57:34  hal9
9445  Added more to Anatomy section.
9446
9447  Revision 1.59  2002/03/27 00:54:33  hal9
9448  Touch up intro for new name.
9449
9450  Revision 1.58  2002/03/26 22:29:55  swa
9451  we have a new homepage!
9452
9453  Revision 1.57  2002/03/24 20:33:30  hal9
9454  A few minor catch ups with name change.
9455
9456  Revision 1.56  2002/03/24 16:17:06  swa
9457  configure needs to be generated.
9458
9459  Revision 1.55  2002/03/24 16:08:08  swa
9460  we are too lazy to make a block-built
9461  privoxy logo. hence removed the option.
9462
9463  Revision 1.54  2002/03/24 15:46:20  swa
9464  name change related issue.
9465
9466  Revision 1.53  2002/03/24 11:51:00  swa
9467  name change. changed filenames.
9468
9469  Revision 1.52  2002/03/24 11:01:06  swa
9470  name change
9471
9472  Revision 1.51  2002/03/23 15:13:11  swa
9473  renamed every reference to the old name with foobar.
9474  fixed "application foobar application" tag, fixed
9475  "the foobar" with "foobar". left junkbustser in cvs
9476  comments and remarks to history untouched.
9477
9478  Revision 1.50  2002/03/23 05:06:21  hal9
9479  Touch up.
9480
9481  Revision 1.49  2002/03/21 17:01:05  hal9
9482  New section in Appendix.
9483
9484  Revision 1.48  2002/03/12 06:33:01  hal9
9485  Catching up to Andreas and re_filterfile changes.
9486
9487  Revision 1.47  2002/03/11 13:13:27  swa
9488  correct feedback channels
9489
9490  Revision 1.46  2002/03/10 00:51:08  hal9
9491  Added section on JB internal pages in Appendix.
9492
9493  Revision 1.45  2002/03/09 17:43:53  swa
9494  more distros
9495
9496  Revision 1.44  2002/03/09 17:08:48  hal9
9497  New section on Jon's actions file editor, and move some stuff around.
9498
9499  Revision 1.43  2002/03/08 00:47:32  hal9
9500  Added imageblock{pattern}.
9501
9502  Revision 1.42  2002/03/07 18:16:55  swa
9503  looks better
9504
9505  Revision 1.41  2002/03/07 16:46:43  hal9
9506  Fix a few markup problems for jade.
9507
9508  Revision 1.40  2002/03/07 16:28:39  swa
9509  provide correct feedback channels
9510
9511  Revision 1.39  2002/03/06 16:19:28  hal9
9512  Note on perceived filtering slowdown per FR.
9513
9514  Revision 1.38  2002/03/05 23:55:14  hal9
9515  Stupid I did it again. Double hyphen in comment breaks jade.
9516
9517  Revision 1.37  2002/03/05 23:53:49  hal9
9518  jade barfs on '- -' embedded in comments. - -user option broke it.
9519
9520  Revision 1.36  2002/03/05 22:53:28  hal9
9521  Add new - - user option.
9522
9523  Revision 1.35  2002/03/05 00:17:27  hal9
9524  Added section on command line options.
9525
9526  Revision 1.34  2002/03/04 19:32:07  oes
9527  Changed default port to 8118
9528
9529  Revision 1.33  2002/03/03 19:46:13  hal9
9530  Emphasis on where/how to report bugs, etc
9531
9532  Revision 1.32  2002/03/03 09:26:06  joergs
9533  AmigaOS changes, config is now loaded from PROGDIR: instead of
9534  AmiTCP:db/junkbuster/ if no configuration file is specified on the
9535  command line.
9536
9537  Revision 1.31  2002/03/02 22:45:52  david__schmidt
9538  Just tweaking
9539
9540  Revision 1.30  2002/03/02 22:00:14  hal9
9541  Updated 'New Features' list. Ran through spell-checker.
9542
9543  Revision 1.29  2002/03/02 20:34:07  david__schmidt
9544  Update OS/2 build section
9545
9546  Revision 1.28  2002/02/24 14:34:24  jongfoster
9547  Formatting changes.  Now changing the doctype to DocBook XML 4.1
9548  will work - no other changes are needed.
9549
9550  Revision 1.27  2002/01/11 14:14:32  hal9
9551  Added a very short section on Templates
9552
9553  Revision 1.26  2002/01/09 20:02:50  hal9
9554  Fix bug re: auto-detect config file changes.
9555
9556  Revision 1.25  2002/01/09 18:20:30  hal9
9557  Touch ups for *.action files.
9558
9559  Revision 1.24  2001/12/02 01:13:42  hal9
9560  Fix typo.
9561
9562  Revision 1.23  2001/12/02 00:20:41  hal9
9563  Updates for recent changes.
9564
9565  Revision 1.22  2001/11/05 23:57:51  hal9
9566  Minor update for startup now daemon mode.
9567
9568  Revision 1.21  2001/10/31 21:11:03  hal9
9569  Correct 2 minor errors
9570
9571  Revision 1.18  2001/10/24 18:45:26  hal9
9572  *** empty log message ***
9573
9574  Revision 1.17  2001/10/24 17:10:55  hal9
9575  Catching up with Jon's recent work, and a few other things.
9576
9577  Revision 1.16  2001/10/21 17:19:21  swa
9578  wrong url in documentation
9579
9580  Revision 1.15  2001/10/14 23:46:24  hal9
9581  Various minor changes. Fleshed out SEE ALSO section.
9582
9583  Revision 1.13  2001/10/10 17:28:33  hal9
9584  Very minor changes.
9585
9586  Revision 1.12  2001/09/28 02:57:04  hal9
9587  Ditto :/
9588
9589  Revision 1.11  2001/09/28 02:25:20  hal9
9590  Ditto.
9591
9592  Revision 1.9  2001/09/27 23:50:29  hal9
9593  A few changes. A short section on regular expression in appendix.
9594
9595  Revision 1.8  2001/09/25 00:34:59  hal9
9596  Some additions, and re-arranging.
9597
9598  Revision 1.7  2001/09/24 14:31:36  hal9
9599  Diddling.
9600
9601  Revision 1.6  2001/09/24 14:10:32  hal9
9602  Including David's OS/2 installation instructions.
9603
9604  Revision 1.2  2001/09/13 15:27:40  swa
9605  cosmetics
9606
9607  Revision 1.1  2001/09/12 15:36:41  swa
9608  source files for junkbuster documentation
9609
9610  Revision 1.3  2001/09/10 17:43:59  swa
9611  first proposal of a structure.
9612
9613  Revision 1.2  2001/06/13 14:28:31  swa
9614  docs should have an author.
9615
9616  Revision 1.1  2001/06/13 14:20:37  swa
9617  first import of project's documentation for the webserver.
9618
9619  -->
9620
9621 </article>