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