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