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