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