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