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