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