Regenerate with recent match-all.action-related changes.
[privoxy.git] / doc / webserver / user-manual / actions-file.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Actions Files</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="Privoxy 3.0.11 User Manual"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="The Main Configuration File"
14 HREF="config.html"><LINK
15 REL="NEXT"
16 TITLE="Filter Files"
17 HREF="filter-file.html"><LINK
18 REL="STYLESHEET"
19 TYPE="text/css"
20 HREF="../p_doc.css"><META
21 HTTP-EQUIV="Content-Type"
22 CONTENT="text/html;
23 charset=ISO-8859-1">
24 <LINK REL="STYLESHEET" TYPE="text/css" HREF="p_doc.css">
25 </head
26 ><BODY
27 CLASS="SECT1"
28 BGCOLOR="#EEEEEE"
29 TEXT="#000000"
30 LINK="#0000FF"
31 VLINK="#840084"
32 ALINK="#0000FF"
33 ><DIV
34 CLASS="NAVHEADER"
35 ><TABLE
36 SUMMARY="Header navigation table"
37 WIDTH="100%"
38 BORDER="0"
39 CELLPADDING="0"
40 CELLSPACING="0"
41 ><TR
42 ><TH
43 COLSPAN="3"
44 ALIGN="center"
45 >Privoxy 3.0.11 User Manual</TH
46 ></TR
47 ><TR
48 ><TD
49 WIDTH="10%"
50 ALIGN="left"
51 VALIGN="bottom"
52 ><A
53 HREF="config.html"
54 ACCESSKEY="P"
55 >Prev</A
56 ></TD
57 ><TD
58 WIDTH="80%"
59 ALIGN="center"
60 VALIGN="bottom"
61 ></TD
62 ><TD
63 WIDTH="10%"
64 ALIGN="right"
65 VALIGN="bottom"
66 ><A
67 HREF="filter-file.html"
68 ACCESSKEY="N"
69 >Next</A
70 ></TD
71 ></TR
72 ></TABLE
73 ><HR
74 ALIGN="LEFT"
75 WIDTH="100%"></DIV
76 ><DIV
77 CLASS="SECT1"
78 ><H1
79 CLASS="SECT1"
80 ><A
81 NAME="ACTIONS-FILE"
82 >8. Actions Files</A
83 ></H1
84 ><P
85 > The actions files are used to define what <SPAN
86 CLASS="emphasis"
87 ><I
88 CLASS="EMPHASIS"
89 >actions</I
90 ></SPAN
91 >
92  <SPAN
93 CLASS="APPLICATION"
94 >Privoxy</SPAN
95 > takes for which URLs, and thus determines
96  how ad images, cookies and various other aspects of HTTP content and
97  transactions are handled, and on which sites (or even parts thereof). 
98  There are a number of such actions, with a wide range of functionality.
99  Each action does something a little different.
100  These actions give us a veritable arsenal of tools with which to exert 
101  our control, preferences and independence. Actions can be combined so that 
102  their effects are aggregated when applied against a given set of URLs.</P
103 ><P
104 > There 
105  are three action files included with <SPAN
106 CLASS="APPLICATION"
107 >Privoxy</SPAN
108 > with
109  differing purposes:</P
110 ><P
111 > <P
112 ></P
113 ><UL
114 ><LI
115 ><P
116 >    <TT
117 CLASS="FILENAME"
118 >match-all.action</TT
119 > - is used to define which
120     <SPAN
121 CLASS="QUOTE"
122 >"actions"</SPAN
123 > relating to banner-blocking, images, pop-ups,
124     content modification, cookie handling etc should be applied by default.
125     It should be the first actions file loaded
126    </P
127 ></LI
128 ><LI
129 ><P
130 >    <TT
131 CLASS="FILENAME"
132 >default.action</TT
133 > - defines many exceptions (both
134     positive and negative) from the default set of actions that's configured
135     in <TT
136 CLASS="FILENAME"
137 >match-all.action</TT
138 >. It is a set of rules that should
139     work reasonably well as-is for most users. This file is only supposed to
140     be edited by the developers. It should be the second actions file loaded.
141    </P
142 ></LI
143 ><LI
144 ><P
145 >    <TT
146 CLASS="FILENAME"
147 >user.action</TT
148 > - is intended to be for local site 
149     preferences and exceptions. As an example, if your ISP or your bank
150     has specific requirements, and need special handling, this kind of 
151     thing should go here. This file will not be upgraded.
152    </P
153 ></LI
154 ><LI
155 ><P
156 >    <SPAN
157 CLASS="GUIBUTTON"
158 >Edit</SPAN
159 >  <SPAN
160 CLASS="GUIBUTTON"
161 >Set to Cautious</SPAN
162 > <SPAN
163 CLASS="GUIBUTTON"
164 >Set to Medium</SPAN
165 >  <SPAN
166 CLASS="GUIBUTTON"
167 >Set to Advanced</SPAN
168 >
169    </P
170 ><P
171 >    These have increasing levels of aggressiveness <SPAN
172 CLASS="emphasis"
173 ><I
174 CLASS="EMPHASIS"
175 >and have no
176     influence on your browsing unless you select them explicitly in the
177     editor</I
178 ></SPAN
179 >. A default installation should be pre-set to 
180     <TT
181 CLASS="LITERAL"
182 >Cautious</TT
183 >. New users should try this for a while before
184     adjusting the settings to more aggressive levels. The more aggressive 
185     the settings, then the more likelihood there is of problems such as sites 
186     not working as they should.
187    </P
188 ><P
189 >    The <SPAN
190 CLASS="GUIBUTTON"
191 >Edit</SPAN
192 > button allows you to turn each 
193     action on/off individually for fine-tuning. The <SPAN
194 CLASS="GUIBUTTON"
195 >Cautious</SPAN
196 >
197     button changes the actions list to low/safe settings which will activate 
198     ad blocking and a minimal set of <SPAN
199 CLASS="APPLICATION"
200 >Privoxy</SPAN
201 >'s features, and subsequently
202     there will be less of a chance for accidental problems. The
203     <SPAN
204 CLASS="GUIBUTTON"
205 >Medium</SPAN
206 > button sets the list to a medium level of
207     other features and a low level set of privacy features. The
208     <SPAN
209 CLASS="GUIBUTTON"
210 >Advanced</SPAN
211 > button sets the list to a high level of
212     ad blocking and medium level of privacy. See the chart below. The latter
213     three buttons over-ride any changes via with the
214     <SPAN
215 CLASS="GUIBUTTON"
216 >Edit</SPAN
217 > button. More fine-tuning can be done in the
218     lower sections of this internal page.
219    </P
220 ><P
221 >    While the actions file editor allows to enable these settings in all
222     actions files, they are only supposed to be enabled in the first one
223     to make sure you don't unintentionally overrule earlier rules.
224    </P
225 ><P
226 >    The default profiles, and their associated actions, as pre-defined in
227     <TT
228 CLASS="FILENAME"
229 >default.action</TT
230 > are:
231    </P
232 ><P
233 >    <DIV
234 CLASS="TABLE"
235 ><A
236 NAME="AEN2166"
237 ></A
238 ><P
239 ><B
240 >Table 1. Default Configurations</B
241 ></P
242 ><TABLE
243 BORDER="1"
244 FRAME="border"
245 RULES="all"
246 CLASS="CALSTABLE"
247 ><COL
248 WIDTH="1*"
249 TITLE="C1"><COL
250 WIDTH="1*"
251 TITLE="C2"><COL
252 WIDTH="1*"
253 TITLE="C3"><COL
254 WIDTH="1*"
255 TITLE="C4"><THEAD
256 ><TR
257 ><TH
258 >Feature</TH
259 ><TH
260 >Cautious</TH
261 ><TH
262 >Medium</TH
263 ><TH
264 >Advanced</TH
265 ></TR
266 ></THEAD
267 ><TBODY
268 ><TR
269 ><TD
270 >Ad-blocking Aggressiveness</TD
271 ><TD
272 >medium</TD
273 ><TD
274 >high</TD
275 ><TD
276 >high</TD
277 ></TR
278 ><TR
279 ><TD
280 >Ad-filtering by size</TD
281 ><TD
282 >no</TD
283 ><TD
284 >yes</TD
285 ><TD
286 >yes</TD
287 ></TR
288 ><TR
289 ><TD
290 >Ad-filtering by link</TD
291 ><TD
292 >no</TD
293 ><TD
294 >no</TD
295 ><TD
296 >yes</TD
297 ></TR
298 ><TR
299 ><TD
300 >Pop-up killing</TD
301 ><TD
302 >blocks only</TD
303 ><TD
304 >blocks only</TD
305 ><TD
306 >blocks only</TD
307 ></TR
308 ><TR
309 ><TD
310 >Privacy Features</TD
311 ><TD
312 >low</TD
313 ><TD
314 >medium</TD
315 ><TD
316 >medium/high</TD
317 ></TR
318 ><TR
319 ><TD
320 >Cookie handling</TD
321 ><TD
322 >none</TD
323 ><TD
324 >session-only</TD
325 ><TD
326 >kill</TD
327 ></TR
328 ><TR
329 ><TD
330 >Referer forging</TD
331 ><TD
332 >no</TD
333 ><TD
334 >yes</TD
335 ><TD
336 >yes</TD
337 ></TR
338 ><TR
339 ><TD
340 >GIF de-animation</TD
341 ><TD
342 >no</TD
343 ><TD
344 >yes</TD
345 ><TD
346 >yes</TD
347 ></TR
348 ><TR
349 ><TD
350 >Fast redirects</TD
351 ><TD
352 >no</TD
353 ><TD
354 >no</TD
355 ><TD
356 >yes</TD
357 ></TR
358 ><TR
359 ><TD
360 >HTML taming</TD
361 ><TD
362 >no</TD
363 ><TD
364 >no</TD
365 ><TD
366 >yes</TD
367 ></TR
368 ><TR
369 ><TD
370 >JavaScript taming</TD
371 ><TD
372 >no</TD
373 ><TD
374 >no</TD
375 ><TD
376 >yes</TD
377 ></TR
378 ><TR
379 ><TD
380 >Web-bug killing</TD
381 ><TD
382 >no</TD
383 ><TD
384 >yes</TD
385 ><TD
386 >yes</TD
387 ></TR
388 ><TR
389 ><TD
390 >Image tag reordering</TD
391 ><TD
392 >no</TD
393 ><TD
394 >yes</TD
395 ><TD
396 >yes</TD
397 ></TR
398 ></TBODY
399 ></TABLE
400 ></DIV
401 >
402     </P
403 ></LI
404 ></UL
405 ></P
406 ><P
407 > The list of actions files to be used are defined in the main configuration 
408  file, and are processed in the order they are defined (e.g.
409  <TT
410 CLASS="FILENAME"
411 >default.action</TT
412 > is typically processed before
413  <TT
414 CLASS="FILENAME"
415 >user.action</TT
416 >). The content of these can all be viewed and
417  edited from <A
418 HREF="http://config.privoxy.org/show-status"
419 TARGET="_top"
420 >http://config.privoxy.org/show-status</A
421 >.
422  The over-riding principle when applying actions, is that the last action that
423  matches a given URL wins. The broadest, most general rules go first
424  (defined in <TT
425 CLASS="FILENAME"
426 >default.action</TT
427 >),
428  followed by any exceptions (typically also in
429  <TT
430 CLASS="FILENAME"
431 >default.action</TT
432 >), which are then followed lastly by any
433  local preferences (typically in <SPAN
434 CLASS="emphasis"
435 ><I
436 CLASS="EMPHASIS"
437 >user</I
438 ></SPAN
439 ><TT
440 CLASS="FILENAME"
441 >.action</TT
442 >). 
443  Generally, <TT
444 CLASS="FILENAME"
445 >user.action</TT
446 > has the last word.
447  </P
448 ><P
449 > An actions file typically has multiple sections. If you want to use
450  <SPAN
451 CLASS="QUOTE"
452 >"aliases"</SPAN
453 > in an actions file, you have to place the (optional)
454  <A
455 HREF="actions-file.html#ALIASES"
456 >alias section</A
457 > at the top of that file.
458  Then comes the default set of rules which will apply universally to all
459  sites and pages (be <SPAN
460 CLASS="emphasis"
461 ><I
462 CLASS="EMPHASIS"
463 >very careful</I
464 ></SPAN
465 > with using such a
466  universal set in <TT
467 CLASS="FILENAME"
468 >user.action</TT
469 > or any other actions file after 
470  <TT
471 CLASS="FILENAME"
472 >default.action</TT
473 >, because it will override the result
474  from consulting any previous file). And then below that,
475  exceptions to the defined universal policies. You can regard
476  <TT
477 CLASS="FILENAME"
478 >user.action</TT
479 > as an appendix to <TT
480 CLASS="FILENAME"
481 >default.action</TT
482 >,
483  with the advantage that it is a separate file, which makes preserving your
484  personal settings across <SPAN
485 CLASS="APPLICATION"
486 >Privoxy</SPAN
487 > upgrades easier.</P
488 ><P
489
490  Actions can be used to block anything you want, including ads, banners, or
491  just some obnoxious URL whose content you would rather not see. Cookies can be accepted
492  or rejected, or accepted only during the current browser session (i.e. not
493  written to disk), content can be modified, some JavaScripts tamed, user-tracking
494  fooled, and much more. See below for a <A
495 HREF="actions-file.html#ACTIONS"
496 >complete list
497  of actions</A
498 >.</P
499 ><DIV
500 CLASS="SECT2"
501 ><H2
502 CLASS="SECT2"
503 ><A
504 NAME="AEN2265"
505 >8.1. Finding the Right Mix</A
506 ></H2
507 ><P
508 > Note that some <A
509 HREF="actions-file.html#ACTIONS"
510 >actions</A
511 >, like cookie suppression
512  or script disabling, may render some sites unusable that rely on these
513  techniques to work properly. Finding the right mix of actions is not always easy and
514  certainly a matter of personal taste. And, things can always change, requiring 
515  refinements in the configuration. In general, it can be said that the more
516  <SPAN
517 CLASS="QUOTE"
518 >"aggressive"</SPAN
519 > your default settings (in the top section of the
520  actions file) are, the more exceptions for <SPAN
521 CLASS="QUOTE"
522 >"trusted"</SPAN
523 > sites you
524  will have to make later. If, for example, you want to crunch all cookies per
525  default, you'll have to make exceptions from that rule for sites that you
526  regularly use and that require cookies for actually useful purposes, like maybe
527  your bank, favorite shop, or newspaper.</P
528 ><P
529 > We have tried to provide you with reasonable rules to start from in the
530  distribution actions files. But there is no general rule of thumb on these
531  things. There just are too many variables, and sites are constantly changing.
532  Sooner or later you will want to change the rules (and read this chapter again :).</P
533 ></DIV
534 ><DIV
535 CLASS="SECT2"
536 ><H2
537 CLASS="SECT2"
538 ><A
539 NAME="AEN2272"
540 >8.2. How to Edit</A
541 ></H2
542 ><P
543 > The easiest way to edit the actions files is with a browser by
544  using our browser-based editor, which can be reached from <A
545 HREF="http://config.privoxy.org/show-status"
546 TARGET="_top"
547 >http://config.privoxy.org/show-status</A
548 >.
549  Note: the config file option <A
550 HREF="config.html#ENABLE-EDIT-ACTIONS"
551 >enable-edit-actions</A
552 > must be enabled for
553  this to work. The editor allows both fine-grained control over every single
554  feature on a per-URL basis, and easy choosing from wholesale sets of defaults
555  like <SPAN
556 CLASS="QUOTE"
557 >"Cautious"</SPAN
558 >, <SPAN
559 CLASS="QUOTE"
560 >"Medium"</SPAN
561 > or
562  <SPAN
563 CLASS="QUOTE"
564 >"Advanced"</SPAN
565 >. Warning: the <SPAN
566 CLASS="QUOTE"
567 >"Advanced"</SPAN
568 > setting is more
569  aggressive, and will be more likely to cause problems for some sites.
570  Experienced users only! 
571  </P
572 ><P
573 > If you prefer plain text editing to GUIs, you can of course also directly edit the
574  the actions files with your favorite text editor. Look at
575  <TT
576 CLASS="FILENAME"
577 >default.action</TT
578 > which is richly commented with many 
579  good examples.</P
580 ></DIV
581 ><DIV
582 CLASS="SECT2"
583 ><H2
584 CLASS="SECT2"
585 ><A
586 NAME="ACTIONS-APPLY"
587 >8.3. How Actions are Applied to Requests</A
588 ></H2
589 ><P
590 > Actions files are divided into sections. There are special sections,
591  like the <SPAN
592 CLASS="QUOTE"
593 >"<A
594 HREF="actions-file.html#ALIASES"
595 >alias</A
596 >"</SPAN
597 > sections which will
598  be discussed later. For now let's concentrate on regular sections: They have a
599  heading line (often split up to multiple lines for readability) which consist
600  of a list of actions, separated by whitespace and enclosed in curly braces.
601  Below that, there is a list of URL and tag patterns, each on a separate line.</P
602 ><P
603 > To determine which actions apply to a request, the URL of the request is
604  compared to all URL patterns in each <SPAN
605 CLASS="QUOTE"
606 >"action file"</SPAN
607 >.
608  Every time it matches, the list of applicable actions for the request is
609  incrementally updated, using the heading of the section in which the
610  pattern is located. The same is done again for tags and tag patterns later on.</P
611 ><P
612 > If multiple applying sections set the same action differently,
613  the last match wins. If not, the effects are aggregated.
614  E.g. a URL might match a regular section with a heading line of <TT
615 CLASS="LITERAL"
616 >{ 
617  +<A
618 HREF="actions-file.html#HANDLE-AS-IMAGE"
619 >handle-as-image</A
620 > }</TT
621 >,
622  then later another one with just <TT
623 CLASS="LITERAL"
624 >{
625  +<A
626 HREF="actions-file.html#BLOCK"
627 >block</A
628 > }</TT
629 >, resulting
630  in <SPAN
631 CLASS="emphasis"
632 ><I
633 CLASS="EMPHASIS"
634 >both</I
635 ></SPAN
636 > actions to apply. And there may well be 
637  cases where you will want to combine actions together. Such a section then 
638  might look like:</P
639 ><P
640 > <TABLE
641 BORDER="0"
642 BGCOLOR="#E0E0E0"
643 WIDTH="100%"
644 ><TR
645 ><TD
646 ><PRE
647 CLASS="SCREEN"
648 >  { +<TT
649 CLASS="LITERAL"
650 >handle-as-image</TT
651 >  +<TT
652 CLASS="LITERAL"
653 >block{Banner ads.}</TT
654 > }
655   # Block these as if they were images. Send no block page.
656    banners.example.com
657    media.example.com/.*banners
658    .example.com/images/ads/</PRE
659 ></TD
660 ></TR
661 ></TABLE
662 >
663  </P
664 ><P
665 > You can trace this process for URL patterns and any given URL by visiting <A
666 HREF="http://config.privoxy.org/show-url-info"
667 TARGET="_top"
668 >http://config.privoxy.org/show-url-info</A
669 >.</P
670 ><P
671 > Examples and more detail on this is provided in the Appendix, <A
672 HREF="appendix.html#ACTIONSANAT"
673 > Troubleshooting: Anatomy of an Action</A
674 > section.</P
675 ></DIV
676 ><DIV
677 CLASS="SECT2"
678 ><H2
679 CLASS="SECT2"
680 ><A
681 NAME="AF-PATTERNS"
682 >8.4. Patterns</A
683 ></H2
684 ><P
685
686  As mentioned, <SPAN
687 CLASS="APPLICATION"
688 >Privoxy</SPAN
689 > uses <SPAN
690 CLASS="QUOTE"
691 >"patterns"</SPAN
692 >
693  to determine what <SPAN
694 CLASS="emphasis"
695 ><I
696 CLASS="EMPHASIS"
697 >actions</I
698 ></SPAN
699 > might apply to which sites and
700  pages your browser attempts to access. These <SPAN
701 CLASS="QUOTE"
702 >"patterns"</SPAN
703 > use wild
704  card type <SPAN
705 CLASS="emphasis"
706 ><I
707 CLASS="EMPHASIS"
708 >pattern</I
709 ></SPAN
710 > matching to achieve a high degree of
711  flexibility. This allows one expression to be expanded and potentially match
712  against many similar patterns.</P
713 ><P
714 > Generally, an URL pattern has the form
715  <TT
716 CLASS="LITERAL"
717 >&#60;domain&#62;/&#60;path&#62;</TT
718 >, where both the
719  <TT
720 CLASS="LITERAL"
721 >&#60;domain&#62;</TT
722 > and <TT
723 CLASS="LITERAL"
724 >&#60;path&#62;</TT
725 > are
726  optional. (This is why the special <TT
727 CLASS="LITERAL"
728 >/</TT
729 > pattern matches all
730  URLs). Note that the protocol portion of the URL pattern (e.g.
731  <TT
732 CLASS="LITERAL"
733 >http://</TT
734 >) should <SPAN
735 CLASS="emphasis"
736 ><I
737 CLASS="EMPHASIS"
738 >not</I
739 ></SPAN
740 > be included in
741  the pattern. This is assumed already!</P
742 ><P
743 > The pattern matching syntax is different for the domain and path parts of
744  the URL. The domain part uses a simple globbing type matching technique, 
745  while the path part uses more flexible 
746  <A
747 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
748 TARGET="_top"
749 ><SPAN
750 CLASS="QUOTE"
751 >"Regular
752   Expressions"</SPAN
753 ></A
754 > (POSIX 1003.2).</P
755 ><P
756 ></P
757 ><DIV
758 CLASS="VARIABLELIST"
759 ><DL
760 ><DT
761 ><TT
762 CLASS="LITERAL"
763 >www.example.com/</TT
764 ></DT
765 ><DD
766 ><P
767 >    is a domain-only pattern and will match any request to <TT
768 CLASS="LITERAL"
769 >www.example.com</TT
770 >,
771     regardless of which document on that server is requested. So ALL pages in
772     this domain would be covered by the scope of this action. Note that a 
773     simple <TT
774 CLASS="LITERAL"
775 >example.com</TT
776 > is different and would NOT match.
777    </P
778 ></DD
779 ><DT
780 ><TT
781 CLASS="LITERAL"
782 >www.example.com</TT
783 ></DT
784 ><DD
785 ><P
786 >    means exactly the same. For domain-only patterns, the trailing <TT
787 CLASS="LITERAL"
788 >/</TT
789 > may
790     be omitted.
791    </P
792 ></DD
793 ><DT
794 ><TT
795 CLASS="LITERAL"
796 >www.example.com/index.html</TT
797 ></DT
798 ><DD
799 ><P
800 >    matches all the documents on <TT
801 CLASS="LITERAL"
802 >www.example.com</TT
803 >
804     whose name starts with <TT
805 CLASS="LITERAL"
806 >/index.html</TT
807 >.
808    </P
809 ></DD
810 ><DT
811 ><TT
812 CLASS="LITERAL"
813 >www.example.com/index.html$</TT
814 ></DT
815 ><DD
816 ><P
817 >    matches only the single document <TT
818 CLASS="LITERAL"
819 >/index.html</TT
820 >
821     on <TT
822 CLASS="LITERAL"
823 >www.example.com</TT
824 >.
825    </P
826 ></DD
827 ><DT
828 ><TT
829 CLASS="LITERAL"
830 >/index.html$</TT
831 ></DT
832 ><DD
833 ><P
834 >    matches the document <TT
835 CLASS="LITERAL"
836 >/index.html</TT
837 >, regardless of the domain,
838     i.e. on <SPAN
839 CLASS="emphasis"
840 ><I
841 CLASS="EMPHASIS"
842 >any</I
843 ></SPAN
844 > web server anywhere.
845    </P
846 ></DD
847 ><DT
848 ><TT
849 CLASS="LITERAL"
850 >index.html</TT
851 ></DT
852 ><DD
853 ><P
854 >    matches nothing, since it would be interpreted as a domain name and
855     there is no top-level domain called <TT
856 CLASS="LITERAL"
857 >.html</TT
858 >. So its 
859     a mistake.
860    </P
861 ></DD
862 ></DL
863 ></DIV
864 ><DIV
865 CLASS="SECT3"
866 ><H3
867 CLASS="SECT3"
868 ><A
869 NAME="AEN2363"
870 >8.4.1. The Domain Pattern</A
871 ></H3
872 ><P
873 > The matching of the domain part offers some flexible options: if the
874  domain starts or ends with a dot, it becomes unanchored at that end. 
875  For example:</P
876 ><P
877 ></P
878 ><DIV
879 CLASS="VARIABLELIST"
880 ><DL
881 ><DT
882 ><TT
883 CLASS="LITERAL"
884 >.example.com</TT
885 ></DT
886 ><DD
887 ><P
888 >    matches any domain with first-level domain <TT
889 CLASS="LITERAL"
890 >com</TT
891 >
892     and second-level domain <TT
893 CLASS="LITERAL"
894 >example</TT
895 >.
896     For example <TT
897 CLASS="LITERAL"
898 >www.example.com</TT
899 >,
900     <TT
901 CLASS="LITERAL"
902 >example.com</TT
903 > and <TT
904 CLASS="LITERAL"
905 >foo.bar.baz.example.com</TT
906 >.
907     Note that it wouldn't match if the second-level domain was <TT
908 CLASS="LITERAL"
909 >another-example</TT
910 >.
911    </P
912 ></DD
913 ><DT
914 ><TT
915 CLASS="LITERAL"
916 >www.</TT
917 ></DT
918 ><DD
919 ><P
920 >    matches any domain that <SPAN
921 CLASS="emphasis"
922 ><I
923 CLASS="EMPHASIS"
924 >STARTS</I
925 ></SPAN
926 > with
927     <TT
928 CLASS="LITERAL"
929 >www.</TT
930 > (It also matches the domain
931     <TT
932 CLASS="LITERAL"
933 >www</TT
934 > but most of the time that doesn't matter.)
935    </P
936 ></DD
937 ><DT
938 ><TT
939 CLASS="LITERAL"
940 >.example.</TT
941 ></DT
942 ><DD
943 ><P
944 >    matches any domain that <SPAN
945 CLASS="emphasis"
946 ><I
947 CLASS="EMPHASIS"
948 >CONTAINS</I
949 ></SPAN
950 > <TT
951 CLASS="LITERAL"
952 >.example.</TT
953 >.
954     And, by the way, also included would be any files or documents that exist
955     within that domain since no path limitations are specified. (Correctly
956     speaking: It matches any FQDN that contains <TT
957 CLASS="LITERAL"
958 >example</TT
959 > as
960     a domain.) This might be <TT
961 CLASS="LITERAL"
962 >www.example.com</TT
963 >,
964     <TT
965 CLASS="LITERAL"
966 >news.example.de</TT
967 >, or
968     <TT
969 CLASS="LITERAL"
970 >www.example.net/cgi/testing.pl</TT
971 > for instance. All these
972     cases are matched. 
973    </P
974 ></DD
975 ></DL
976 ></DIV
977 ><P
978 > Additionally, there are wild-cards that you can use in the domain names
979  themselves. These work similarly to shell globbing type wild-cards:
980  <SPAN
981 CLASS="QUOTE"
982 >"*"</SPAN
983 > represents zero or more arbitrary characters (this is
984  equivalent to the 
985  <A
986 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
987 TARGET="_top"
988 ><SPAN
989 CLASS="QUOTE"
990 >"Regular
991  Expression"</SPAN
992 ></A
993 > based syntax of <SPAN
994 CLASS="QUOTE"
995 >".*"</SPAN
996 >),
997  <SPAN
998 CLASS="QUOTE"
999 >"?"</SPAN
1000 >  represents any single character (this is equivalent to the
1001  regular expression syntax of a simple <SPAN
1002 CLASS="QUOTE"
1003 >"."</SPAN
1004 >), and you can define
1005  <SPAN
1006 CLASS="QUOTE"
1007 >"character classes"</SPAN
1008 > in square brackets which is similar to 
1009  the same regular expression technique. All of this can be freely mixed:</P
1010 ><P
1011 ></P
1012 ><DIV
1013 CLASS="VARIABLELIST"
1014 ><DL
1015 ><DT
1016 ><TT
1017 CLASS="LITERAL"
1018 >ad*.example.com</TT
1019 ></DT
1020 ><DD
1021 ><P
1022 >    matches <SPAN
1023 CLASS="QUOTE"
1024 >"adserver.example.com"</SPAN
1025 >, 
1026     <SPAN
1027 CLASS="QUOTE"
1028 >"ads.example.com"</SPAN
1029 >, etc but not <SPAN
1030 CLASS="QUOTE"
1031 >"sfads.example.com"</SPAN
1032 >
1033    </P
1034 ></DD
1035 ><DT
1036 ><TT
1037 CLASS="LITERAL"
1038 >*ad*.example.com</TT
1039 ></DT
1040 ><DD
1041 ><P
1042 >    matches all of the above, and then some.
1043    </P
1044 ></DD
1045 ><DT
1046 ><TT
1047 CLASS="LITERAL"
1048 >.?pix.com</TT
1049 ></DT
1050 ><DD
1051 ><P
1052 >    matches <TT
1053 CLASS="LITERAL"
1054 >www.ipix.com</TT
1055 >,
1056     <TT
1057 CLASS="LITERAL"
1058 >pictures.epix.com</TT
1059 >, <TT
1060 CLASS="LITERAL"
1061 >a.b.c.d.e.upix.com</TT
1062 > etc. 
1063    </P
1064 ></DD
1065 ><DT
1066 ><TT
1067 CLASS="LITERAL"
1068 >www[1-9a-ez].example.c*</TT
1069 ></DT
1070 ><DD
1071 ><P
1072 >     matches <TT
1073 CLASS="LITERAL"
1074 >www1.example.com</TT
1075 >, 
1076      <TT
1077 CLASS="LITERAL"
1078 >www4.example.cc</TT
1079 >, <TT
1080 CLASS="LITERAL"
1081 >wwwd.example.cy</TT
1082 >, 
1083      <TT
1084 CLASS="LITERAL"
1085 >wwwz.example.com</TT
1086 > etc., but <SPAN
1087 CLASS="emphasis"
1088 ><I
1089 CLASS="EMPHASIS"
1090 >not</I
1091 ></SPAN
1092
1093      <TT
1094 CLASS="LITERAL"
1095 >wwww.example.com</TT
1096 >.
1097    </P
1098 ></DD
1099 ></DL
1100 ></DIV
1101 ><P
1102 > While flexible, this is not the sophistication of full regular expression based syntax.</P
1103 ></DIV
1104 ><DIV
1105 CLASS="SECT3"
1106 ><H3
1107 CLASS="SECT3"
1108 ><A
1109 NAME="AEN2439"
1110 >8.4.2. The Path Pattern</A
1111 ></H3
1112 ><P
1113 > <SPAN
1114 CLASS="APPLICATION"
1115 >Privoxy</SPAN
1116 > uses <SPAN
1117 CLASS="QUOTE"
1118 >"modern"</SPAN
1119 > POSIX 1003.2
1120   <A
1121 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
1122 TARGET="_top"
1123 ><SPAN
1124 CLASS="QUOTE"
1125 >"Regular
1126   Expressions"</SPAN
1127 ></A
1128 > for matching the path portion (after the slash),
1129   and is thus more flexible.</P
1130 ><P
1131 > There is an <A
1132 HREF="appendix.html#REGEX"
1133 >Appendix</A
1134 > with a brief quick-start into regular
1135  expressions, you also might want to have a look at your operating system's documentation
1136  on regular expressions (try <TT
1137 CLASS="LITERAL"
1138 >man re_format</TT
1139 >).</P
1140 ><P
1141 > Note that the path pattern is automatically left-anchored at the <SPAN
1142 CLASS="QUOTE"
1143 >"/"</SPAN
1144 >,
1145  i.e. it matches as if it would start with a <SPAN
1146 CLASS="QUOTE"
1147 >"^"</SPAN
1148 > (regular expression speak 
1149  for the beginning of a line).</P
1150 ><P
1151 > Please also note that matching in the path is <SPAN
1152 CLASS="emphasis"
1153 ><I
1154 CLASS="EMPHASIS"
1155 >CASE INSENSITIVE</I
1156 ></SPAN
1157 >
1158  by default, but you can switch to case sensitive at any point in the pattern by using the 
1159  <SPAN
1160 CLASS="QUOTE"
1161 >"(?-i)"</SPAN
1162 > switch: <TT
1163 CLASS="LITERAL"
1164 >www.example.com/(?-i)PaTtErN.*</TT
1165 > will match
1166  only documents whose path starts with <TT
1167 CLASS="LITERAL"
1168 >PaTtErN</TT
1169 > in
1170  <SPAN
1171 CLASS="emphasis"
1172 ><I
1173 CLASS="EMPHASIS"
1174 >exactly</I
1175 ></SPAN
1176 > this capitalization.</P
1177 ><P
1178 ></P
1179 ><DIV
1180 CLASS="VARIABLELIST"
1181 ><DL
1182 ><DT
1183 ><TT
1184 CLASS="LITERAL"
1185 >.example.com/.*</TT
1186 ></DT
1187 ><DD
1188 ><P
1189 >     Is equivalent to just <SPAN
1190 CLASS="QUOTE"
1191 >".example.com"</SPAN
1192 >, since any documents 
1193      within that domain are matched with or without the <SPAN
1194 CLASS="QUOTE"
1195 >".*"</SPAN
1196 >
1197      regular expression. This is redundant
1198    </P
1199 ></DD
1200 ><DT
1201 ><TT
1202 CLASS="LITERAL"
1203 >.example.com/.*/index.html$</TT
1204 ></DT
1205 ><DD
1206 ><P
1207 >    Will match any page in the domain of <SPAN
1208 CLASS="QUOTE"
1209 >"example.com"</SPAN
1210 > that is
1211     named <SPAN
1212 CLASS="QUOTE"
1213 >"index.html"</SPAN
1214 >, and that is part of some path. For
1215     example, it matches <SPAN
1216 CLASS="QUOTE"
1217 >"www.example.com/testing/index.html"</SPAN
1218 > but
1219     NOT <SPAN
1220 CLASS="QUOTE"
1221 >"www.example.com/index.html"</SPAN
1222 > because the regular
1223     expression called for at least two <SPAN
1224 CLASS="QUOTE"
1225 >"/'s"</SPAN
1226 >, thus the path 
1227     requirement. It also would match 
1228     <SPAN
1229 CLASS="QUOTE"
1230 >"www.example.com/testing/index_html"</SPAN
1231 >, because of the 
1232     special meta-character <SPAN
1233 CLASS="QUOTE"
1234 >"."</SPAN
1235 >.
1236    </P
1237 ></DD
1238 ><DT
1239 ><TT
1240 CLASS="LITERAL"
1241 >.example.com/(.*/)?index\.html$</TT
1242 ></DT
1243 ><DD
1244 ><P
1245 >    This regular expression is conditional so it will match any page 
1246     named <SPAN
1247 CLASS="QUOTE"
1248 >"index.html"</SPAN
1249 > regardless of path which in this case can 
1250     have one or more <SPAN
1251 CLASS="QUOTE"
1252 >"/'s"</SPAN
1253 >. And this one must contain exactly 
1254     <SPAN
1255 CLASS="QUOTE"
1256 >".html"</SPAN
1257 > (but does not have to end with that!).
1258    </P
1259 ></DD
1260 ><DT
1261 ><TT
1262 CLASS="LITERAL"
1263 >.example.com/(.*/)(ads|banners?|junk)</TT
1264 ></DT
1265 ><DD
1266 ><P
1267 >    This regular expression will match any path of <SPAN
1268 CLASS="QUOTE"
1269 >"example.com"</SPAN
1270 >
1271     that contains any of the words <SPAN
1272 CLASS="QUOTE"
1273 >"ads"</SPAN
1274 >, <SPAN
1275 CLASS="QUOTE"
1276 >"banner"</SPAN
1277 >, 
1278     <SPAN
1279 CLASS="QUOTE"
1280 >"banners"</SPAN
1281 > (because of the <SPAN
1282 CLASS="QUOTE"
1283 >"?"</SPAN
1284 >) or <SPAN
1285 CLASS="QUOTE"
1286 >"junk"</SPAN
1287 >.
1288     The path does not have to end in these words, just contain them.
1289    </P
1290 ></DD
1291 ><DT
1292 ><TT
1293 CLASS="LITERAL"
1294 >.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</TT
1295 ></DT
1296 ><DD
1297 ><P
1298 >    This is very much the same as above, except now it must end in either 
1299     <SPAN
1300 CLASS="QUOTE"
1301 >".jpg"</SPAN
1302 >, <SPAN
1303 CLASS="QUOTE"
1304 >".jpeg"</SPAN
1305 >, <SPAN
1306 CLASS="QUOTE"
1307 >".gif"</SPAN
1308 > or <SPAN
1309 CLASS="QUOTE"
1310 >".png"</SPAN
1311 >. So this 
1312     one is limited to common image formats.
1313    </P
1314 ></DD
1315 ></DL
1316 ></DIV
1317 ><P
1318 > There are many, many good examples to be found in <TT
1319 CLASS="FILENAME"
1320 >default.action</TT
1321 >, 
1322  and more tutorials below in <A
1323 HREF="appendix.html#REGEX"
1324 >Appendix on regular expressions</A
1325 >.</P
1326 ></DIV
1327 ><DIV
1328 CLASS="SECT3"
1329 ><H3
1330 CLASS="SECT3"
1331 ><A
1332 NAME="TAG-PATTERN"
1333 >8.4.3. The Tag Pattern</A
1334 ></H3
1335 ><P
1336 > Tag patterns are used to change the applying actions based on the
1337  request's tags. Tags can be created with either the
1338  <A
1339 HREF="actions-file.html#CLIENT-HEADER-TAGGER"
1340 >client-header-tagger</A
1341 >
1342  or the  <A
1343 HREF="actions-file.html#SERVER-HEADER-TAGGER"
1344 >server-header-tagger</A
1345 > action.</P
1346 ><P
1347 > Tag patterns have to start with <SPAN
1348 CLASS="QUOTE"
1349 >"TAG:"</SPAN
1350 >, so <SPAN
1351 CLASS="APPLICATION"
1352 >Privoxy</SPAN
1353 >
1354  can tell them apart from URL patterns. Everything after the colon
1355  including white space, is interpreted as a regular expression with
1356  path pattern syntax, except that tag patterns aren't left-anchored
1357  automatically (<SPAN
1358 CLASS="APPLICATION"
1359 >Privoxy</SPAN
1360 > doesn't silently add a <SPAN
1361 CLASS="QUOTE"
1362 >"^"</SPAN
1363 >,
1364  you have to do it yourself if you need it).</P
1365 ><P
1366 > To match all requests that are tagged with <SPAN
1367 CLASS="QUOTE"
1368 >"foo"</SPAN
1369 >
1370  your pattern line should be <SPAN
1371 CLASS="QUOTE"
1372 >"TAG:^foo$"</SPAN
1373 >,
1374  <SPAN
1375 CLASS="QUOTE"
1376 >"TAG:foo"</SPAN
1377 > would work as well, but it would also
1378  match requests whose tags contain <SPAN
1379 CLASS="QUOTE"
1380 >"foo"</SPAN
1381 > somewhere.
1382  <SPAN
1383 CLASS="QUOTE"
1384 >"TAG: foo"</SPAN
1385 > wouldn't work as it requires white space.</P
1386 ><P
1387 > Sections can contain URL and tag patterns at the same time,
1388  but tag patterns are checked after the URL patterns and thus
1389  always overrule them, even if they are located before the URL patterns.</P
1390 ><P
1391 > Once a new tag is added, Privoxy checks right away if it's matched by one
1392  of the tag patterns and updates the action settings accordingly. As a result
1393  tags can be used to activate other tagger actions, as long as these other
1394  taggers look for headers that haven't already be parsed.</P
1395 ><P
1396 > For example you could tag client requests which use the
1397  <TT
1398 CLASS="LITERAL"
1399 >POST</TT
1400 > method,
1401  then use this tag to activate another tagger that adds a tag if cookies
1402  are sent, and then use a block action based on the cookie tag. This allows
1403  the outcome of one action, to be input into a subsequent action. However if
1404  you'd reverse the position of the described taggers, and activated the
1405  method tagger based on the cookie tagger, no method tags would be created.
1406  The method tagger would look for the request line, but at the time
1407  the cookie tag is created, the request line has already been parsed.</P
1408 ><P
1409 > While this is a limitation you should be aware of, this kind of
1410  indirection is seldom needed anyway and even the example doesn't
1411  make too much sense.</P
1412 ></DIV
1413 ></DIV
1414 ><DIV
1415 CLASS="SECT2"
1416 ><H2
1417 CLASS="SECT2"
1418 ><A
1419 NAME="ACTIONS"
1420 >8.5. Actions</A
1421 ></H2
1422 ><P
1423 > All actions are disabled by default, until they are explicitly enabled
1424  somewhere in an actions file. Actions are turned on if preceded with a
1425  <SPAN
1426 CLASS="QUOTE"
1427 >"+"</SPAN
1428 >, and turned off if preceded with a <SPAN
1429 CLASS="QUOTE"
1430 >"-"</SPAN
1431 >. So a
1432  <TT
1433 CLASS="LITERAL"
1434 >+action</TT
1435 > means <SPAN
1436 CLASS="QUOTE"
1437 >"do that action"</SPAN
1438 >, e.g.
1439  <TT
1440 CLASS="LITERAL"
1441 >+block</TT
1442 > means <SPAN
1443 CLASS="QUOTE"
1444 >"please block URLs that match the
1445  following patterns"</SPAN
1446 >, and <TT
1447 CLASS="LITERAL"
1448 >-block</TT
1449 > means <SPAN
1450 CLASS="QUOTE"
1451 >"don't
1452  block URLs that match the following patterns, even if <TT
1453 CLASS="LITERAL"
1454 >+block</TT
1455 >
1456  previously applied."</SPAN
1457 >&#13;</P
1458 ><P
1459
1460  Again, actions are invoked by placing them on a line, enclosed in curly braces and
1461  separated by whitespace, like in 
1462  <TT
1463 CLASS="LITERAL"
1464 >{+some-action -some-other-action{some-parameter}}</TT
1465 >,
1466  followed by a list of URL patterns, one per line, to which they apply.
1467  Together, the actions line and the following pattern lines make up a section
1468  of the actions file. </P
1469 ><P
1470
1471  Actions fall into three categories:</P
1472 ><P
1473 > <P
1474 ></P
1475 ><UL
1476 ><LI
1477 ><P
1478 >  
1479    Boolean, i.e the action can only be <SPAN
1480 CLASS="QUOTE"
1481 >"enabled"</SPAN
1482 > or
1483    <SPAN
1484 CLASS="QUOTE"
1485 >"disabled"</SPAN
1486 >. Syntax:
1487   </P
1488 ><P
1489 >   <TABLE
1490 BORDER="0"
1491 BGCOLOR="#E0E0E0"
1492 WIDTH="90%"
1493 ><TR
1494 ><TD
1495 ><PRE
1496 CLASS="SCREEN"
1497 >  +<TT
1498 CLASS="REPLACEABLE"
1499 ><I
1500 >name</I
1501 ></TT
1502 >        # enable action <TT
1503 CLASS="REPLACEABLE"
1504 ><I
1505 >name</I
1506 ></TT
1507 >
1508   -<TT
1509 CLASS="REPLACEABLE"
1510 ><I
1511 >name</I
1512 ></TT
1513 >        # disable action <TT
1514 CLASS="REPLACEABLE"
1515 ><I
1516 >name</I
1517 ></TT
1518 ></PRE
1519 ></TD
1520 ></TR
1521 ></TABLE
1522 >
1523   </P
1524 ><P
1525 >  
1526    Example: <TT
1527 CLASS="LITERAL"
1528 >+handle-as-image</TT
1529 >
1530   </P
1531 ></LI
1532 ><LI
1533 ><P
1534 >  
1535    Parameterized, where some value is required in order to enable this type of action.
1536    Syntax:
1537   </P
1538 ><P
1539 >   <TABLE
1540 BORDER="0"
1541 BGCOLOR="#E0E0E0"
1542 WIDTH="90%"
1543 ><TR
1544 ><TD
1545 ><PRE
1546 CLASS="SCREEN"
1547 >  +<TT
1548 CLASS="REPLACEABLE"
1549 ><I
1550 >name</I
1551 ></TT
1552 >{<TT
1553 CLASS="REPLACEABLE"
1554 ><I
1555 >param</I
1556 ></TT
1557 >}  # enable action and set parameter to <TT
1558 CLASS="REPLACEABLE"
1559 ><I
1560 >param</I
1561 ></TT
1562 >,
1563                # overwriting parameter from previous match if necessary
1564   -<TT
1565 CLASS="REPLACEABLE"
1566 ><I
1567 >name</I
1568 ></TT
1569 >         # disable action. The parameter can be omitted</PRE
1570 ></TD
1571 ></TR
1572 ></TABLE
1573 >
1574   </P
1575 ><P
1576 >   Note that if the URL matches multiple positive forms of a parameterized action,
1577    the last match wins, i.e. the params from earlier matches are simply ignored.
1578   </P
1579 ><P
1580 >  
1581    Example: <TT
1582 CLASS="LITERAL"
1583 >+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4}</TT
1584 >
1585   </P
1586 ></LI
1587 ><LI
1588 ><P
1589 >  
1590    Multi-value. These look exactly like parameterized actions,
1591    but they behave differently: If the action applies multiple times to the
1592    same URL, but with different parameters, <SPAN
1593 CLASS="emphasis"
1594 ><I
1595 CLASS="EMPHASIS"
1596 >all</I
1597 ></SPAN
1598 > the parameters
1599    from <SPAN
1600 CLASS="emphasis"
1601 ><I
1602 CLASS="EMPHASIS"
1603 >all</I
1604 ></SPAN
1605 > matches are remembered. This is used for actions
1606    that can be executed for the same request repeatedly, like adding multiple
1607    headers, or filtering through multiple filters. Syntax:
1608   </P
1609 ><P
1610 >   <TABLE
1611 BORDER="0"
1612 BGCOLOR="#E0E0E0"
1613 WIDTH="90%"
1614 ><TR
1615 ><TD
1616 ><PRE
1617 CLASS="SCREEN"
1618 >  +<TT
1619 CLASS="REPLACEABLE"
1620 ><I
1621 >name</I
1622 ></TT
1623 >{<TT
1624 CLASS="REPLACEABLE"
1625 ><I
1626 >param</I
1627 ></TT
1628 >}   # enable action and add <TT
1629 CLASS="REPLACEABLE"
1630 ><I
1631 >param</I
1632 ></TT
1633 > to the list of parameters
1634   -<TT
1635 CLASS="REPLACEABLE"
1636 ><I
1637 >name</I
1638 ></TT
1639 >{<TT
1640 CLASS="REPLACEABLE"
1641 ><I
1642 >param</I
1643 ></TT
1644 >}   # remove the parameter <TT
1645 CLASS="REPLACEABLE"
1646 ><I
1647 >param</I
1648 ></TT
1649 > from the list of parameters
1650                 # If it was the last one left, disable the action.
1651   <TT
1652 CLASS="REPLACEABLE"
1653 ><I
1654 >-name</I
1655 ></TT
1656 >          # disable this action completely and remove all parameters from the list</PRE
1657 ></TD
1658 ></TR
1659 ></TABLE
1660 >
1661   </P
1662 ><P
1663 >  
1664    Examples: <TT
1665 CLASS="LITERAL"
1666 >+add-header{X-Fun-Header: Some text}</TT
1667 > and
1668    <TT
1669 CLASS="LITERAL"
1670 >+filter{html-annoyances}</TT
1671 >
1672   </P
1673 ></LI
1674 ></UL
1675 ></P
1676 ><P
1677 > If nothing is specified in any actions file, no <SPAN
1678 CLASS="QUOTE"
1679 >"actions"</SPAN
1680 > are
1681  taken. So in this case <SPAN
1682 CLASS="APPLICATION"
1683 >Privoxy</SPAN
1684 > would just be a
1685  normal, non-blocking, non-filtering proxy. You must specifically enable the
1686  privacy and blocking features you need (although the provided default actions
1687  files will give a good starting point).</P
1688 ><P
1689 > Later defined action sections always over-ride earlier ones of the same type.
1690  So exceptions to any rules you make, should come in the latter part of the file (or 
1691  in a file that is processed later when using multiple actions files such 
1692  as <TT
1693 CLASS="FILENAME"
1694 >user.action</TT
1695 >). For multi-valued actions, the actions
1696  are applied in the order they are specified. Actions files are processed in
1697  the order they are defined in <TT
1698 CLASS="FILENAME"
1699 >config</TT
1700 > (the default
1701  installation has three actions files). It also quite possible for any given
1702  URL to match more than one <SPAN
1703 CLASS="QUOTE"
1704 >"pattern"</SPAN
1705 > (because of wildcards and
1706  regular expressions), and thus to trigger more than one set of actions! Last
1707  match wins.</P
1708 ><P
1709 > The list of valid <SPAN
1710 CLASS="APPLICATION"
1711 >Privoxy</SPAN
1712 > actions are:</P
1713 ><DIV
1714 CLASS="SECT3"
1715 ><H4
1716 CLASS="SECT3"
1717 ><A
1718 NAME="ADD-HEADER"
1719 >8.5.1. add-header</A
1720 ></H4
1721 ><P
1722 ></P
1723 ><DIV
1724 CLASS="VARIABLELIST"
1725 ><DL
1726 ><DT
1727 >Typical use:</DT
1728 ><DD
1729 ><P
1730 >Confuse log analysis, custom applications</P
1731 ></DD
1732 ><DT
1733 >Effect:</DT
1734 ><DD
1735 ><P
1736 >    Sends a user defined HTTP header to the web server.
1737    </P
1738 ></DD
1739 ><DT
1740 >Type:</DT
1741 ><DD
1742 ><P
1743 >Multi-value.</P
1744 ></DD
1745 ><DT
1746 >Parameter:</DT
1747 ><DD
1748 ><P
1749 >    Any string value is possible. Validity of the defined HTTP headers is not checked.
1750     It is recommended that you use the <SPAN
1751 CLASS="QUOTE"
1752 >"<TT
1753 CLASS="LITERAL"
1754 >X-</TT
1755 >"</SPAN
1756 > prefix
1757     for custom headers.
1758    </P
1759 ></DD
1760 ><DT
1761 >Notes:</DT
1762 ><DD
1763 ><P
1764 >    This action may be specified multiple times, in order to define multiple 
1765     headers. This is rarely needed for the typical user. If you don't know what 
1766     <SPAN
1767 CLASS="QUOTE"
1768 >"HTTP headers"</SPAN
1769 > are, you definitely don't need to worry about this 
1770     one.
1771    </P
1772 ></DD
1773 ><DT
1774 >Example usage:</DT
1775 ><DD
1776 ><P
1777 >     <TABLE
1778 BORDER="0"
1779 BGCOLOR="#E0E0E0"
1780 WIDTH="90%"
1781 ><TR
1782 ><TD
1783 ><PRE
1784 CLASS="SCREEN"
1785 >+add-header{X-User-Tracking: sucks}</PRE
1786 ></TD
1787 ></TR
1788 ></TABLE
1789 >
1790    </P
1791 ></DD
1792 ></DL
1793 ></DIV
1794 ></DIV
1795 ><DIV
1796 CLASS="SECT3"
1797 ><H4
1798 CLASS="SECT3"
1799 ><A
1800 NAME="BLOCK"
1801 >8.5.2. block</A
1802 ></H4
1803 ><P
1804 ></P
1805 ><DIV
1806 CLASS="VARIABLELIST"
1807 ><DL
1808 ><DT
1809 >Typical use:</DT
1810 ><DD
1811 ><P
1812 >Block ads or other unwanted content</P
1813 ></DD
1814 ><DT
1815 >Effect:</DT
1816 ><DD
1817 ><P
1818 >    Requests for URLs to which this action applies are blocked, i.e. the
1819     requests are trapped by <SPAN
1820 CLASS="APPLICATION"
1821 >Privoxy</SPAN
1822 > and the requested URL is never retrieved,
1823     but is answered locally with a substitute page or image, as determined by
1824     the <TT
1825 CLASS="LITERAL"
1826 ><A
1827 HREF="actions-file.html#HANDLE-AS-IMAGE"
1828 >handle-as-image</A
1829 ></TT
1830 >,
1831     <TT
1832 CLASS="LITERAL"
1833 ><A
1834 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1835 >set-image-blocker</A
1836 ></TT
1837 >, and 
1838     <TT
1839 CLASS="LITERAL"
1840 ><A
1841 HREF="actions-file.html#HANDLE-AS-EMPTY-DOCUMENT"
1842 >handle-as-empty-document</A
1843 ></TT
1844 > actions.
1845     
1846    </P
1847 ></DD
1848 ><DT
1849 >Type:</DT
1850 ><DD
1851 ><P
1852 >Parameterized.</P
1853 ></DD
1854 ><DT
1855 >Parameter:</DT
1856 ><DD
1857 ><P
1858 >A block reason that should be given to the user.</P
1859 ></DD
1860 ><DT
1861 >Notes:</DT
1862 ><DD
1863 ><P
1864 >    <SPAN
1865 CLASS="APPLICATION"
1866 >Privoxy</SPAN
1867 > sends a special <SPAN
1868 CLASS="QUOTE"
1869 >"BLOCKED"</SPAN
1870 > page
1871     for requests to blocked pages. This page contains the block reason given as
1872     parameter, a link to find out why the block action applies, and a click-through
1873     to the blocked content (the latter only if the force feature is available and
1874     enabled).
1875    </P
1876 ><P
1877
1878     A very important exception occurs if <SPAN
1879 CLASS="emphasis"
1880 ><I
1881 CLASS="EMPHASIS"
1882 >both</I
1883 ></SPAN
1884
1885     <TT
1886 CLASS="LITERAL"
1887 >block</TT
1888 > and <TT
1889 CLASS="LITERAL"
1890 ><A
1891 HREF="actions-file.html#HANDLE-AS-IMAGE"
1892 >handle-as-image</A
1893 ></TT
1894 >,
1895     apply to the same request: it will then be replaced by an image. If 
1896     <TT
1897 CLASS="LITERAL"
1898 ><A
1899 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1900 >set-image-blocker</A
1901 ></TT
1902 >
1903     (see below) also applies, the type of image will be determined by its parameter,
1904     if not, the standard checkerboard pattern is sent.
1905    </P
1906 ><P
1907 >    It is important to understand this process, in order 
1908     to understand how <SPAN
1909 CLASS="APPLICATION"
1910 >Privoxy</SPAN
1911 > deals with 
1912     ads and other unwanted content. Blocking is a core feature, and one 
1913     upon which various other features depend.
1914    </P
1915 ><P
1916 >    The <TT
1917 CLASS="LITERAL"
1918 ><A
1919 HREF="actions-file.html#FILTER"
1920 >filter</A
1921 ></TT
1922 >
1923     action can perform a very similar task, by <SPAN
1924 CLASS="QUOTE"
1925 >"blocking"</SPAN
1926 >
1927     banner images and other content through rewriting the relevant URLs in the
1928     document's HTML source, so they don't get requested in the first place.
1929     Note that this is a totally different technique, and it's easy to confuse the two.
1930    </P
1931 ></DD
1932 ><DT
1933 >Example usage (section):</DT
1934 ><DD
1935 ><P
1936 >     <TABLE
1937 BORDER="0"
1938 BGCOLOR="#E0E0E0"
1939 WIDTH="90%"
1940 ><TR
1941 ><TD
1942 ><PRE
1943 CLASS="SCREEN"
1944 >{+block{No nasty stuff for you.}}
1945 # Block and replace with "blocked" page
1946  .nasty-stuff.example.com
1947
1948 {+block{Doubleclick banners.} +handle-as-image} 
1949 # Block and replace with image
1950  .ad.doubleclick.net
1951  .ads.r.us/banners/
1952
1953 {+block{Layered ads.} +handle-as-empty-document} 
1954 # Block and then ignore
1955  adserver.example.net/.*\.js$</PRE
1956 ></TD
1957 ></TR
1958 ></TABLE
1959 >
1960     </P
1961 ></DD
1962 ></DL
1963 ></DIV
1964 ></DIV
1965 ><DIV
1966 CLASS="SECT3"
1967 ><H4
1968 CLASS="SECT3"
1969 ><A
1970 NAME="CHANGE-X-FORWARDED-FOR"
1971 >8.5.3. change-x-forwarded-for</A
1972 ></H4
1973 ><P
1974 ></P
1975 ><DIV
1976 CLASS="VARIABLELIST"
1977 ><DL
1978 ><DT
1979 >Typical use:</DT
1980 ><DD
1981 ><P
1982 >Improve privacy by not forwarding the source of the request in the HTTP headers.</P
1983 ></DD
1984 ><DT
1985 >Effect:</DT
1986 ><DD
1987 ><P
1988 >    Deletes the <SPAN
1989 CLASS="QUOTE"
1990 >"X-Forwarded-For:"</SPAN
1991 > HTTP header from the client request,
1992     or adds a new one.
1993    </P
1994 ></DD
1995 ><DT
1996 >Type:</DT
1997 ><DD
1998 ><P
1999 >Parameterized.</P
2000 ></DD
2001 ><DT
2002 >Parameter:</DT
2003 ><DD
2004 ><P
2005 ></P
2006 ><UL
2007 ><LI
2008 ><P
2009 ><SPAN
2010 CLASS="QUOTE"
2011 >"block"</SPAN
2012 > to delete the header.</P
2013 ></LI
2014 ><LI
2015 ><P
2016 >       <SPAN
2017 CLASS="QUOTE"
2018 >"add"</SPAN
2019 > to create the header (or append
2020        the client's IP address to an already existing one).
2021      </P
2022 ></LI
2023 ></UL
2024 ></DD
2025 ><DT
2026 >Notes:</DT
2027 ><DD
2028 ><P
2029 >    It is safe and recommended to use <TT
2030 CLASS="LITERAL"
2031 >block</TT
2032 >.
2033    </P
2034 ><P
2035 >    Forwarding the source address of the request may make
2036     sense in some multi-user setups but is also a privacy risk.
2037    </P
2038 ></DD
2039 ><DT
2040 >Example usage:</DT
2041 ><DD
2042 ><P
2043 >     <TABLE
2044 BORDER="0"
2045 BGCOLOR="#E0E0E0"
2046 WIDTH="90%"
2047 ><TR
2048 ><TD
2049 ><PRE
2050 CLASS="SCREEN"
2051 >+change-x-forwarded-for{block}</PRE
2052 ></TD
2053 ></TR
2054 ></TABLE
2055 >
2056    </P
2057 ></DD
2058 ></DL
2059 ></DIV
2060 ></DIV
2061 ><DIV
2062 CLASS="SECT3"
2063 ><H4
2064 CLASS="SECT3"
2065 ><A
2066 NAME="CLIENT-HEADER-FILTER"
2067 >8.5.4. client-header-filter</A
2068 ></H4
2069 ><P
2070 ></P
2071 ><DIV
2072 CLASS="VARIABLELIST"
2073 ><DL
2074 ><DT
2075 >Typical use:</DT
2076 ><DD
2077 ><P
2078 >   Rewrite or remove single client headers.
2079    </P
2080 ></DD
2081 ><DT
2082 >Effect:</DT
2083 ><DD
2084 ><P
2085 >    All client headers to which this action applies are filtered on-the-fly through
2086     the specified regular expression based substitutions.
2087    </P
2088 ></DD
2089 ><DT
2090 >Type:</DT
2091 ><DD
2092 ><P
2093 >Parameterized.</P
2094 ></DD
2095 ><DT
2096 >Parameter:</DT
2097 ><DD
2098 ><P
2099 >    The name of a client-header filter, as defined in one of the
2100     <A
2101 HREF="filter-file.html"
2102 >filter files</A
2103 >.
2104    </P
2105 ></DD
2106 ><DT
2107 >Notes:</DT
2108 ><DD
2109 ><P
2110 >    Client-header filters are applied to each header on its own, not to
2111     all at once. This makes it easier to diagnose problems, but on the downside
2112     you can't write filters that only change header x if header y's value is z.
2113     You can do that by using tags though.
2114    </P
2115 ><P
2116 >    Client-header filters are executed after the other header actions have finished
2117     and use their output as input.
2118    </P
2119 ><P
2120 >    If the request URL gets changed, <SPAN
2121 CLASS="APPLICATION"
2122 >Privoxy</SPAN
2123 > will detect that and use the new
2124     one. This can be used to rewrite the request destination behind the client's
2125     back, for example to specify a Tor exit relay for certain requests.
2126    </P
2127 ><P
2128 >    Please refer to the <A
2129 HREF="filter-file.html"
2130 >filter file chapter</A
2131 >
2132     to learn which client-header filters are available by default, and how to
2133     create your own.
2134    </P
2135 ></DD
2136 ><DT
2137 >Example usage (section):</DT
2138 ><DD
2139 ><P
2140 >     <TABLE
2141 BORDER="0"
2142 BGCOLOR="#E0E0E0"
2143 WIDTH="90%"
2144 ><TR
2145 ><TD
2146 ><PRE
2147 CLASS="SCREEN"
2148 ># Hide Tor exit notation in Host and Referer Headers
2149 {+client-header-filter{hide-tor-exit-notation}}
2150 /
2151     </PRE
2152 ></TD
2153 ></TR
2154 ></TABLE
2155 >
2156     </P
2157 ></DD
2158 ></DL
2159 ></DIV
2160 ></DIV
2161 ><DIV
2162 CLASS="SECT3"
2163 ><H4
2164 CLASS="SECT3"
2165 ><A
2166 NAME="CLIENT-HEADER-TAGGER"
2167 >8.5.5. client-header-tagger</A
2168 ></H4
2169 ><P
2170 ></P
2171 ><DIV
2172 CLASS="VARIABLELIST"
2173 ><DL
2174 ><DT
2175 >Typical use:</DT
2176 ><DD
2177 ><P
2178 >   Block requests based on their headers.
2179    </P
2180 ></DD
2181 ><DT
2182 >Effect:</DT
2183 ><DD
2184 ><P
2185 >    Client headers to which this action applies are filtered on-the-fly through
2186     the specified regular expression based substitutions, the result is used as
2187     tag. 
2188    </P
2189 ></DD
2190 ><DT
2191 >Type:</DT
2192 ><DD
2193 ><P
2194 >Parameterized.</P
2195 ></DD
2196 ><DT
2197 >Parameter:</DT
2198 ><DD
2199 ><P
2200 >    The name of a client-header tagger, as defined in one of the
2201     <A
2202 HREF="filter-file.html"
2203 >filter files</A
2204 >.
2205    </P
2206 ></DD
2207 ><DT
2208 >Notes:</DT
2209 ><DD
2210 ><P
2211 >    Client-header taggers are applied to each header on its own,
2212     and as the header isn't modified, each tagger <SPAN
2213 CLASS="QUOTE"
2214 >"sees"</SPAN
2215 >
2216     the original.
2217    </P
2218 ><P
2219 >    Client-header taggers are the first actions that are executed
2220     and their tags can be used to control every other action.
2221    </P
2222 ></DD
2223 ><DT
2224 >Example usage (section):</DT
2225 ><DD
2226 ><P
2227 >     <TABLE
2228 BORDER="0"
2229 BGCOLOR="#E0E0E0"
2230 WIDTH="90%"
2231 ><TR
2232 ><TD
2233 ><PRE
2234 CLASS="SCREEN"
2235 ># Tag every request with the User-Agent header
2236 {+client-header-tagger{user-agent}}
2237 /
2238
2239 # Tagging itself doesn't change the action
2240 # settings, sections with TAG patterns do:
2241 #
2242 # If it's a download agent, use a different forwarding proxy,
2243 # show the real User-Agent and make sure resume works.
2244 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
2245  -hide-if-modified-since      \
2246  -overwrite-last-modified     \
2247  -hide-user-agent             \
2248  -filter                      \
2249  -deanimate-gifs              \
2250 }
2251 TAG:^User-Agent: NetBSD-ftp/
2252 TAG:^User-Agent: Novell ZYPP Installer
2253 TAG:^User-Agent: RPM APT-HTTP/
2254 TAG:^User-Agent: fetch libfetch/
2255 TAG:^User-Agent: Ubuntu APT-HTTP/
2256 TAG:^User-Agent: MPlayer/
2257     </PRE
2258 ></TD
2259 ></TR
2260 ></TABLE
2261 >
2262     </P
2263 ></DD
2264 ></DL
2265 ></DIV
2266 ></DIV
2267 ><DIV
2268 CLASS="SECT3"
2269 ><H4
2270 CLASS="SECT3"
2271 ><A
2272 NAME="CONTENT-TYPE-OVERWRITE"
2273 >8.5.6. content-type-overwrite</A
2274 ></H4
2275 ><P
2276 ></P
2277 ><DIV
2278 CLASS="VARIABLELIST"
2279 ><DL
2280 ><DT
2281 >Typical use:</DT
2282 ><DD
2283 ><P
2284 >Stop useless download menus from popping up, or change the browser's rendering mode</P
2285 ></DD
2286 ><DT
2287 >Effect:</DT
2288 ><DD
2289 ><P
2290 >    Replaces the <SPAN
2291 CLASS="QUOTE"
2292 >"Content-Type:"</SPAN
2293 > HTTP server header.
2294    </P
2295 ></DD
2296 ><DT
2297 >Type:</DT
2298 ><DD
2299 ><P
2300 >Parameterized.</P
2301 ></DD
2302 ><DT
2303 >Parameter:</DT
2304 ><DD
2305 ><P
2306 >    Any string. 
2307    </P
2308 ></DD
2309 ><DT
2310 >Notes:</DT
2311 ><DD
2312 ><P
2313 >    The <SPAN
2314 CLASS="QUOTE"
2315 >"Content-Type:"</SPAN
2316 > HTTP server header is used by the
2317     browser to decide what to do with the document. The value of this
2318     header can cause the browser to open a download menu instead of
2319     displaying the document by itself, even if the document's format is
2320     supported by the browser. 
2321    </P
2322 ><P
2323 >    The declared content type can also affect which rendering mode
2324     the browser chooses. If XHTML is delivered as <SPAN
2325 CLASS="QUOTE"
2326 >"text/html"</SPAN
2327 >,
2328     many browsers treat it as yet another broken HTML document.
2329     If it is send as <SPAN
2330 CLASS="QUOTE"
2331 >"application/xml"</SPAN
2332 >, browsers with
2333     XHTML support will only display it, if the syntax is correct.
2334    </P
2335 ><P
2336 >    If you see a web site that proudly uses XHTML buttons, but sets
2337     <SPAN
2338 CLASS="QUOTE"
2339 >"Content-Type: text/html"</SPAN
2340 >, you can use <SPAN
2341 CLASS="APPLICATION"
2342 >Privoxy</SPAN
2343 >
2344     to overwrite it with <SPAN
2345 CLASS="QUOTE"
2346 >"application/xml"</SPAN
2347 > and validate
2348     the web master's claim inside your XHTML-supporting browser.
2349     If the syntax is incorrect, the browser will complain loudly. 
2350    </P
2351 ><P
2352 >    You can also go the opposite direction: if your browser prints
2353     error messages instead of rendering a document falsely declared
2354     as XHTML, you can overwrite the content type with
2355     <SPAN
2356 CLASS="QUOTE"
2357 >"text/html"</SPAN
2358 > and have it rendered as broken HTML document. 
2359    </P
2360 ><P
2361 >    By default <TT
2362 CLASS="LITERAL"
2363 >content-type-overwrite</TT
2364 > only replaces
2365     <SPAN
2366 CLASS="QUOTE"
2367 >"Content-Type:"</SPAN
2368 > headers that look like some kind of text.
2369     If you want to overwrite it unconditionally, you have to combine it with
2370     <TT
2371 CLASS="LITERAL"
2372 ><A
2373 HREF="actions-file.html#FORCE-TEXT-MODE"
2374 >force-text-mode</A
2375 ></TT
2376 >.
2377     This limitation exists for a reason, think twice before circumventing it.
2378    </P
2379 ><P
2380 >    Most of the time it's easier to replace this action with a custom
2381     <TT
2382 CLASS="LITERAL"
2383 ><A
2384 HREF="actions-file.html#SERVER-HEADER-FILTER"
2385 >server-header filter</A
2386 ></TT
2387 >.
2388     It allows you to activate it for every document of a certain site and it will still
2389     only replace the content types you aimed at.
2390    </P
2391 ><P
2392 >    Of course you can apply <TT
2393 CLASS="LITERAL"
2394 >content-type-overwrite</TT
2395 >
2396     to a whole site and then make URL based exceptions, but it's a lot
2397     more work to get the same precision. 
2398    </P
2399 ></DD
2400 ><DT
2401 >Example usage (sections):</DT
2402 ><DD
2403 ><P
2404 >     <TABLE
2405 BORDER="0"
2406 BGCOLOR="#E0E0E0"
2407 WIDTH="90%"
2408 ><TR
2409 ><TD
2410 ><PRE
2411 CLASS="SCREEN"
2412 ># Check if www.example.net/ really uses valid XHTML
2413 { +content-type-overwrite{application/xml} }
2414 www.example.net/
2415
2416 # but leave the content type unmodified if the URL looks like a style sheet
2417 {-content-type-overwrite}
2418 www.example.net/.*\.css$
2419 www.example.net/.*style</PRE
2420 ></TD
2421 ></TR
2422 ></TABLE
2423 >
2424    </P
2425 ></DD
2426 ></DL
2427 ></DIV
2428 ></DIV
2429 ><DIV
2430 CLASS="SECT3"
2431 ><H4
2432 CLASS="SECT3"
2433 ><A
2434 NAME="CRUNCH-CLIENT-HEADER"
2435 >8.5.7. crunch-client-header</A
2436 ></H4
2437 ><P
2438 ></P
2439 ><DIV
2440 CLASS="VARIABLELIST"
2441 ><DL
2442 ><DT
2443 >Typical use:</DT
2444 ><DD
2445 ><P
2446 >Remove a client header <SPAN
2447 CLASS="APPLICATION"
2448 >Privoxy</SPAN
2449 > has no dedicated action for.</P
2450 ></DD
2451 ><DT
2452 >Effect:</DT
2453 ><DD
2454 ><P
2455 >    Deletes every header sent by the client that contains the string the user supplied as parameter.
2456    </P
2457 ></DD
2458 ><DT
2459 >Type:</DT
2460 ><DD
2461 ><P
2462 >Parameterized.</P
2463 ></DD
2464 ><DT
2465 >Parameter:</DT
2466 ><DD
2467 ><P
2468 >    Any string.
2469    </P
2470 ></DD
2471 ><DT
2472 >Notes:</DT
2473 ><DD
2474 ><P
2475 >    This action allows you to block client headers for which no dedicated
2476     <SPAN
2477 CLASS="APPLICATION"
2478 >Privoxy</SPAN
2479 > action exists.
2480     <SPAN
2481 CLASS="APPLICATION"
2482 >Privoxy</SPAN
2483 > will remove every client header that
2484     contains the string you supplied as parameter.
2485    </P
2486 ><P
2487 >    Regular expressions are <SPAN
2488 CLASS="emphasis"
2489 ><I
2490 CLASS="EMPHASIS"
2491 >not supported</I
2492 ></SPAN
2493 > and you can't
2494     use this action to block different headers in the same request, unless
2495     they contain the same string.
2496    </P
2497 ><P
2498 >    <TT
2499 CLASS="LITERAL"
2500 >crunch-client-header</TT
2501 > is only meant for quick tests.
2502     If you have to block several different headers, or only want to modify
2503     parts of them, you should use a
2504     <TT
2505 CLASS="LITERAL"
2506 ><A
2507 HREF="actions-file.html#CLIENT-HEADER-FILTER"
2508 >client-header filter</A
2509 ></TT
2510 >.
2511    </P
2512 ><DIV
2513 CLASS="WARNING"
2514 ><P
2515 ></P
2516 ><TABLE
2517 CLASS="WARNING"
2518 BORDER="1"
2519 WIDTH="90%"
2520 ><TR
2521 ><TD
2522 ALIGN="CENTER"
2523 ><B
2524 >Warning</B
2525 ></TD
2526 ></TR
2527 ><TR
2528 ><TD
2529 ALIGN="LEFT"
2530 ><P
2531 >      Don't block any header without understanding the consequences.
2532      </P
2533 ></TD
2534 ></TR
2535 ></TABLE
2536 ></DIV
2537 ></DD
2538 ><DT
2539 >Example usage (section):</DT
2540 ><DD
2541 ><P
2542 >     <TABLE
2543 BORDER="0"
2544 BGCOLOR="#E0E0E0"
2545 WIDTH="90%"
2546 ><TR
2547 ><TD
2548 ><PRE
2549 CLASS="SCREEN"
2550 ># Block the non-existent "Privacy-Violation:" client header 
2551 { +crunch-client-header{Privacy-Violation:} }
2552 /
2553     </PRE
2554 ></TD
2555 ></TR
2556 ></TABLE
2557 >
2558    </P
2559 ></DD
2560 ></DL
2561 ></DIV
2562 ></DIV
2563 ><DIV
2564 CLASS="SECT3"
2565 ><H4
2566 CLASS="SECT3"
2567 ><A
2568 NAME="CRUNCH-IF-NONE-MATCH"
2569 >8.5.8. crunch-if-none-match</A
2570 ></H4
2571 ><P
2572 ></P
2573 ><DIV
2574 CLASS="VARIABLELIST"
2575 ><DL
2576 ><DT
2577 >Typical use:</DT
2578 ><DD
2579 ><P
2580 >Prevent yet another way to track the user's steps between sessions.</P
2581 ></DD
2582 ><DT
2583 >Effect:</DT
2584 ><DD
2585 ><P
2586 >    Deletes the <SPAN
2587 CLASS="QUOTE"
2588 >"If-None-Match:"</SPAN
2589 > HTTP client header.
2590    </P
2591 ></DD
2592 ><DT
2593 >Type:</DT
2594 ><DD
2595 ><P
2596 >Boolean.</P
2597 ></DD
2598 ><DT
2599 >Parameter:</DT
2600 ><DD
2601 ><P
2602 >    N/A
2603    </P
2604 ></DD
2605 ><DT
2606 >Notes:</DT
2607 ><DD
2608 ><P
2609 >    Removing the <SPAN
2610 CLASS="QUOTE"
2611 >"If-None-Match:"</SPAN
2612 > HTTP client header
2613     is useful for filter testing, where you want to force a real
2614     reload instead of getting status code <SPAN
2615 CLASS="QUOTE"
2616 >"304"</SPAN
2617 > which
2618     would cause the browser to use a cached copy of the page.
2619    </P
2620 ><P
2621 >    It is also useful to make sure the header isn't used as a cookie
2622     replacement (unlikely but possible).
2623    </P
2624 ><P
2625 >    Blocking the <SPAN
2626 CLASS="QUOTE"
2627 >"If-None-Match:"</SPAN
2628 > header shouldn't cause any
2629     caching problems, as long as the <SPAN
2630 CLASS="QUOTE"
2631 >"If-Modified-Since:"</SPAN
2632 > header
2633     isn't blocked or missing as well.
2634    </P
2635 ><P
2636 >    It is recommended to use this action together with
2637     <TT
2638 CLASS="LITERAL"
2639 ><A
2640 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2641 >hide-if-modified-since</A
2642 ></TT
2643 >
2644     and
2645     <TT
2646 CLASS="LITERAL"
2647 ><A
2648 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2649 >overwrite-last-modified</A
2650 ></TT
2651 >.
2652    </P
2653 ></DD
2654 ><DT
2655 >Example usage (section):</DT
2656 ><DD
2657 ><P
2658 >     <TABLE
2659 BORDER="0"
2660 BGCOLOR="#E0E0E0"
2661 WIDTH="90%"
2662 ><TR
2663 ><TD
2664 ><PRE
2665 CLASS="SCREEN"
2666 ># Let the browser revalidate cached documents but don't
2667 # allow the server to use the revalidation headers for user tracking.
2668 {+hide-if-modified-since{-60} \
2669  +overwrite-last-modified{randomize} \
2670  +crunch-if-none-match}
2671 /   </PRE
2672 ></TD
2673 ></TR
2674 ></TABLE
2675 >
2676    </P
2677 ></DD
2678 ></DL
2679 ></DIV
2680 ></DIV
2681 ><DIV
2682 CLASS="SECT3"
2683 ><H4
2684 CLASS="SECT3"
2685 ><A
2686 NAME="CRUNCH-INCOMING-COOKIES"
2687 >8.5.9. crunch-incoming-cookies</A
2688 ></H4
2689 ><P
2690 ></P
2691 ><DIV
2692 CLASS="VARIABLELIST"
2693 ><DL
2694 ><DT
2695 >Typical use:</DT
2696 ><DD
2697 ><P
2698 >    Prevent the web server from setting HTTP cookies on your system
2699    </P
2700 ></DD
2701 ><DT
2702 >Effect:</DT
2703 ><DD
2704 ><P
2705 >    Deletes any <SPAN
2706 CLASS="QUOTE"
2707 >"Set-Cookie:"</SPAN
2708 > HTTP headers from server replies.
2709    </P
2710 ></DD
2711 ><DT
2712 >Type:</DT
2713 ><DD
2714 ><P
2715 >Boolean.</P
2716 ></DD
2717 ><DT
2718 >Parameter:</DT
2719 ><DD
2720 ><P
2721 >    N/A
2722    </P
2723 ></DD
2724 ><DT
2725 >Notes:</DT
2726 ><DD
2727 ><P
2728 >    This action is only concerned with <SPAN
2729 CLASS="emphasis"
2730 ><I
2731 CLASS="EMPHASIS"
2732 >incoming</I
2733 ></SPAN
2734 > HTTP cookies. For
2735     <SPAN
2736 CLASS="emphasis"
2737 ><I
2738 CLASS="EMPHASIS"
2739 >outgoing</I
2740 ></SPAN
2741 > HTTP cookies, use
2742     <TT
2743 CLASS="LITERAL"
2744 ><A
2745 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2746 >crunch-outgoing-cookies</A
2747 ></TT
2748 >.
2749     Use <SPAN
2750 CLASS="emphasis"
2751 ><I
2752 CLASS="EMPHASIS"
2753 >both</I
2754 ></SPAN
2755 > to disable HTTP cookies completely.
2756    </P
2757 ><P
2758 >    It makes <SPAN
2759 CLASS="emphasis"
2760 ><I
2761 CLASS="EMPHASIS"
2762 >no sense at all</I
2763 ></SPAN
2764 > to use this action in conjunction
2765     with the <TT
2766 CLASS="LITERAL"
2767 ><A
2768 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2769 >session-cookies-only</A
2770 ></TT
2771 > action,
2772     since it would prevent the session cookies from being set. See also 
2773     <TT
2774 CLASS="LITERAL"
2775 ><A
2776 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2777 >filter-content-cookies</A
2778 ></TT
2779 >.
2780    </P
2781 ></DD
2782 ><DT
2783 >Example usage:</DT
2784 ><DD
2785 ><P
2786 >    <TABLE
2787 BORDER="0"
2788 BGCOLOR="#E0E0E0"
2789 WIDTH="90%"
2790 ><TR
2791 ><TD
2792 ><PRE
2793 CLASS="SCREEN"
2794 >+crunch-incoming-cookies</PRE
2795 ></TD
2796 ></TR
2797 ></TABLE
2798 >
2799    </P
2800 ></DD
2801 ></DL
2802 ></DIV
2803 ></DIV
2804 ><DIV
2805 CLASS="SECT3"
2806 ><H4
2807 CLASS="SECT3"
2808 ><A
2809 NAME="CRUNCH-SERVER-HEADER"
2810 >8.5.10. crunch-server-header</A
2811 ></H4
2812 ><P
2813 ></P
2814 ><DIV
2815 CLASS="VARIABLELIST"
2816 ><DL
2817 ><DT
2818 >Typical use:</DT
2819 ><DD
2820 ><P
2821 >Remove a server header <SPAN
2822 CLASS="APPLICATION"
2823 >Privoxy</SPAN
2824 > has no dedicated action for.</P
2825 ></DD
2826 ><DT
2827 >Effect:</DT
2828 ><DD
2829 ><P
2830 >    Deletes every header sent by the server that contains the string the user supplied as parameter.
2831    </P
2832 ></DD
2833 ><DT
2834 >Type:</DT
2835 ><DD
2836 ><P
2837 >Parameterized.</P
2838 ></DD
2839 ><DT
2840 >Parameter:</DT
2841 ><DD
2842 ><P
2843 >    Any string.
2844    </P
2845 ></DD
2846 ><DT
2847 >Notes:</DT
2848 ><DD
2849 ><P
2850 >    This action allows you to block server headers for which no dedicated
2851     <SPAN
2852 CLASS="APPLICATION"
2853 >Privoxy</SPAN
2854 > action exists. <SPAN
2855 CLASS="APPLICATION"
2856 >Privoxy</SPAN
2857 >
2858     will remove every server header that contains the string you supplied as parameter.
2859    </P
2860 ><P
2861 >    Regular expressions are <SPAN
2862 CLASS="emphasis"
2863 ><I
2864 CLASS="EMPHASIS"
2865 >not supported</I
2866 ></SPAN
2867 > and you can't
2868     use this action to block different headers in the same request, unless
2869     they contain the same string.
2870    </P
2871 ><P
2872 >    <TT
2873 CLASS="LITERAL"
2874 >crunch-server-header</TT
2875 > is only meant for quick tests.
2876     If you have to block several different headers, or only want to modify
2877     parts of them, you should use a custom
2878     <TT
2879 CLASS="LITERAL"
2880 ><A
2881 HREF="actions-file.html#SERVER-HEADER-FILTER"
2882 >server-header filter</A
2883 ></TT
2884 >.
2885    </P
2886 ><DIV
2887 CLASS="WARNING"
2888 ><P
2889 ></P
2890 ><TABLE
2891 CLASS="WARNING"
2892 BORDER="1"
2893 WIDTH="90%"
2894 ><TR
2895 ><TD
2896 ALIGN="CENTER"
2897 ><B
2898 >Warning</B
2899 ></TD
2900 ></TR
2901 ><TR
2902 ><TD
2903 ALIGN="LEFT"
2904 ><P
2905 >     Don't block any header without understanding the consequences.
2906      </P
2907 ></TD
2908 ></TR
2909 ></TABLE
2910 ></DIV
2911 ></DD
2912 ><DT
2913 >Example usage (section):</DT
2914 ><DD
2915 ><P
2916 >     <TABLE
2917 BORDER="0"
2918 BGCOLOR="#E0E0E0"
2919 WIDTH="90%"
2920 ><TR
2921 ><TD
2922 ><PRE
2923 CLASS="SCREEN"
2924 ># Crunch server headers that try to prevent caching
2925 { +crunch-server-header{no-cache} }
2926 /   </PRE
2927 ></TD
2928 ></TR
2929 ></TABLE
2930 >
2931    </P
2932 ></DD
2933 ></DL
2934 ></DIV
2935 ></DIV
2936 ><DIV
2937 CLASS="SECT3"
2938 ><H4
2939 CLASS="SECT3"
2940 ><A
2941 NAME="CRUNCH-OUTGOING-COOKIES"
2942 >8.5.11. crunch-outgoing-cookies</A
2943 ></H4
2944 ><P
2945 ></P
2946 ><DIV
2947 CLASS="VARIABLELIST"
2948 ><DL
2949 ><DT
2950 >Typical use:</DT
2951 ><DD
2952 ><P
2953 >    Prevent the web server from reading any HTTP cookies from your system
2954    </P
2955 ></DD
2956 ><DT
2957 >Effect:</DT
2958 ><DD
2959 ><P
2960 >    Deletes any <SPAN
2961 CLASS="QUOTE"
2962 >"Cookie:"</SPAN
2963 > HTTP headers from client requests.
2964    </P
2965 ></DD
2966 ><DT
2967 >Type:</DT
2968 ><DD
2969 ><P
2970 >Boolean.</P
2971 ></DD
2972 ><DT
2973 >Parameter:</DT
2974 ><DD
2975 ><P
2976 >    N/A
2977    </P
2978 ></DD
2979 ><DT
2980 >Notes:</DT
2981 ><DD
2982 ><P
2983 >    This action is only concerned with <SPAN
2984 CLASS="emphasis"
2985 ><I
2986 CLASS="EMPHASIS"
2987 >outgoing</I
2988 ></SPAN
2989 > HTTP cookies. For
2990     <SPAN
2991 CLASS="emphasis"
2992 ><I
2993 CLASS="EMPHASIS"
2994 >incoming</I
2995 ></SPAN
2996 > HTTP cookies, use
2997     <TT
2998 CLASS="LITERAL"
2999 ><A
3000 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3001 >crunch-incoming-cookies</A
3002 ></TT
3003 >.
3004     Use <SPAN
3005 CLASS="emphasis"
3006 ><I
3007 CLASS="EMPHASIS"
3008 >both</I
3009 ></SPAN
3010 > to disable HTTP cookies completely.
3011    </P
3012 ><P
3013 >    It makes <SPAN
3014 CLASS="emphasis"
3015 ><I
3016 CLASS="EMPHASIS"
3017 >no sense at all</I
3018 ></SPAN
3019 > to use this action in conjunction
3020     with the <TT
3021 CLASS="LITERAL"
3022 ><A
3023 HREF="actions-file.html#SESSION-COOKIES-ONLY"
3024 >session-cookies-only</A
3025 ></TT
3026 > action,
3027     since it would prevent the session cookies from being read.
3028    </P
3029 ></DD
3030 ><DT
3031 >Example usage:</DT
3032 ><DD
3033 ><P
3034 >    <TABLE
3035 BORDER="0"
3036 BGCOLOR="#E0E0E0"
3037 WIDTH="90%"
3038 ><TR
3039 ><TD
3040 ><PRE
3041 CLASS="SCREEN"
3042 >+crunch-outgoing-cookies</PRE
3043 ></TD
3044 ></TR
3045 ></TABLE
3046 >
3047    </P
3048 ></DD
3049 ></DL
3050 ></DIV
3051 ></DIV
3052 ><DIV
3053 CLASS="SECT3"
3054 ><H4
3055 CLASS="SECT3"
3056 ><A
3057 NAME="DEANIMATE-GIFS"
3058 >8.5.12. deanimate-gifs</A
3059 ></H4
3060 ><P
3061 ></P
3062 ><DIV
3063 CLASS="VARIABLELIST"
3064 ><DL
3065 ><DT
3066 >Typical use:</DT
3067 ><DD
3068 ><P
3069 >Stop those annoying, distracting animated GIF images.</P
3070 ></DD
3071 ><DT
3072 >Effect:</DT
3073 ><DD
3074 ><P
3075 >    De-animate GIF animations, i.e. reduce them to their first or last image.
3076    </P
3077 ></DD
3078 ><DT
3079 >Type:</DT
3080 ><DD
3081 ><P
3082 >Parameterized.</P
3083 ></DD
3084 ><DT
3085 >Parameter:</DT
3086 ><DD
3087 ><P
3088 >    <SPAN
3089 CLASS="QUOTE"
3090 >"last"</SPAN
3091 > or <SPAN
3092 CLASS="QUOTE"
3093 >"first"</SPAN
3094 >
3095    </P
3096 ></DD
3097 ><DT
3098 >Notes:</DT
3099 ><DD
3100 ><P
3101 >    This will also shrink the images considerably (in bytes, not pixels!). If
3102     the option <SPAN
3103 CLASS="QUOTE"
3104 >"first"</SPAN
3105 > is given, the first frame of the animation
3106     is used as the replacement. If <SPAN
3107 CLASS="QUOTE"
3108 >"last"</SPAN
3109 > is given, the last
3110     frame of the animation is used instead, which probably makes more sense for
3111     most banner animations, but also has the risk of not showing the entire
3112     last frame (if it is only a delta to an earlier frame).
3113    </P
3114 ><P
3115 >    You can safely use this action with patterns that will also match non-GIF
3116     objects, because no attempt will be made at anything that doesn't look like
3117     a GIF.
3118    </P
3119 ></DD
3120 ><DT
3121 >Example usage:</DT
3122 ><DD
3123 ><P
3124 >      <TABLE
3125 BORDER="0"
3126 BGCOLOR="#E0E0E0"
3127 WIDTH="90%"
3128 ><TR
3129 ><TD
3130 ><PRE
3131 CLASS="SCREEN"
3132 >+deanimate-gifs{last}</PRE
3133 ></TD
3134 ></TR
3135 ></TABLE
3136 >
3137     </P
3138 ></DD
3139 ></DL
3140 ></DIV
3141 ></DIV
3142 ><DIV
3143 CLASS="SECT3"
3144 ><H4
3145 CLASS="SECT3"
3146 ><A
3147 NAME="DOWNGRADE-HTTP-VERSION"
3148 >8.5.13. downgrade-http-version</A
3149 ></H4
3150 ><P
3151 ></P
3152 ><DIV
3153 CLASS="VARIABLELIST"
3154 ><DL
3155 ><DT
3156 >Typical use:</DT
3157 ><DD
3158 ><P
3159 >Work around (very rare) problems with HTTP/1.1</P
3160 ></DD
3161 ><DT
3162 >Effect:</DT
3163 ><DD
3164 ><P
3165 >    Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3166    </P
3167 ></DD
3168 ><DT
3169 >Type:</DT
3170 ><DD
3171 ><P
3172 >Boolean.</P
3173 ></DD
3174 ><DT
3175 >Parameter:</DT
3176 ><DD
3177 ><P
3178 >    N/A
3179    </P
3180 ></DD
3181 ><DT
3182 >Notes:</DT
3183 ><DD
3184 ><P
3185 >    This is a left-over from the time when <SPAN
3186 CLASS="APPLICATION"
3187 >Privoxy</SPAN
3188 >
3189     didn't support important HTTP/1.1 features well. It is left here for the
3190     unlikely case that you experience HTTP/1.1 related problems with some server
3191     out there. Not all HTTP/1.1 features and requirements are supported yet,
3192     so there is a chance you might need this action.
3193    </P
3194 ></DD
3195 ><DT
3196 >Example usage (section):</DT
3197 ><DD
3198 ><P
3199 >     <TABLE
3200 BORDER="0"
3201 BGCOLOR="#E0E0E0"
3202 WIDTH="90%"
3203 ><TR
3204 ><TD
3205 ><PRE
3206 CLASS="SCREEN"
3207 >{+downgrade-http-version}
3208 problem-host.example.com</PRE
3209 ></TD
3210 ></TR
3211 ></TABLE
3212 >
3213     </P
3214 ></DD
3215 ></DL
3216 ></DIV
3217 ></DIV
3218 ><DIV
3219 CLASS="SECT3"
3220 ><H4
3221 CLASS="SECT3"
3222 ><A
3223 NAME="FAST-REDIRECTS"
3224 >8.5.14. fast-redirects</A
3225 ></H4
3226 ><P
3227 ></P
3228 ><DIV
3229 CLASS="VARIABLELIST"
3230 ><DL
3231 ><DT
3232 >Typical use:</DT
3233 ><DD
3234 ><P
3235 >Fool some click-tracking scripts and speed up indirect links.</P
3236 ></DD
3237 ><DT
3238 >Effect:</DT
3239 ><DD
3240 ><P
3241 >    Detects redirection URLs and redirects the browser without contacting
3242     the redirection server first.
3243    </P
3244 ></DD
3245 ><DT
3246 >Type:</DT
3247 ><DD
3248 ><P
3249 >Parameterized.</P
3250 ></DD
3251 ><DT
3252 >Parameter:</DT
3253 ><DD
3254 ><P
3255 ></P
3256 ><UL
3257 ><LI
3258 ><P
3259 >      <SPAN
3260 CLASS="QUOTE"
3261 >"simple-check"</SPAN
3262 > to just search for the string <SPAN
3263 CLASS="QUOTE"
3264 >"http://"</SPAN
3265 >
3266       to detect redirection URLs.
3267      </P
3268 ></LI
3269 ><LI
3270 ><P
3271 >      <SPAN
3272 CLASS="QUOTE"
3273 >"check-decoded-url"</SPAN
3274 > to decode URLs (if necessary) before searching
3275       for redirection URLs.
3276      </P
3277 ></LI
3278 ></UL
3279 ></DD
3280 ><DT
3281 >Notes:</DT
3282 ><DD
3283 ><P
3284 >  
3285     Many sites, like yahoo.com, don't just link to other sites. Instead, they
3286     will link to some script on their own servers, giving the destination as a
3287     parameter, which will then redirect you to the final target. URLs
3288     resulting from this scheme typically look like:
3289     <SPAN
3290 CLASS="QUOTE"
3291 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
3292 >.
3293   </P
3294 ><P
3295 >    Sometimes, there are even multiple consecutive redirects encoded in the
3296     URL. These redirections via scripts make your web browsing more traceable,
3297     since the server from which you follow such a link can see where you go
3298     to. Apart from that, valuable bandwidth and time is wasted, while your
3299     browser asks the server for one redirect after the other. Plus, it feeds
3300     the advertisers.
3301    </P
3302 ><P
3303 >    This feature is currently not very smart and is scheduled for improvement.
3304     If it is enabled by default, you will have to create some exceptions to
3305     this action. It can lead to failures in several ways: 
3306    </P
3307 ><P
3308 >    Not every URLs with other URLs as parameters is evil.
3309     Some sites offer a real service that requires this information to work.
3310     For example a validation service needs to know, which document to validate.
3311     <TT
3312 CLASS="LITERAL"
3313 >fast-redirects</TT
3314 > assumes that every URL parameter that
3315     looks like another URL is a redirection target, and will always redirect to
3316     the last one. Most of the time the assumption is correct, but if it isn't,
3317     the user gets redirected anyway.
3318    </P
3319 ><P
3320 >    Another failure occurs if the URL contains other parameters after the URL parameter.
3321     The URL:
3322     <SPAN
3323 CLASS="QUOTE"
3324 >"http://www.example.org/?redirect=http%3a//www.example.net/&#38;foo=bar"</SPAN
3325 >.
3326     contains the redirection URL <SPAN
3327 CLASS="QUOTE"
3328 >"http://www.example.net/"</SPAN
3329 >,
3330     followed by another parameter. <TT
3331 CLASS="LITERAL"
3332 >fast-redirects</TT
3333 > doesn't know that
3334     and will cause a redirect to <SPAN
3335 CLASS="QUOTE"
3336 >"http://www.example.net/&#38;foo=bar"</SPAN
3337 >.
3338     Depending on the target server configuration, the parameter will be silently ignored
3339     or lead to a <SPAN
3340 CLASS="QUOTE"
3341 >"page not found"</SPAN
3342 > error. You can prevent this problem by
3343     first using the <TT
3344 CLASS="LITERAL"
3345 ><A
3346 HREF="actions-file.html#REDIRECT"
3347 >redirect</A
3348 ></TT
3349 > action
3350     to remove the last part of the URL, but it requires a little effort.
3351    </P
3352 ><P
3353 >    To detect a redirection URL, <TT
3354 CLASS="LITERAL"
3355 >fast-redirects</TT
3356 > only
3357     looks for the string <SPAN
3358 CLASS="QUOTE"
3359 >"http://"</SPAN
3360 >, either in plain text
3361     (invalid but often used) or encoded as <SPAN
3362 CLASS="QUOTE"
3363 >"http%3a//"</SPAN
3364 >.
3365     Some sites use their own URL encoding scheme, encrypt the address
3366     of the target server or replace it with a database id. In theses cases
3367     <TT
3368 CLASS="LITERAL"
3369 >fast-redirects</TT
3370 > is fooled and the request reaches the
3371     redirection server where it probably gets logged.
3372    </P
3373 ></DD
3374 ><DT
3375 >Example usage:</DT
3376 ><DD
3377 ><P
3378 >     <TABLE
3379 BORDER="0"
3380 BGCOLOR="#E0E0E0"
3381 WIDTH="90%"
3382 ><TR
3383 ><TD
3384 ><PRE
3385 CLASS="SCREEN"
3386 > { +fast-redirects{simple-check} }
3387    one.example.com 
3388
3389  { +fast-redirects{check-decoded-url} }
3390    another.example.com/testing</PRE
3391 ></TD
3392 ></TR
3393 ></TABLE
3394 >
3395     </P
3396 ></DD
3397 ></DL
3398 ></DIV
3399 ></DIV
3400 ><DIV
3401 CLASS="SECT3"
3402 ><H4
3403 CLASS="SECT3"
3404 ><A
3405 NAME="FILTER"
3406 >8.5.15. filter</A
3407 ></H4
3408 ><P
3409 ></P
3410 ><DIV
3411 CLASS="VARIABLELIST"
3412 ><DL
3413 ><DT
3414 >Typical use:</DT
3415 ><DD
3416 ><P
3417 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), 
3418          do fun text replacements, add personalized effects, etc.</P
3419 ></DD
3420 ><DT
3421 >Effect:</DT
3422 ><DD
3423 ><P
3424 >    All instances of text-based type, most notably HTML and JavaScript, to which
3425     this action applies, can be filtered on-the-fly through the specified regular
3426     expression based substitutions. (Note: as of version 3.0.3 plain text documents
3427     are exempted from filtering, because web servers often use the
3428    <TT
3429 CLASS="LITERAL"
3430 >text/plain</TT
3431 > MIME type for all files whose type they don't know.)
3432    </P
3433 ></DD
3434 ><DT
3435 >Type:</DT
3436 ><DD
3437 ><P
3438 >Parameterized.</P
3439 ></DD
3440 ><DT
3441 >Parameter:</DT
3442 ><DD
3443 ><P
3444 >    The name of a content filter, as defined in the <A
3445 HREF="filter-file.html"
3446 >filter file</A
3447 >.
3448     Filters can be defined in one or more  files as defined by the 
3449     <TT
3450 CLASS="LITERAL"
3451 ><A
3452 HREF="config.html#FILTERFILE"
3453 >filterfile</A
3454 ></TT
3455 >
3456     option in the <A
3457 HREF="config.html"
3458 >config file</A
3459 >. 
3460     <TT
3461 CLASS="FILENAME"
3462 >default.filter</TT
3463 > is the collection of filters 
3464     supplied by the developers. Locally defined filters should go 
3465     in their own file, such as <TT
3466 CLASS="FILENAME"
3467 >user.filter</TT
3468 >.
3469    </P
3470 ><P
3471 >     When used in its negative form,
3472      and without parameters, <SPAN
3473 CLASS="emphasis"
3474 ><I
3475 CLASS="EMPHASIS"
3476 >all</I
3477 ></SPAN
3478 > filtering is completely disabled.
3479   </P
3480 ></DD
3481 ><DT
3482 >Notes:</DT
3483 ><DD
3484 ><P
3485 >    For your convenience, there are a number of pre-defined filters available 
3486     in the distribution filter file that you can use. See the examples below for
3487     a list.
3488    </P
3489 ><P
3490 >    Filtering requires buffering the page content, which may appear to
3491     slow down page rendering since nothing is displayed until all content has
3492     passed the filters. (It does not really take longer, but seems that way
3493     since the page is not incrementally displayed.) This effect will be more
3494     noticeable on slower connections.
3495    </P
3496 ><P
3497 >   <SPAN
3498 CLASS="QUOTE"
3499 >"Rolling your own"</SPAN
3500 >
3501     filters requires a knowledge of 
3502      <A
3503 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
3504 TARGET="_top"
3505 ><SPAN
3506 CLASS="QUOTE"
3507 >"Regular
3508      Expressions"</SPAN
3509 ></A
3510 > and 
3511       <A
3512 HREF="http://en.wikipedia.org/wiki/Html"
3513 TARGET="_top"
3514 ><SPAN
3515 CLASS="QUOTE"
3516 >"HTML"</SPAN
3517 ></A
3518 >.
3519     This is very powerful feature, and potentially very intrusive. 
3520     Filters should be used with caution, and where an equivalent
3521     <SPAN
3522 CLASS="QUOTE"
3523 >"action"</SPAN
3524 > is not available.
3525    </P
3526 ><P
3527 >    The amount of data that can be filtered is limited to the 
3528     <TT
3529 CLASS="LITERAL"
3530 ><A
3531 HREF="config.html#BUFFER-LIMIT"
3532 >buffer-limit</A
3533 ></TT
3534 >
3535     option in the main <A
3536 HREF="config.html"
3537 >config file</A
3538 >. The 
3539     default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
3540     data, and all pending data, is passed through unfiltered. 
3541    </P
3542 ><P
3543 >    Inappropriate MIME types, such as zipped files, are not filtered at all.
3544     (Again, only text-based types except plain text). Encrypted SSL data
3545     (from HTTPS servers) cannot be filtered either, since this would violate
3546     the integrity of the secure transaction. In some situations it might
3547     be necessary to protect certain text, like source code, from filtering
3548     by defining appropriate <TT
3549 CLASS="LITERAL"
3550 >-filter</TT
3551 > exceptions.
3552    </P
3553 ><P
3554 >    Compressed content can't be filtered either, unless <SPAN
3555 CLASS="APPLICATION"
3556 >Privoxy</SPAN
3557 >
3558     is compiled with zlib support (requires at least <SPAN
3559 CLASS="APPLICATION"
3560 >Privoxy</SPAN
3561 > 3.0.7),
3562     in which case <SPAN
3563 CLASS="APPLICATION"
3564 >Privoxy</SPAN
3565 > will decompress the content before filtering
3566     it.
3567    </P
3568 ><P
3569 >    If you use a <SPAN
3570 CLASS="APPLICATION"
3571 >Privoxy</SPAN
3572 > version without zlib support, but want filtering to work on
3573     as much documents as possible, even those that would normally be sent compressed,
3574     you must use the <TT
3575 CLASS="LITERAL"
3576 ><A
3577 HREF="actions-file.html#PREVENT-COMPRESSION"
3578 >prevent-compression</A
3579 ></TT
3580 >
3581     action in conjunction with <TT
3582 CLASS="LITERAL"
3583 >filter</TT
3584 >.
3585    </P
3586 ><P
3587 >    Content filtering can achieve some of the same effects as the 
3588     <TT
3589 CLASS="LITERAL"
3590 ><A
3591 HREF="actions-file.html#BLOCK"
3592 >block</A
3593 ></TT
3594 >
3595     action, i.e. it can be used to block ads and banners. But the mechanism 
3596     works quite differently. One effective use, is to block ad banners 
3597     based on their size (see below), since many of these seem to be somewhat 
3598     standardized.
3599    </P
3600 ><P
3601 >    <A
3602 HREF="contact.html"
3603 >Feedback</A
3604 > with suggestions for new or
3605     improved filters is particularly welcome!
3606    </P
3607 ><P
3608 >    The below list has only the names and a one-line description of each
3609     predefined filter. There are <A
3610 HREF="filter-file.html#PREDEFINED-FILTERS"
3611 >more
3612     verbose explanations</A
3613 > of what these filters do in the <A
3614 HREF="filter-file.html"
3615 >filter file chapter</A
3616 >.
3617    </P
3618 ></DD
3619 ><DT
3620 >Example usage (with filters from the distribution <TT
3621 CLASS="FILENAME"
3622 >default.filter</TT
3623 > file).
3624   See <A
3625 HREF="filter-file.html#PREDEFINED-FILTERS"
3626 >the Predefined Filters section</A
3627 > for 
3628   more explanation on each:</DT
3629 ><DD
3630 ><P
3631 >    <A
3632 NAME="FILTER-JS-ANNOYANCES"
3633 ></A
3634 >
3635     <TABLE
3636 BORDER="0"
3637 BGCOLOR="#E0E0E0"
3638 WIDTH="90%"
3639 ><TR
3640 ><TD
3641 ><PRE
3642 CLASS="SCREEN"
3643 >+filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.</PRE
3644 ></TD
3645 ></TR
3646 ></TABLE
3647 >
3648    </P
3649 ><P
3650 >    <A
3651 NAME="FILTER-JS-EVENTS"
3652 ></A
3653 >
3654     <TABLE
3655 BORDER="0"
3656 BGCOLOR="#E0E0E0"
3657 WIDTH="90%"
3658 ><TR
3659 ><TD
3660 ><PRE
3661 CLASS="SCREEN"
3662 >+filter{js-events}           # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).</PRE
3663 ></TD
3664 ></TR
3665 ></TABLE
3666 >
3667    </P
3668 ><P
3669 >    <A
3670 NAME="FILTER-HTML-ANNOYANCES"
3671 ></A
3672 >
3673     <TABLE
3674 BORDER="0"
3675 BGCOLOR="#E0E0E0"
3676 WIDTH="90%"
3677 ><TR
3678 ><TD
3679 ><PRE
3680 CLASS="SCREEN"
3681 >+filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.</PRE
3682 ></TD
3683 ></TR
3684 ></TABLE
3685 >
3686    </P
3687 ><P
3688 >    <A
3689 NAME="FILTER-CONTENT-COOKIES"
3690 ></A
3691 >
3692     <TABLE
3693 BORDER="0"
3694 BGCOLOR="#E0E0E0"
3695 WIDTH="90%"
3696 ><TR
3697 ><TD
3698 ><PRE
3699 CLASS="SCREEN"
3700 >+filter{content-cookies}     # Kill cookies that come in the HTML or JS content.</PRE
3701 ></TD
3702 ></TR
3703 ></TABLE
3704 >
3705    </P
3706 ><P
3707 >    <A
3708 NAME="FILTER-REFRESH-TAGS"
3709 ></A
3710 >
3711     <TABLE
3712 BORDER="0"
3713 BGCOLOR="#E0E0E0"
3714 WIDTH="90%"
3715 ><TR
3716 ><TD
3717 ><PRE
3718 CLASS="SCREEN"
3719 >+filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups).</PRE
3720 ></TD
3721 ></TR
3722 ></TABLE
3723 >
3724    </P
3725 ><P
3726 >    <A
3727 NAME="FILTER-UNSOLICITED-POPUPS"
3728 ></A
3729 >
3730     <TABLE
3731 BORDER="0"
3732 BGCOLOR="#E0E0E0"
3733 WIDTH="90%"
3734 ><TR
3735 ><TD
3736 ><PRE
3737 CLASS="SCREEN"
3738 >+filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.</PRE
3739 ></TD
3740 ></TR
3741 ></TABLE
3742 >
3743    </P
3744 ><P
3745 >    <A
3746 NAME="FILTER-ALL-POPUPS"
3747 ></A
3748 >
3749     <TABLE
3750 BORDER="0"
3751 BGCOLOR="#E0E0E0"
3752 WIDTH="90%"
3753 ><TR
3754 ><TD
3755 ><PRE
3756 CLASS="SCREEN"
3757 >+filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.</PRE
3758 ></TD
3759 ></TR
3760 ></TABLE
3761 >
3762    </P
3763 ><P
3764 >    <A
3765 NAME="FILTER-IMG-REORDER"
3766 ></A
3767 >
3768     <TABLE
3769 BORDER="0"
3770 BGCOLOR="#E0E0E0"
3771 WIDTH="90%"
3772 ><TR
3773 ><TD
3774 ><PRE
3775 CLASS="SCREEN"
3776 >+filter{img-reorder}         # Reorder attributes in &#60;img&#62; tags to make the banners-by-* filters more effective.</PRE
3777 ></TD
3778 ></TR
3779 ></TABLE
3780 >
3781    </P
3782 ><P
3783 >    <A
3784 NAME="FILTER-BANNERS-BY-SIZE"
3785 ></A
3786 >
3787     <TABLE
3788 BORDER="0"
3789 BGCOLOR="#E0E0E0"
3790 WIDTH="90%"
3791 ><TR
3792 ><TD
3793 ><PRE
3794 CLASS="SCREEN"
3795 >+filter{banners-by-size}     # Kill banners by size.</PRE
3796 ></TD
3797 ></TR
3798 ></TABLE
3799 >
3800    </P
3801 ><P
3802 >    <A
3803 NAME="FILTER-BANNERS-BY-LINK"
3804 ></A
3805 >
3806     <TABLE
3807 BORDER="0"
3808 BGCOLOR="#E0E0E0"
3809 WIDTH="90%"
3810 ><TR
3811 ><TD
3812 ><PRE
3813 CLASS="SCREEN"
3814 >+filter{banners-by-link}     # Kill banners by their links to known clicktrackers.</PRE
3815 ></TD
3816 ></TR
3817 ></TABLE
3818 >
3819    </P
3820 ><P
3821 >    <A
3822 NAME="FILTER-WEBBUGS"
3823 ></A
3824 >
3825     <TABLE
3826 BORDER="0"
3827 BGCOLOR="#E0E0E0"
3828 WIDTH="90%"
3829 ><TR
3830 ><TD
3831 ><PRE
3832 CLASS="SCREEN"
3833 >+filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).</PRE
3834 ></TD
3835 ></TR
3836 ></TABLE
3837 >
3838    </P
3839 ><P
3840 >    <A
3841 NAME="FILTER-TINY-TEXTFORMS"
3842 ></A
3843 >
3844     <TABLE
3845 BORDER="0"
3846 BGCOLOR="#E0E0E0"
3847 WIDTH="90%"
3848 ><TR
3849 ><TD
3850 ><PRE
3851 CLASS="SCREEN"
3852 >+filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.</PRE
3853 ></TD
3854 ></TR
3855 ></TABLE
3856 >
3857    </P
3858 ><P
3859 >    <A
3860 NAME="FILTER-JUMPING-WINDOWS"
3861 ></A
3862 >
3863     <TABLE
3864 BORDER="0"
3865 BGCOLOR="#E0E0E0"
3866 WIDTH="90%"
3867 ><TR
3868 ><TD
3869 ><PRE
3870 CLASS="SCREEN"
3871 >+filter{jumping-windows}     # Prevent windows from resizing and moving themselves.</PRE
3872 ></TD
3873 ></TR
3874 ></TABLE
3875 >
3876    </P
3877 ><P
3878 >    <A
3879 NAME="FILTER-FRAMESET-BORDERS"
3880 ></A
3881 >
3882     <TABLE
3883 BORDER="0"
3884 BGCOLOR="#E0E0E0"
3885 WIDTH="90%"
3886 ><TR
3887 ><TD
3888 ><PRE
3889 CLASS="SCREEN"
3890 >+filter{frameset-borders}    # Give frames a border and make them resizable.</PRE
3891 ></TD
3892 ></TR
3893 ></TABLE
3894 >
3895    </P
3896 ><P
3897 >    <A
3898 NAME="FILTER-DEMORONIZER"
3899 ></A
3900 >
3901     <TABLE
3902 BORDER="0"
3903 BGCOLOR="#E0E0E0"
3904 WIDTH="90%"
3905 ><TR
3906 ><TD
3907 ><PRE
3908 CLASS="SCREEN"
3909 >+filter{demoronizer}         # Fix MS's non-standard use of standard charsets.</PRE
3910 ></TD
3911 ></TR
3912 ></TABLE
3913 >
3914    </P
3915 ><P
3916 >    <A
3917 NAME="FILTER-SHOCKWAVE-FLASH"
3918 ></A
3919 >
3920     <TABLE
3921 BORDER="0"
3922 BGCOLOR="#E0E0E0"
3923 WIDTH="90%"
3924 ><TR
3925 ><TD
3926 ><PRE
3927 CLASS="SCREEN"
3928 >+filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.</PRE
3929 ></TD
3930 ></TR
3931 ></TABLE
3932 >
3933    </P
3934 ><P
3935 >    <A
3936 NAME="FILTER-QUICKTIME-KIOSKMODE"
3937 ></A
3938 >
3939     <TABLE
3940 BORDER="0"
3941 BGCOLOR="#E0E0E0"
3942 WIDTH="90%"
3943 ><TR
3944 ><TD
3945 ><PRE
3946 CLASS="SCREEN"
3947 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable.</PRE
3948 ></TD
3949 ></TR
3950 ></TABLE
3951 >
3952    </P
3953 ><P
3954 >    <A
3955 NAME="FILTER-FUN"
3956 ></A
3957 >
3958     <TABLE
3959 BORDER="0"
3960 BGCOLOR="#E0E0E0"
3961 WIDTH="90%"
3962 ><TR
3963 ><TD
3964 ><PRE
3965 CLASS="SCREEN"
3966 >+filter{fun}                 # Text replacements for subversive browsing fun!</PRE
3967 ></TD
3968 ></TR
3969 ></TABLE
3970 >
3971    </P
3972 ><P
3973 >    <A
3974 NAME="FILTER-CRUDE-PARENTAL"
3975 ></A
3976 >
3977     <TABLE
3978 BORDER="0"
3979 BGCOLOR="#E0E0E0"
3980 WIDTH="90%"
3981 ><TR
3982 ><TD
3983 ><PRE
3984 CLASS="SCREEN"
3985 >+filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.</PRE
3986 ></TD
3987 ></TR
3988 ></TABLE
3989 >
3990    </P
3991 ><P
3992 >    <A
3993 NAME="FILTER-IE-EXPLOITS"
3994 ></A
3995 >
3996     <TABLE
3997 BORDER="0"
3998 BGCOLOR="#E0E0E0"
3999 WIDTH="90%"
4000 ><TR
4001 ><TD
4002 ><PRE
4003 CLASS="SCREEN"
4004 >+filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.</PRE
4005 ></TD
4006 ></TR
4007 ></TABLE
4008 >
4009    </P
4010 ><P
4011 >    <A
4012 NAME="FILTER-SITE-SPECIFICS"
4013 ></A
4014 >
4015     <TABLE
4016 BORDER="0"
4017 BGCOLOR="#E0E0E0"
4018 WIDTH="90%"
4019 ><TR
4020 ><TD
4021 ><PRE
4022 CLASS="SCREEN"
4023 >+filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!</PRE
4024 ></TD
4025 ></TR
4026 ></TABLE
4027 >
4028    </P
4029 ><P
4030 >    <A
4031 NAME="FILTER-NO-PING"
4032 ></A
4033 >
4034     <TABLE
4035 BORDER="0"
4036 BGCOLOR="#E0E0E0"
4037 WIDTH="90%"
4038 ><TR
4039 ><TD
4040 ><PRE
4041 CLASS="SCREEN"
4042 >+filter{no-ping}             # Removes non-standard ping attributes in &#60;a&#62; and &#60;area&#62; tags.</PRE
4043 ></TD
4044 ></TR
4045 ></TABLE
4046 >
4047    </P
4048 ><P
4049 >    <A
4050 NAME="FILTER-GOOGLE"
4051 ></A
4052 >
4053     <TABLE
4054 BORDER="0"
4055 BGCOLOR="#E0E0E0"
4056 WIDTH="90%"
4057 ><TR
4058 ><TD
4059 ><PRE
4060 CLASS="SCREEN"
4061 >+filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</PRE
4062 ></TD
4063 ></TR
4064 ></TABLE
4065 >
4066    </P
4067 ><P
4068 >    <A
4069 NAME="FILTER-YAHOO"
4070 ></A
4071 >
4072     <TABLE
4073 BORDER="0"
4074 BGCOLOR="#E0E0E0"
4075 WIDTH="90%"
4076 ><TR
4077 ><TD
4078 ><PRE
4079 CLASS="SCREEN"
4080 >+filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.</PRE
4081 ></TD
4082 ></TR
4083 ></TABLE
4084 >
4085    </P
4086 ><P
4087 >    <A
4088 NAME="FILTER-MSN"
4089 ></A
4090 >
4091     <TABLE
4092 BORDER="0"
4093 BGCOLOR="#E0E0E0"
4094 WIDTH="90%"
4095 ><TR
4096 ><TD
4097 ><PRE
4098 CLASS="SCREEN"
4099 >+filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</PRE
4100 ></TD
4101 ></TR
4102 ></TABLE
4103 >
4104    </P
4105 ><P
4106 >    <A
4107 NAME="FILTER-BLOGSPOT"
4108 ></A
4109 >
4110     <TABLE
4111 BORDER="0"
4112 BGCOLOR="#E0E0E0"
4113 WIDTH="90%"
4114 ><TR
4115 ><TD
4116 ><PRE
4117 CLASS="SCREEN"
4118 >+filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.</PRE
4119 ></TD
4120 ></TR
4121 ></TABLE
4122 >
4123    </P
4124 ></DD
4125 ></DL
4126 ></DIV
4127 ></DIV
4128 ><DIV
4129 CLASS="SECT3"
4130 ><H4
4131 CLASS="SECT3"
4132 ><A
4133 NAME="FORCE-TEXT-MODE"
4134 >8.5.16. force-text-mode</A
4135 ></H4
4136 ><P
4137 ></P
4138 ><DIV
4139 CLASS="VARIABLELIST"
4140 ><DL
4141 ><DT
4142 >Typical use:</DT
4143 ><DD
4144 ><P
4145 >Force <SPAN
4146 CLASS="APPLICATION"
4147 >Privoxy</SPAN
4148 > to treat a document as if it was in some kind of <SPAN
4149 CLASS="emphasis"
4150 ><I
4151 CLASS="EMPHASIS"
4152 >text</I
4153 ></SPAN
4154 > format.   </P
4155 ></DD
4156 ><DT
4157 >Effect:</DT
4158 ><DD
4159 ><P
4160 >    Declares a document as text, even if the <SPAN
4161 CLASS="QUOTE"
4162 >"Content-Type:"</SPAN
4163 > isn't detected as such.
4164    </P
4165 ></DD
4166 ><DT
4167 >Type:</DT
4168 ><DD
4169 ><P
4170 >Boolean.</P
4171 ></DD
4172 ><DT
4173 >Parameter:</DT
4174 ><DD
4175 ><P
4176 >    N/A
4177    </P
4178 ></DD
4179 ><DT
4180 >Notes:</DT
4181 ><DD
4182 ><P
4183 >    As explained <TT
4184 CLASS="LITERAL"
4185 ><A
4186 HREF="actions-file.html#FILTER"
4187 >above</A
4188 ></TT
4189 >,
4190     <SPAN
4191 CLASS="APPLICATION"
4192 >Privoxy</SPAN
4193 > tries to only filter files that are
4194     in some kind of text format. The same restrictions apply to
4195     <TT
4196 CLASS="LITERAL"
4197 ><A
4198 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4199 >content-type-overwrite</A
4200 ></TT
4201 >.
4202     <TT
4203 CLASS="LITERAL"
4204 >force-text-mode</TT
4205 > declares a document as text,
4206     without looking at the <SPAN
4207 CLASS="QUOTE"
4208 >"Content-Type:"</SPAN
4209 > first.
4210    </P
4211 ><DIV
4212 CLASS="WARNING"
4213 ><P
4214 ></P
4215 ><TABLE
4216 CLASS="WARNING"
4217 BORDER="1"
4218 WIDTH="90%"
4219 ><TR
4220 ><TD
4221 ALIGN="CENTER"
4222 ><B
4223 >Warning</B
4224 ></TD
4225 ></TR
4226 ><TR
4227 ><TD
4228 ALIGN="LEFT"
4229 ><P
4230 >     Think twice before activating this action. Filtering binary data
4231      with regular expressions can cause file damage.
4232     </P
4233 ></TD
4234 ></TR
4235 ></TABLE
4236 ></DIV
4237 ></DD
4238 ><DT
4239 >Example usage:</DT
4240 ><DD
4241 ><P
4242 >     <TABLE
4243 BORDER="0"
4244 BGCOLOR="#E0E0E0"
4245 WIDTH="90%"
4246 ><TR
4247 ><TD
4248 ><PRE
4249 CLASS="SCREEN"
4250 >+force-text-mode
4251      </PRE
4252 ></TD
4253 ></TR
4254 ></TABLE
4255 >
4256    </P
4257 ></DD
4258 ></DL
4259 ></DIV
4260 ></DIV
4261 ><DIV
4262 CLASS="SECT3"
4263 ><H4
4264 CLASS="SECT3"
4265 ><A
4266 NAME="FORWARD-OVERRIDE"
4267 >8.5.17. forward-override</A
4268 ></H4
4269 ><P
4270 ></P
4271 ><DIV
4272 CLASS="VARIABLELIST"
4273 ><DL
4274 ><DT
4275 >Typical use:</DT
4276 ><DD
4277 ><P
4278 >Change the forwarding settings based on User-Agent or request origin</P
4279 ></DD
4280 ><DT
4281 >Effect:</DT
4282 ><DD
4283 ><P
4284 >    Overrules the forward directives in the configuration file.
4285    </P
4286 ></DD
4287 ><DT
4288 >Type:</DT
4289 ><DD
4290 ><P
4291 >Multi-value.</P
4292 ></DD
4293 ><DT
4294 >Parameter:</DT
4295 ><DD
4296 ><P
4297 ></P
4298 ><UL
4299 ><LI
4300 ><P
4301 ><SPAN
4302 CLASS="QUOTE"
4303 >"forward ."</SPAN
4304 > to use a direct connection without any additional proxies.</P
4305 ></LI
4306 ><LI
4307 ><P
4308 >      <SPAN
4309 CLASS="QUOTE"
4310 >"forward 127.0.0.1:8123"</SPAN
4311 > to use the HTTP proxy listening at 127.0.0.1 port 8123.
4312      </P
4313 ></LI
4314 ><LI
4315 ><P
4316 >      <SPAN
4317 CLASS="QUOTE"
4318 >"forward-socks4a 127.0.0.1:9050 ."</SPAN
4319 > to use the socks4a proxy listening at
4320       127.0.0.1 port 9050. Replace <SPAN
4321 CLASS="QUOTE"
4322 >"forward-socks4a"</SPAN
4323 > with <SPAN
4324 CLASS="QUOTE"
4325 >"forward-socks4"</SPAN
4326 >
4327       to use a socks4 connection  (with local DNS resolution) instead, use <SPAN
4328 CLASS="QUOTE"
4329 >"forward-socks5"</SPAN
4330 >
4331       for socks5 connections (with remote DNS resolution).
4332      </P
4333 ></LI
4334 ><LI
4335 ><P
4336 >      <SPAN
4337 CLASS="QUOTE"
4338 >"forward-socks4a 127.0.0.1:9050 proxy.example.org:8000"</SPAN
4339 > to use the socks4a proxy
4340       listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000.
4341       Replace <SPAN
4342 CLASS="QUOTE"
4343 >"forward-socks4a"</SPAN
4344 > with <SPAN
4345 CLASS="QUOTE"
4346 >"forward-socks4"</SPAN
4347 > to use a socks4 connection
4348       (with local DNS resolution) instead, use <SPAN
4349 CLASS="QUOTE"
4350 >"forward-socks5"</SPAN
4351 >
4352       for socks5 connections (with remote DNS resolution).
4353      </P
4354 ></LI
4355 ></UL
4356 ></DD
4357 ><DT
4358 >Notes:</DT
4359 ><DD
4360 ><P
4361 >    This action takes parameters similar to the
4362     <A
4363 HREF="config.html#FORWARDING"
4364 >forward</A
4365 > directives in the configuration
4366     file, but without the URL pattern. It can be used as replacement, but normally it's only
4367     used in cases where matching based on the request URL isn't sufficient.
4368    </P
4369 ><DIV
4370 CLASS="WARNING"
4371 ><P
4372 ></P
4373 ><TABLE
4374 CLASS="WARNING"
4375 BORDER="1"
4376 WIDTH="90%"
4377 ><TR
4378 ><TD
4379 ALIGN="CENTER"
4380 ><B
4381 >Warning</B
4382 ></TD
4383 ></TR
4384 ><TR
4385 ><TD
4386 ALIGN="LEFT"
4387 ><P
4388 >     Please read the description for the <A
4389 HREF="config.html#FORWARDING"
4390 >forward</A
4391 > directives before
4392      using this action. Forwarding to the wrong people will reduce your privacy and increase the
4393      chances of man-in-the-middle attacks.
4394     </P
4395 ><P
4396 >     If the ports are missing or invalid, default values will be used. This might change
4397      in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy
4398      to exit.
4399     </P
4400 ><P
4401 >     Use the <A
4402 HREF="http://config.privoxy.org/show-url-info"
4403 TARGET="_top"
4404 >show-url-info CGI page</A
4405 >
4406      to verify that your forward settings do what you thought the do.
4407     </P
4408 ></TD
4409 ></TR
4410 ></TABLE
4411 ></DIV
4412 ></DD
4413 ><DT
4414 >Example usage:</DT
4415 ><DD
4416 ><P
4417 >     <TABLE
4418 BORDER="0"
4419 BGCOLOR="#E0E0E0"
4420 WIDTH="90%"
4421 ><TR
4422 ><TD
4423 ><PRE
4424 CLASS="SCREEN"
4425 ># Always use direct connections for requests previously tagged as
4426 # <SPAN
4427 CLASS="QUOTE"
4428 >"User-Agent: fetch libfetch/2.0"</SPAN
4429 > and make sure
4430 # resuming downloads continues to work.
4431 # This way you can continue to use Tor for your normal browsing,
4432 # without overloading the Tor network with your FreeBSD ports updates
4433 # or downloads of bigger files like ISOs.
4434 # Note that HTTP headers are easy to fake and therefore their
4435 # values are as (un)trustworthy as your clients and users.
4436 {+forward-override{forward .} \
4437  -hide-if-modified-since      \
4438  -overwrite-last-modified     \
4439 }
4440 TAG:^User-Agent: fetch libfetch/2\.0$
4441      </PRE
4442 ></TD
4443 ></TR
4444 ></TABLE
4445 >
4446    </P
4447 ></DD
4448 ></DL
4449 ></DIV
4450 ></DIV
4451 ><DIV
4452 CLASS="SECT3"
4453 ><H4
4454 CLASS="SECT3"
4455 ><A
4456 NAME="HANDLE-AS-EMPTY-DOCUMENT"
4457 >8.5.18. handle-as-empty-document</A
4458 ></H4
4459 ><P
4460 ></P
4461 ><DIV
4462 CLASS="VARIABLELIST"
4463 ><DL
4464 ><DT
4465 >Typical use:</DT
4466 ><DD
4467 ><P
4468 >Mark URLs that should be replaced by empty documents <SPAN
4469 CLASS="emphasis"
4470 ><I
4471 CLASS="EMPHASIS"
4472 >if they get blocked</I
4473 ></SPAN
4474 ></P
4475 ></DD
4476 ><DT
4477 >Effect:</DT
4478 ><DD
4479 ><P
4480 >    This action alone doesn't do anything noticeable. It just marks URLs.
4481     If the <TT
4482 CLASS="LITERAL"
4483 ><A
4484 HREF="actions-file.html#BLOCK"
4485 >block</A
4486 ></TT
4487 > action <SPAN
4488 CLASS="emphasis"
4489 ><I
4490 CLASS="EMPHASIS"
4491 >also applies</I
4492 ></SPAN
4493 >,
4494     the presence or absence of this mark decides whether an HTML <SPAN
4495 CLASS="QUOTE"
4496 >"BLOCKED"</SPAN
4497 >
4498     page, or an empty document will be sent to the client as a substitute for the blocked content.
4499     The <SPAN
4500 CLASS="emphasis"
4501 ><I
4502 CLASS="EMPHASIS"
4503 >empty</I
4504 ></SPAN
4505 > document isn't literally empty, but actually contains a single space.
4506    </P
4507 ></DD
4508 ><DT
4509 >Type:</DT
4510 ><DD
4511 ><P
4512 >Boolean.</P
4513 ></DD
4514 ><DT
4515 >Parameter:</DT
4516 ><DD
4517 ><P
4518 >    N/A
4519    </P
4520 ></DD
4521 ><DT
4522 >Notes:</DT
4523 ><DD
4524 ><P
4525 >    Some browsers complain about syntax errors if JavaScript documents
4526     are blocked with <SPAN
4527 CLASS="APPLICATION"
4528 >Privoxy's</SPAN
4529 >
4530     default HTML page; this option can be used to silence them.
4531     And of course this action can also be used to eliminate the <SPAN
4532 CLASS="APPLICATION"
4533 >Privoxy</SPAN
4534 >
4535     BLOCKED message in frames.
4536    </P
4537 ><P
4538 >    The content type for the empty document can be specified with
4539     <TT
4540 CLASS="LITERAL"
4541 ><A
4542 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4543 >content-type-overwrite{}</A
4544 ></TT
4545 >,
4546     but usually this isn't necessary.
4547    </P
4548 ></DD
4549 ><DT
4550 >Example usage:</DT
4551 ><DD
4552 ><P
4553 >     <TABLE
4554 BORDER="0"
4555 BGCOLOR="#E0E0E0"
4556 WIDTH="90%"
4557 ><TR
4558 ><TD
4559 ><PRE
4560 CLASS="SCREEN"
4561 ># Block all documents on example.org that end with ".js",
4562 # but send an empty document instead of the usual HTML message. 
4563 {+block{Blocked JavaScript} +handle-as-empty-document}
4564 example.org/.*\.js$
4565      </PRE
4566 ></TD
4567 ></TR
4568 ></TABLE
4569 >
4570    </P
4571 ></DD
4572 ></DL
4573 ></DIV
4574 ></DIV
4575 ><DIV
4576 CLASS="SECT3"
4577 ><H4
4578 CLASS="SECT3"
4579 ><A
4580 NAME="HANDLE-AS-IMAGE"
4581 >8.5.19. handle-as-image</A
4582 ></H4
4583 ><P
4584 ></P
4585 ><DIV
4586 CLASS="VARIABLELIST"
4587 ><DL
4588 ><DT
4589 >Typical use:</DT
4590 ><DD
4591 ><P
4592 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
4593 CLASS="emphasis"
4594 ><I
4595 CLASS="EMPHASIS"
4596 >if they do get blocked</I
4597 ></SPAN
4598 >, rather than HTML pages)</P
4599 ></DD
4600 ><DT
4601 >Effect:</DT
4602 ><DD
4603 ><P
4604 >    This action alone doesn't do anything noticeable. It just marks URLs as images.
4605     If the <TT
4606 CLASS="LITERAL"
4607 ><A
4608 HREF="actions-file.html#BLOCK"
4609 >block</A
4610 ></TT
4611 > action <SPAN
4612 CLASS="emphasis"
4613 ><I
4614 CLASS="EMPHASIS"
4615 >also applies</I
4616 ></SPAN
4617 >,
4618     the presence or absence of this mark decides whether an HTML <SPAN
4619 CLASS="QUOTE"
4620 >"blocked"</SPAN
4621 >
4622     page, or a replacement image (as determined by the <TT
4623 CLASS="LITERAL"
4624 ><A
4625 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4626 >set-image-blocker</A
4627 ></TT
4628 > action) will be sent to the
4629     client as a substitute for the blocked content.
4630    </P
4631 ></DD
4632 ><DT
4633 >Type:</DT
4634 ><DD
4635 ><P
4636 >Boolean.</P
4637 ></DD
4638 ><DT
4639 >Parameter:</DT
4640 ><DD
4641 ><P
4642 >    N/A
4643    </P
4644 ></DD
4645 ><DT
4646 >Notes:</DT
4647 ><DD
4648 ><P
4649 >    The below generic example section is actually part of <TT
4650 CLASS="FILENAME"
4651 >default.action</TT
4652 >.
4653     It marks all URLs with well-known image file name extensions as images and should
4654     be left intact. 
4655    </P
4656 ><P
4657 >    Users will probably only want to use the handle-as-image action in conjunction with
4658     <TT
4659 CLASS="LITERAL"
4660 ><A
4661 HREF="actions-file.html#BLOCK"
4662 >block</A
4663 ></TT
4664 >, to block sources of banners, whose URLs don't
4665     reflect the file type, like in the second example section.
4666    </P
4667 ><P
4668 >    Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
4669     frames require an HTML page to be sent, or they won't display properly.
4670     Forcing <TT
4671 CLASS="LITERAL"
4672 >handle-as-image</TT
4673 > in this situation will not replace the
4674     ad frame with an image, but lead to error messages.
4675    </P
4676 ></DD
4677 ><DT
4678 >Example usage (sections):</DT
4679 ><DD
4680 ><P
4681 >     <TABLE
4682 BORDER="0"
4683 BGCOLOR="#E0E0E0"
4684 WIDTH="90%"
4685 ><TR
4686 ><TD
4687 ><PRE
4688 CLASS="SCREEN"
4689 ># Generic image extensions:
4690 #
4691 {+handle-as-image}
4692 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4693
4694 # These don't look like images, but they're banners and should be
4695 # blocked as images:
4696 #
4697 {+block{Nasty banners.} +handle-as-image}
4698 nasty-banner-server.example.com/junk.cgi\?output=trash</PRE
4699 ></TD
4700 ></TR
4701 ></TABLE
4702 >
4703    </P
4704 ></DD
4705 ></DL
4706 ></DIV
4707 ></DIV
4708 ><DIV
4709 CLASS="SECT3"
4710 ><H4
4711 CLASS="SECT3"
4712 ><A
4713 NAME="HIDE-ACCEPT-LANGUAGE"
4714 >8.5.20. hide-accept-language</A
4715 ></H4
4716 ><P
4717 ></P
4718 ><DIV
4719 CLASS="VARIABLELIST"
4720 ><DL
4721 ><DT
4722 >Typical use:</DT
4723 ><DD
4724 ><P
4725 >Pretend to use different language settings.</P
4726 ></DD
4727 ><DT
4728 >Effect:</DT
4729 ><DD
4730 ><P
4731 >    Deletes or replaces the <SPAN
4732 CLASS="QUOTE"
4733 >"Accept-Language:"</SPAN
4734 > HTTP header in client requests.
4735    </P
4736 ></DD
4737 ><DT
4738 >Type:</DT
4739 ><DD
4740 ><P
4741 >Parameterized.</P
4742 ></DD
4743 ><DT
4744 >Parameter:</DT
4745 ><DD
4746 ><P
4747 >    Keyword: <SPAN
4748 CLASS="QUOTE"
4749 >"block"</SPAN
4750 >, or any user defined value.
4751    </P
4752 ></DD
4753 ><DT
4754 >Notes:</DT
4755 ><DD
4756 ><P
4757 >    Faking the browser's language settings can be useful to make a
4758     foreign User-Agent set with
4759     <TT
4760 CLASS="LITERAL"
4761 ><A
4762 HREF="actions-file.html#HIDE-USER-AGENT"
4763 >hide-user-agent</A
4764 ></TT
4765 >
4766     more believable.
4767    </P
4768 ><P
4769 >    However some sites with content in different languages check the
4770     <SPAN
4771 CLASS="QUOTE"
4772 >"Accept-Language:"</SPAN
4773 > to decide which one to take by default.
4774     Sometimes it isn't possible to later switch to another language without
4775     changing the <SPAN
4776 CLASS="QUOTE"
4777 >"Accept-Language:"</SPAN
4778 > header first.
4779    </P
4780 ><P
4781 >    Therefore it's a good idea to either only change the
4782     <SPAN
4783 CLASS="QUOTE"
4784 >"Accept-Language:"</SPAN
4785 > header to languages you understand,
4786     or to languages that aren't wide spread.
4787    </P
4788 ><P
4789 >    Before setting the <SPAN
4790 CLASS="QUOTE"
4791 >"Accept-Language:"</SPAN
4792 > header
4793     to a rare language, you should consider that it helps to
4794     make your requests unique and thus easier to trace.
4795     If you don't plan to change this header frequently,
4796     you should stick to a common language. 
4797    </P
4798 ></DD
4799 ><DT
4800 >Example usage (section):</DT
4801 ><DD
4802 ><P
4803 >     <TABLE
4804 BORDER="0"
4805 BGCOLOR="#E0E0E0"
4806 WIDTH="90%"
4807 ><TR
4808 ><TD
4809 ><PRE
4810 CLASS="SCREEN"
4811 ># Pretend to use Canadian language settings.
4812 {+hide-accept-language{en-ca} \
4813 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4814 }
4815 /   </PRE
4816 ></TD
4817 ></TR
4818 ></TABLE
4819 >
4820    </P
4821 ></DD
4822 ></DL
4823 ></DIV
4824 ></DIV
4825 ><DIV
4826 CLASS="SECT3"
4827 ><H4
4828 CLASS="SECT3"
4829 ><A
4830 NAME="HIDE-CONTENT-DISPOSITION"
4831 >8.5.21. hide-content-disposition</A
4832 ></H4
4833 ><P
4834 ></P
4835 ><DIV
4836 CLASS="VARIABLELIST"
4837 ><DL
4838 ><DT
4839 >Typical use:</DT
4840 ><DD
4841 ><P
4842 >Prevent download menus for content you prefer to view inside the browser.</P
4843 ></DD
4844 ><DT
4845 >Effect:</DT
4846 ><DD
4847 ><P
4848 >    Deletes or replaces the <SPAN
4849 CLASS="QUOTE"
4850 >"Content-Disposition:"</SPAN
4851 > HTTP header set by some servers.
4852    </P
4853 ></DD
4854 ><DT
4855 >Type:</DT
4856 ><DD
4857 ><P
4858 >Parameterized.</P
4859 ></DD
4860 ><DT
4861 >Parameter:</DT
4862 ><DD
4863 ><P
4864 >    Keyword: <SPAN
4865 CLASS="QUOTE"
4866 >"block"</SPAN
4867 >, or any user defined value.
4868    </P
4869 ></DD
4870 ><DT
4871 >Notes:</DT
4872 ><DD
4873 ><P
4874 >    Some servers set the <SPAN
4875 CLASS="QUOTE"
4876 >"Content-Disposition:"</SPAN
4877 > HTTP header for
4878     documents they assume you want to save locally before viewing them.
4879     The <SPAN
4880 CLASS="QUOTE"
4881 >"Content-Disposition:"</SPAN
4882 > header contains the file name
4883     the browser is supposed to use by default.
4884    </P
4885 ><P
4886 >    In most browsers that understand this header, it makes it impossible to
4887     <SPAN
4888 CLASS="emphasis"
4889 ><I
4890 CLASS="EMPHASIS"
4891 >just view</I
4892 ></SPAN
4893 > the document, without downloading it first,
4894     even if it's just a simple text file or an image.
4895    </P
4896 ><P
4897 >    Removing the <SPAN
4898 CLASS="QUOTE"
4899 >"Content-Disposition:"</SPAN
4900 > header helps
4901     to prevent this annoyance, but some browsers additionally check the
4902     <SPAN
4903 CLASS="QUOTE"
4904 >"Content-Type:"</SPAN
4905 > header, before they decide if they can
4906     display a document without saving it first. In these cases, you have
4907     to change this header as well, before the browser stops displaying
4908     download menus.
4909    </P
4910 ><P
4911 >    It is also possible to change the server's file name suggestion
4912     to another one, but in most cases it isn't worth the time to set
4913     it up.
4914    </P
4915 ><P
4916 >    This action will probably be removed in the future,
4917     use server-header filters instead.
4918    </P
4919 ></DD
4920 ><DT
4921 >Example usage:</DT
4922 ><DD
4923 ><P
4924 >     <TABLE
4925 BORDER="0"
4926 BGCOLOR="#E0E0E0"
4927 WIDTH="90%"
4928 ><TR
4929 ><TD
4930 ><PRE
4931 CLASS="SCREEN"
4932 ># Disarm the download link in Sourceforge's patch tracker
4933 { -filter \
4934  +content-type-overwrite{text/plain}\
4935  +hide-content-disposition{block} }
4936  .sourceforge.net/tracker/download\.php</PRE
4937 ></TD
4938 ></TR
4939 ></TABLE
4940 >
4941    </P
4942 ></DD
4943 ></DL
4944 ></DIV
4945 ></DIV
4946 ><DIV
4947 CLASS="SECT3"
4948 ><H4
4949 CLASS="SECT3"
4950 ><A
4951 NAME="HIDE-IF-MODIFIED-SINCE"
4952 >8.5.22. hide-if-modified-since</A
4953 ></H4
4954 ><P
4955 ></P
4956 ><DIV
4957 CLASS="VARIABLELIST"
4958 ><DL
4959 ><DT
4960 >Typical use:</DT
4961 ><DD
4962 ><P
4963 >Prevent yet another way to track the user's steps between sessions.</P
4964 ></DD
4965 ><DT
4966 >Effect:</DT
4967 ><DD
4968 ><P
4969 >    Deletes the <SPAN
4970 CLASS="QUOTE"
4971 >"If-Modified-Since:"</SPAN
4972 > HTTP client header or modifies its value. 
4973    </P
4974 ></DD
4975 ><DT
4976 >Type:</DT
4977 ><DD
4978 ><P
4979 >Parameterized.</P
4980 ></DD
4981 ><DT
4982 >Parameter:</DT
4983 ><DD
4984 ><P
4985 >    Keyword: <SPAN
4986 CLASS="QUOTE"
4987 >"block"</SPAN
4988 >, or a user defined value that specifies a range of hours.
4989    </P
4990 ></DD
4991 ><DT
4992 >Notes:</DT
4993 ><DD
4994 ><P
4995 >    Removing this header is useful for filter testing, where you want to force a real
4996     reload instead of getting status code <SPAN
4997 CLASS="QUOTE"
4998 >"304"</SPAN
4999 >, which would cause the
5000     browser to use a cached copy of the page.
5001    </P
5002 ><P
5003 >    Instead of removing the header, <TT
5004 CLASS="LITERAL"
5005 >hide-if-modified-since</TT
5006 > can
5007     also add or subtract a random amount of time to/from the header's value.
5008     You specify a range of minutes where the random factor should be chosen from and
5009     <SPAN
5010 CLASS="APPLICATION"
5011 >Privoxy</SPAN
5012 > does the rest. A negative value means
5013     subtracting, a positive value adding.
5014    </P
5015 ><P
5016 >    Randomizing the value of the <SPAN
5017 CLASS="QUOTE"
5018 >"If-Modified-Since:"</SPAN
5019 > makes
5020     it less likely that the server can use the time as a cookie replacement,
5021     but you will run into caching problems if the random range is too high.
5022    </P
5023 ><P
5024 >    It is a good idea to only use a small negative value and let
5025     <TT
5026 CLASS="LITERAL"
5027 ><A
5028 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
5029 >overwrite-last-modified</A
5030 ></TT
5031 >
5032     handle the greater changes.
5033    </P
5034 ><P
5035 >    It is also recommended to use this action together with
5036     <TT
5037 CLASS="LITERAL"
5038 ><A
5039 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5040 >crunch-if-none-match</A
5041 ></TT
5042 >,
5043     otherwise it's more or less pointless.
5044    </P
5045 ></DD
5046 ><DT
5047 >Example usage (section):</DT
5048 ><DD
5049 ><P
5050 >     <TABLE
5051 BORDER="0"
5052 BGCOLOR="#E0E0E0"
5053 WIDTH="90%"
5054 ><TR
5055 ><TD
5056 ><PRE
5057 CLASS="SCREEN"
5058 ># Let the browser revalidate but make tracking based on the time less likely.
5059 {+hide-if-modified-since{-60} \
5060  +overwrite-last-modified{randomize} \
5061  +crunch-if-none-match}
5062 /</PRE
5063 ></TD
5064 ></TR
5065 ></TABLE
5066 >
5067    </P
5068 ></DD
5069 ></DL
5070 ></DIV
5071 ></DIV
5072 ><DIV
5073 CLASS="SECT3"
5074 ><H4
5075 CLASS="SECT3"
5076 ><A
5077 NAME="HIDE-FROM-HEADER"
5078 >8.5.23. hide-from-header</A
5079 ></H4
5080 ><P
5081 ></P
5082 ><DIV
5083 CLASS="VARIABLELIST"
5084 ><DL
5085 ><DT
5086 >Typical use:</DT
5087 ><DD
5088 ><P
5089 >Keep your (old and ill) browser from telling web servers your email address</P
5090 ></DD
5091 ><DT
5092 >Effect:</DT
5093 ><DD
5094 ><P
5095 >    Deletes any existing <SPAN
5096 CLASS="QUOTE"
5097 >"From:"</SPAN
5098 > HTTP header, or replaces it with the
5099     specified string.
5100    </P
5101 ></DD
5102 ><DT
5103 >Type:</DT
5104 ><DD
5105 ><P
5106 >Parameterized.</P
5107 ></DD
5108 ><DT
5109 >Parameter:</DT
5110 ><DD
5111 ><P
5112 >    Keyword: <SPAN
5113 CLASS="QUOTE"
5114 >"block"</SPAN
5115 >, or any user defined value.
5116    </P
5117 ></DD
5118 ><DT
5119 >Notes:</DT
5120 ><DD
5121 ><P
5122 >    The keyword <SPAN
5123 CLASS="QUOTE"
5124 >"block"</SPAN
5125 > will completely remove the header 
5126     (not to be confused with the <TT
5127 CLASS="LITERAL"
5128 ><A
5129 HREF="actions-file.html#BLOCK"
5130 >block</A
5131 ></TT
5132 >
5133     action).
5134    </P
5135 ><P
5136 >    Alternately, you can specify any value you prefer to be sent to the web
5137     server. If you do, it is a matter of fairness not to use any address that
5138     is actually used by a real person.
5139    </P
5140 ><P
5141 >    This action is rarely needed, as modern web browsers don't send
5142     <SPAN
5143 CLASS="QUOTE"
5144 >"From:"</SPAN
5145 > headers anymore.
5146    </P
5147 ></DD
5148 ><DT
5149 >Example usage:</DT
5150 ><DD
5151 ><P
5152 >    <TABLE
5153 BORDER="0"
5154 BGCOLOR="#E0E0E0"
5155 WIDTH="90%"
5156 ><TR
5157 ><TD
5158 ><PRE
5159 CLASS="SCREEN"
5160 >+hide-from-header{block}</PRE
5161 ></TD
5162 ></TR
5163 ></TABLE
5164 > or
5165     <TABLE
5166 BORDER="0"
5167 BGCOLOR="#E0E0E0"
5168 WIDTH="90%"
5169 ><TR
5170 ><TD
5171 ><PRE
5172 CLASS="SCREEN"
5173 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
5174 ></TD
5175 ></TR
5176 ></TABLE
5177 >
5178    </P
5179 ></DD
5180 ></DL
5181 ></DIV
5182 ></DIV
5183 ><DIV
5184 CLASS="SECT3"
5185 ><H4
5186 CLASS="SECT3"
5187 ><A
5188 NAME="HIDE-REFERRER"
5189 >8.5.24. hide-referrer</A
5190 ></H4
5191 ><A
5192 NAME="HIDE-REFERER"
5193 ></A
5194 ><P
5195 ></P
5196 ><DIV
5197 CLASS="VARIABLELIST"
5198 ><DL
5199 ><DT
5200 >Typical use:</DT
5201 ><DD
5202 ><P
5203 >Conceal which link you followed to get to a particular site</P
5204 ></DD
5205 ><DT
5206 >Effect:</DT
5207 ><DD
5208 ><P
5209 >    Deletes the <SPAN
5210 CLASS="QUOTE"
5211 >"Referer:"</SPAN
5212 > (sic) HTTP header from the client request,
5213     or replaces it with a forged one.
5214    </P
5215 ></DD
5216 ><DT
5217 >Type:</DT
5218 ><DD
5219 ><P
5220 >Parameterized.</P
5221 ></DD
5222 ><DT
5223 >Parameter:</DT
5224 ><DD
5225 ><P
5226 ></P
5227 ><UL
5228 ><LI
5229 ><P
5230 ><SPAN
5231 CLASS="QUOTE"
5232 >"conditional-block"</SPAN
5233 > to delete the header completely if the host has changed.</P
5234 ></LI
5235 ><LI
5236 ><P
5237 ><SPAN
5238 CLASS="QUOTE"
5239 >"conditional-forge"</SPAN
5240 > to forge the header if the host has changed.</P
5241 ></LI
5242 ><LI
5243 ><P
5244 ><SPAN
5245 CLASS="QUOTE"
5246 >"block"</SPAN
5247 > to delete the header unconditionally.</P
5248 ></LI
5249 ><LI
5250 ><P
5251 ><SPAN
5252 CLASS="QUOTE"
5253 >"forge"</SPAN
5254 > to pretend to be coming from the homepage of the server we are talking to.</P
5255 ></LI
5256 ><LI
5257 ><P
5258 >Any other string to set a user defined referrer.</P
5259 ></LI
5260 ></UL
5261 ></DD
5262 ><DT
5263 >Notes:</DT
5264 ><DD
5265 ><P
5266 >    <TT
5267 CLASS="LITERAL"
5268 >conditional-block</TT
5269 > is the only parameter,
5270     that isn't easily detected in the server's log file. If it blocks the
5271     referrer, the request will look like the visitor used a bookmark or
5272     typed in the address directly.
5273    </P
5274 ><P
5275 >    Leaving the referrer unmodified for requests on the same host
5276     allows the server owner to see the visitor's <SPAN
5277 CLASS="QUOTE"
5278 >"click path"</SPAN
5279 >,
5280     but in most cases she could also get that information by comparing
5281     other parts of the log file: for example the User-Agent if it isn't
5282     a very common one, or the user's IP address if it doesn't change between
5283     different requests.
5284    </P
5285 ><P
5286 >    Always blocking the referrer, or using a custom one, can lead to
5287     failures on servers that check the referrer before they answer any
5288     requests, in an attempt to prevent their content from being
5289     embedded or linked to elsewhere.
5290    </P
5291 ><P
5292 >    Both <TT
5293 CLASS="LITERAL"
5294 >conditional-block</TT
5295 > and <TT
5296 CLASS="LITERAL"
5297 >forge</TT
5298 >
5299     will work with referrer checks, as long as content and valid referring page
5300     are on the same host. Most of the time that's the case.
5301    </P
5302 ><P
5303 >  
5304     <TT
5305 CLASS="LITERAL"
5306 >hide-referer</TT
5307 > is an alternate spelling of
5308     <TT
5309 CLASS="LITERAL"
5310 >hide-referrer</TT
5311 > and the two can be can be freely
5312     substituted with each other. (<SPAN
5313 CLASS="QUOTE"
5314 >"referrer"</SPAN
5315 > is the
5316     correct English spelling, however the HTTP specification has a bug - it
5317     requires it to be spelled as <SPAN
5318 CLASS="QUOTE"
5319 >"referer"</SPAN
5320 >.) 
5321    </P
5322 ></DD
5323 ><DT
5324 >Example usage:</DT
5325 ><DD
5326 ><P
5327 >     <TABLE
5328 BORDER="0"
5329 BGCOLOR="#E0E0E0"
5330 WIDTH="90%"
5331 ><TR
5332 ><TD
5333 ><PRE
5334 CLASS="SCREEN"
5335 >+hide-referrer{forge}</PRE
5336 ></TD
5337 ></TR
5338 ></TABLE
5339 > or
5340      <TABLE
5341 BORDER="0"
5342 BGCOLOR="#E0E0E0"
5343 WIDTH="90%"
5344 ><TR
5345 ><TD
5346 ><PRE
5347 CLASS="SCREEN"
5348 >+hide-referrer{http://www.yahoo.com/}</PRE
5349 ></TD
5350 ></TR
5351 ></TABLE
5352 >
5353    </P
5354 ></DD
5355 ></DL
5356 ></DIV
5357 ></DIV
5358 ><DIV
5359 CLASS="SECT3"
5360 ><H4
5361 CLASS="SECT3"
5362 ><A
5363 NAME="HIDE-USER-AGENT"
5364 >8.5.25. hide-user-agent</A
5365 ></H4
5366 ><P
5367 ></P
5368 ><DIV
5369 CLASS="VARIABLELIST"
5370 ><DL
5371 ><DT
5372 >Typical use:</DT
5373 ><DD
5374 ><P
5375 >Try to conceal your type of browser and client operating system</P
5376 ></DD
5377 ><DT
5378 >Effect:</DT
5379 ><DD
5380 ><P
5381 >    Replaces the value of the <SPAN
5382 CLASS="QUOTE"
5383 >"User-Agent:"</SPAN
5384 > HTTP header
5385     in client requests with the specified value.
5386    </P
5387 ></DD
5388 ><DT
5389 >Type:</DT
5390 ><DD
5391 ><P
5392 >Parameterized.</P
5393 ></DD
5394 ><DT
5395 >Parameter:</DT
5396 ><DD
5397 ><P
5398 >    Any user-defined string.
5399    </P
5400 ></DD
5401 ><DT
5402 >Notes:</DT
5403 ><DD
5404 ><DIV
5405 CLASS="WARNING"
5406 ><P
5407 ></P
5408 ><TABLE
5409 CLASS="WARNING"
5410 BORDER="1"
5411 WIDTH="90%"
5412 ><TR
5413 ><TD
5414 ALIGN="CENTER"
5415 ><B
5416 >Warning</B
5417 ></TD
5418 ></TR
5419 ><TR
5420 ><TD
5421 ALIGN="LEFT"
5422 ><P
5423 >     This can lead to problems on web sites that depend on looking at this header in
5424      order to customize their content for different browsers (which, by the
5425      way, is <SPAN
5426 CLASS="emphasis"
5427 ><I
5428 CLASS="EMPHASIS"
5429 >NOT</I
5430 ></SPAN
5431 > the right thing to do: good web sites
5432      work browser-independently). 
5433     </P
5434 ></TD
5435 ></TR
5436 ></TABLE
5437 ></DIV
5438 ><P
5439 >    Using this action in multi-user setups or wherever different types of
5440     browsers will access the same <SPAN
5441 CLASS="APPLICATION"
5442 >Privoxy</SPAN
5443 > is
5444     <SPAN
5445 CLASS="emphasis"
5446 ><I
5447 CLASS="EMPHASIS"
5448 >not recommended</I
5449 ></SPAN
5450 >. In single-user, single-browser
5451     setups, you might use it to delete your OS version information from
5452     the headers, because it is an invitation to exploit known bugs for your
5453     OS. It is also occasionally useful to forge this in order to access 
5454     sites that won't let you in otherwise (though there may be a good 
5455     reason in some cases). Example of this: some MSN sites will not 
5456     let <SPAN
5457 CLASS="APPLICATION"
5458 >Mozilla</SPAN
5459 > enter, yet forging to a 
5460     <SPAN
5461 CLASS="APPLICATION"
5462 >Netscape 6.1</SPAN
5463 > user-agent works just fine.
5464     (Must be just a silly MS goof, I'm sure :-).
5465    </P
5466 ><P
5467 >     More information on known user-agent strings can be found at 
5468      <A
5469 HREF="http://www.user-agents.org/"
5470 TARGET="_top"
5471 >http://www.user-agents.org/</A
5472 >
5473      and 
5474      <A
5475 HREF="http://en.wikipedia.org/wiki/User_agent"
5476 TARGET="_top"
5477 >http://en.wikipedia.org/wiki/User_agent</A
5478 >.
5479    </P
5480 ></DD
5481 ><DT
5482 >Example usage:</DT
5483 ><DD
5484 ><P
5485 >     <TABLE
5486 BORDER="0"
5487 BGCOLOR="#E0E0E0"
5488 WIDTH="90%"
5489 ><TR
5490 ><TD
5491 ><PRE
5492 CLASS="SCREEN"
5493 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
5494 ></TD
5495 ></TR
5496 ></TABLE
5497 >
5498    </P
5499 ></DD
5500 ></DL
5501 ></DIV
5502 ></DIV
5503 ><DIV
5504 CLASS="SECT3"
5505 ><H4
5506 CLASS="SECT3"
5507 ><A
5508 NAME="LIMIT-CONNECT"
5509 >8.5.26. limit-connect</A
5510 ></H4
5511 ><P
5512 ></P
5513 ><DIV
5514 CLASS="VARIABLELIST"
5515 ><DL
5516 ><DT
5517 >Typical use:</DT
5518 ><DD
5519 ><P
5520 >Prevent abuse of <SPAN
5521 CLASS="APPLICATION"
5522 >Privoxy</SPAN
5523 > as a TCP proxy relay or disable SSL for untrusted sites</P
5524 ></DD
5525 ><DT
5526 >Effect:</DT
5527 ><DD
5528 ><P
5529 >    Specifies to which ports HTTP CONNECT requests are allowable.
5530    </P
5531 ></DD
5532 ><DT
5533 >Type:</DT
5534 ><DD
5535 ><P
5536 >Parameterized.</P
5537 ></DD
5538 ><DT
5539 >Parameter:</DT
5540 ><DD
5541 ><P
5542 >    A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5543     defaulting to 0 and the maximum to 65K).
5544    </P
5545 ></DD
5546 ><DT
5547 >Notes:</DT
5548 ><DD
5549 ><P
5550 >    By default, i.e. if no <TT
5551 CLASS="LITERAL"
5552 >limit-connect</TT
5553 > action applies,
5554     <SPAN
5555 CLASS="APPLICATION"
5556 >Privoxy</SPAN
5557 > allows HTTP CONNECT requests to all
5558     ports. Use <TT
5559 CLASS="LITERAL"
5560 >limit-connect</TT
5561 > if fine-grained control
5562     is desired for some or all destinations.
5563    </P
5564 ><P
5565 >    The CONNECT methods exists in HTTP to allow access to secure websites
5566     (<SPAN
5567 CLASS="QUOTE"
5568 >"https://"</SPAN
5569 > URLs) through proxies. It works very simply:
5570     the proxy connects to the server on the specified port, and then
5571     short-circuits its connections to the client and to the remote server.
5572     This means CONNECT-enabled proxies can be used as TCP relays very easily.
5573   </P
5574 ><P
5575 >   <SPAN
5576 CLASS="APPLICATION"
5577 >Privoxy</SPAN
5578 > relays HTTPS traffic without seeing
5579    the decoded content. Websites can leverage this limitation to circumvent <SPAN
5580 CLASS="APPLICATION"
5581 >Privoxy</SPAN
5582 >'s
5583    filters. By specifying an invalid port range you can disable HTTPS entirely.
5584   </P
5585 ></DD
5586 ><DT
5587 >Example usages:</DT
5588 ><DD
5589 ><P
5590 >     <TABLE
5591 BORDER="0"
5592 BGCOLOR="#E0E0E0"
5593 WIDTH="90%"
5594 ><TR
5595 ><TD
5596 ><PRE
5597 CLASS="SCREEN"
5598 >+limit-connect{443}                   # Port 443 is OK.
5599 +limit-connect{80,443}                # Ports 80 and 443 are OK.
5600 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5601 +limit-connect{-}                     # All ports are OK
5602 +limit-connect{,}                     # No HTTPS/SSL traffic is allowed</PRE
5603 ></TD
5604 ></TR
5605 ></TABLE
5606 >
5607    </P
5608 ></DD
5609 ></DL
5610 ></DIV
5611 ></DIV
5612 ><DIV
5613 CLASS="SECT3"
5614 ><H4
5615 CLASS="SECT3"
5616 ><A
5617 NAME="PREVENT-COMPRESSION"
5618 >8.5.27. prevent-compression</A
5619 ></H4
5620 ><P
5621 ></P
5622 ><DIV
5623 CLASS="VARIABLELIST"
5624 ><DL
5625 ><DT
5626 >Typical use:</DT
5627 ><DD
5628 ><P
5629 >    Ensure that servers send the content uncompressed, so it can be
5630     passed through <TT
5631 CLASS="LITERAL"
5632 ><A
5633 HREF="actions-file.html#FILTER"
5634 >filter</A
5635 ></TT
5636 >s.
5637    </P
5638 ></DD
5639 ><DT
5640 >Effect:</DT
5641 ><DD
5642 ><P
5643 >    Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5644    </P
5645 ></DD
5646 ><DT
5647 >Type:</DT
5648 ><DD
5649 ><P
5650 >Boolean.</P
5651 ></DD
5652 ><DT
5653 >Parameter:</DT
5654 ><DD
5655 ><P
5656 >    N/A
5657    </P
5658 ></DD
5659 ><DT
5660 >Notes:</DT
5661 ><DD
5662 ><P
5663 >    More and more websites send their content compressed by default, which
5664     is generally a good idea and saves bandwidth. But the <TT
5665 CLASS="LITERAL"
5666 ><A
5667 HREF="actions-file.html#FILTER"
5668 >filter</A
5669 ></TT
5670 > and
5671     <TT
5672 CLASS="LITERAL"
5673 ><A
5674 HREF="actions-file.html#DEANIMATE-GIFS"
5675 >deanimate-gifs</A
5676 ></TT
5677 >
5678     actions need access to the uncompressed data.
5679    </P
5680 ><P
5681 >    When compiled with zlib support (available since <SPAN
5682 CLASS="APPLICATION"
5683 >Privoxy</SPAN
5684 > 3.0.7), content that should be
5685     filtered is decompressed on-the-fly and you don't have to worry about this action.
5686     If you are using an older <SPAN
5687 CLASS="APPLICATION"
5688 >Privoxy</SPAN
5689 > version, or one that hasn't been compiled with zlib
5690     support, this action can be used to convince the server to send the content uncompressed.
5691    </P
5692 ><P
5693 >    Most text-based instances compress very well, the size is seldom decreased by less than 50%,
5694     for markup-heavy instances like news feeds saving more than 90% of the original size isn't
5695     unusual. 
5696    </P
5697 ><P
5698 >    Not using compression will therefore slow down the transfer, and you should only
5699     enable this action if you really need it. As of <SPAN
5700 CLASS="APPLICATION"
5701 >Privoxy</SPAN
5702 > 3.0.7 it's disabled in all
5703     predefined action settings.
5704    </P
5705 ><P
5706 >    Note that some (rare) ill-configured sites don't handle requests for uncompressed
5707     documents correctly. Broken PHP applications tend to send an empty document body,
5708     some IIS versions only send the beginning of the content. If you enable
5709     <TT
5710 CLASS="LITERAL"
5711 >prevent-compression</TT
5712 > per default, you might want to add
5713     exceptions for those sites. See the example for how to do that.
5714    </P
5715 ></DD
5716 ><DT
5717 >Example usage (sections):</DT
5718 ><DD
5719 ><P
5720 >    <TABLE
5721 BORDER="0"
5722 BGCOLOR="#E0E0E0"
5723 WIDTH="90%"
5724 ><TR
5725 ><TD
5726 ><PRE
5727 CLASS="SCREEN"
5728 ># Selectively turn off compression, and enable a filter
5729 #
5730 { +filter{tiny-textforms} +prevent-compression }
5731 # Match only these sites
5732  .google.
5733  sourceforge.net
5734  sf.net
5735
5736 # Or instead, we could set a universal default:
5737 #
5738 { +prevent-compression }
5739  / # Match all sites
5740
5741 # Then maybe make exceptions for broken sites:
5742 #
5743 { -prevent-compression }
5744 .compusa.com/</PRE
5745 ></TD
5746 ></TR
5747 ></TABLE
5748 >
5749    </P
5750 ></DD
5751 ></DL
5752 ></DIV
5753 ></DIV
5754 ><DIV
5755 CLASS="SECT3"
5756 ><H4
5757 CLASS="SECT3"
5758 ><A
5759 NAME="OVERWRITE-LAST-MODIFIED"
5760 >8.5.28. overwrite-last-modified</A
5761 ></H4
5762 ><P
5763 ></P
5764 ><DIV
5765 CLASS="VARIABLELIST"
5766 ><DL
5767 ><DT
5768 >Typical use:</DT
5769 ><DD
5770 ><P
5771 >Prevent yet another way to track the user's steps between sessions.</P
5772 ></DD
5773 ><DT
5774 >Effect:</DT
5775 ><DD
5776 ><P
5777 >    Deletes the <SPAN
5778 CLASS="QUOTE"
5779 >"Last-Modified:"</SPAN
5780 > HTTP server header or modifies its value. 
5781    </P
5782 ></DD
5783 ><DT
5784 >Type:</DT
5785 ><DD
5786 ><P
5787 >Parameterized.</P
5788 ></DD
5789 ><DT
5790 >Parameter:</DT
5791 ><DD
5792 ><P
5793 >    One of the keywords: <SPAN
5794 CLASS="QUOTE"
5795 >"block"</SPAN
5796 >, <SPAN
5797 CLASS="QUOTE"
5798 >"reset-to-request-time"</SPAN
5799 >
5800     and <SPAN
5801 CLASS="QUOTE"
5802 >"randomize"</SPAN
5803 >
5804    </P
5805 ></DD
5806 ><DT
5807 >Notes:</DT
5808 ><DD
5809 ><P
5810 >    Removing the <SPAN
5811 CLASS="QUOTE"
5812 >"Last-Modified:"</SPAN
5813 > header is useful for filter
5814     testing, where you want to force a real reload instead of getting status
5815     code <SPAN
5816 CLASS="QUOTE"
5817 >"304"</SPAN
5818 >, which would cause the browser to reuse the old
5819     version of the page.
5820    </P
5821 ><P
5822 >    The <SPAN
5823 CLASS="QUOTE"
5824 >"randomize"</SPAN
5825 > option overwrites the value of the
5826     <SPAN
5827 CLASS="QUOTE"
5828 >"Last-Modified:"</SPAN
5829 > header with a randomly chosen time
5830     between the original value and the current time. In theory the server
5831     could send each document with a different <SPAN
5832 CLASS="QUOTE"
5833 >"Last-Modified:"</SPAN
5834 >
5835     header to track visits without using cookies. <SPAN
5836 CLASS="QUOTE"
5837 >"Randomize"</SPAN
5838 >
5839     makes it impossible and the browser can still revalidate cached documents. 
5840    </P
5841 ><P
5842 >    <SPAN
5843 CLASS="QUOTE"
5844 >"reset-to-request-time"</SPAN
5845 > overwrites the value of the
5846     <SPAN
5847 CLASS="QUOTE"
5848 >"Last-Modified:"</SPAN
5849 > header with the current time. You could use
5850     this option together with
5851     <TT
5852 CLASS="LITERAL"
5853 ><A
5854 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5855 >hided-if-modified-since</A
5856 ></TT
5857 >
5858     to further customize your random range.
5859    </P
5860 ><P
5861 >    The preferred parameter here is <SPAN
5862 CLASS="QUOTE"
5863 >"randomize"</SPAN
5864 >. It is safe
5865     to use, as long as the time settings are more or less correct.
5866     If the server sets the <SPAN
5867 CLASS="QUOTE"
5868 >"Last-Modified:"</SPAN
5869 > header to the time
5870     of the request, the random range becomes zero and the value stays the same.
5871     Therefore you should later randomize it a second time with
5872     <TT
5873 CLASS="LITERAL"
5874 ><A
5875 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5876 >hided-if-modified-since</A
5877 ></TT
5878 >,
5879     just to be sure. 
5880    </P
5881 ><P
5882 >    It is also recommended to use this action together with
5883     <TT
5884 CLASS="LITERAL"
5885 ><A
5886 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5887 >crunch-if-none-match</A
5888 ></TT
5889 >.
5890    </P
5891 ></DD
5892 ><DT
5893 >Example usage:</DT
5894 ><DD
5895 ><P
5896 >     <TABLE
5897 BORDER="0"
5898 BGCOLOR="#E0E0E0"
5899 WIDTH="90%"
5900 ><TR
5901 ><TD
5902 ><PRE
5903 CLASS="SCREEN"
5904 ># Let the browser revalidate without being tracked across sessions
5905 { +hide-if-modified-since{-60} \
5906  +overwrite-last-modified{randomize} \
5907  +crunch-if-none-match}
5908 /</PRE
5909 ></TD
5910 ></TR
5911 ></TABLE
5912 >
5913    </P
5914 ></DD
5915 ></DL
5916 ></DIV
5917 ></DIV
5918 ><DIV
5919 CLASS="SECT3"
5920 ><H4
5921 CLASS="SECT3"
5922 ><A
5923 NAME="REDIRECT"
5924 >8.5.29. redirect</A
5925 ></H4
5926 ><P
5927 ></P
5928 ><DIV
5929 CLASS="VARIABLELIST"
5930 ><DL
5931 ><DT
5932 >Typical use:</DT
5933 ><DD
5934 ><P
5935 >    Redirect requests to other sites.
5936    </P
5937 ></DD
5938 ><DT
5939 >Effect:</DT
5940 ><DD
5941 ><P
5942 >    Convinces the browser that the requested document has been moved
5943     to another location and the browser should get it from there.
5944    </P
5945 ></DD
5946 ><DT
5947 >Type:</DT
5948 ><DD
5949 ><P
5950 >Parameterized</P
5951 ></DD
5952 ><DT
5953 >Parameter:</DT
5954 ><DD
5955 ><P
5956 >    An absolute URL or a single pcrs command.
5957    </P
5958 ></DD
5959 ><DT
5960 >Notes:</DT
5961 ><DD
5962 ><P
5963 >    Requests to which this action applies are answered with a
5964     HTTP redirect to URLs of your choosing. The new URL is
5965     either provided as parameter, or derived by applying a
5966     single pcrs command to the original URL.
5967    </P
5968 ><P
5969 >    This action will be ignored if you use it together with
5970     <TT
5971 CLASS="LITERAL"
5972 ><A
5973 HREF="actions-file.html#BLOCK"
5974 >block</A
5975 ></TT
5976 >.
5977     It can be combined with
5978     <TT
5979 CLASS="LITERAL"
5980 ><A
5981 HREF="actions-file.html#FAST-REDIRECTS"
5982 >fast-redirects{check-decoded-url}</A
5983 ></TT
5984 >
5985     to redirect to a decoded version of a rewritten URL.
5986    </P
5987 ><P
5988 >    Use this action carefully, make sure not to create redirection loops
5989     and be aware that using your own redirects might make it
5990     possible to fingerprint your requests.
5991    </P
5992 ><P
5993 >    In case of problems with your redirects, or simply to watch
5994     them working, enable <A
5995 HREF="config.html#DEBUG"
5996 >debug 128</A
5997 >.
5998    </P
5999 ></DD
6000 ><DT
6001 >Example usages:</DT
6002 ><DD
6003 ><P
6004 >    <TABLE
6005 BORDER="0"
6006 BGCOLOR="#E0E0E0"
6007 WIDTH="90%"
6008 ><TR
6009 ><TD
6010 ><PRE
6011 CLASS="SCREEN"
6012 ># Replace example.com's style sheet with another one
6013 { +redirect{http://localhost/css-replacements/example.com.css} }
6014  example.com/stylesheet\.css
6015
6016 # Create a short, easy to remember nickname for a favorite site
6017 # (relies on the browser accept and forward invalid URLs to <SPAN
6018 CLASS="APPLICATION"
6019 >Privoxy</SPAN
6020 >)
6021 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
6022  a
6023
6024 # Always use the expanded view for Undeadly.org articles
6025 # (Note the $ at the end of the URL pattern to make sure
6026 # the request for the rewritten URL isn't redirected as well)
6027 {+redirect{s@$@&#38;mode=expanded@}}
6028 undeadly.org/cgi\?action=article&#38;sid=\d*$
6029
6030 # Redirect Google search requests to MSN
6031 {+redirect{s@^http://[^/]*/search\?q=([^&#38;]*).*@http://search.msn.com/results.aspx?q=$1@}}
6032 .google.com/search
6033
6034 # Redirect MSN search requests to Yahoo
6035 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&#38;]*).*@http://search.yahoo.com/search?p=$1@}}
6036 search.msn.com//results\.aspx\?q=
6037
6038 # Redirect remote requests for this manual
6039 # to the local version delivered by Privoxy
6040 {+redirect{s@^http://www@http://config@}}
6041 www.privoxy.org/user-manual/</PRE
6042 ></TD
6043 ></TR
6044 ></TABLE
6045 >
6046    </P
6047 ></DD
6048 ></DL
6049 ></DIV
6050 ></DIV
6051 ><DIV
6052 CLASS="SECT3"
6053 ><H4
6054 CLASS="SECT3"
6055 ><A
6056 NAME="SERVER-HEADER-FILTER"
6057 >8.5.30. server-header-filter</A
6058 ></H4
6059 ><P
6060 ></P
6061 ><DIV
6062 CLASS="VARIABLELIST"
6063 ><DL
6064 ><DT
6065 >Typical use:</DT
6066 ><DD
6067 ><P
6068 >   Rewrite or remove single server headers.
6069    </P
6070 ></DD
6071 ><DT
6072 >Effect:</DT
6073 ><DD
6074 ><P
6075 >    All server headers to which this action applies are filtered on-the-fly
6076     through the specified regular expression based substitutions.
6077    </P
6078 ></DD
6079 ><DT
6080 >Type:</DT
6081 ><DD
6082 ><P
6083 >Parameterized.</P
6084 ></DD
6085 ><DT
6086 >Parameter:</DT
6087 ><DD
6088 ><P
6089 >    The name of a server-header filter, as defined in one of the
6090     <A
6091 HREF="filter-file.html"
6092 >filter files</A
6093 >.
6094    </P
6095 ></DD
6096 ><DT
6097 >Notes:</DT
6098 ><DD
6099 ><P
6100 >    Server-header filters are applied to each header on its own, not to
6101     all at once. This makes it easier to diagnose problems, but on the downside
6102     you can't write filters that only change header x if header y's value is z.
6103     You can do that by using tags though.
6104    </P
6105 ><P
6106 >    Server-header filters are executed after the other header actions have finished
6107     and use their output as input.
6108    </P
6109 ><P
6110 >    Please refer to the <A
6111 HREF="filter-file.html"
6112 >filter file chapter</A
6113 >
6114     to learn which server-header filters are available by default, and how to
6115     create your own.
6116    </P
6117 ></DD
6118 ><DT
6119 >Example usage (section):</DT
6120 ><DD
6121 ><P
6122 >     <TABLE
6123 BORDER="0"
6124 BGCOLOR="#E0E0E0"
6125 WIDTH="90%"
6126 ><TR
6127 ><TD
6128 ><PRE
6129 CLASS="SCREEN"
6130 >{+server-header-filter{html-to-xml}}
6131 example.org/xml-instance-that-is-delivered-as-html
6132
6133 {+server-header-filter{xml-to-html}}
6134 example.org/instance-that-is-delivered-as-xml-but-is-not
6135     </PRE
6136 ></TD
6137 ></TR
6138 ></TABLE
6139 >
6140     </P
6141 ></DD
6142 ></DL
6143 ></DIV
6144 ></DIV
6145 ><DIV
6146 CLASS="SECT3"
6147 ><H4
6148 CLASS="SECT3"
6149 ><A
6150 NAME="SERVER-HEADER-TAGGER"
6151 >8.5.31. server-header-tagger</A
6152 ></H4
6153 ><P
6154 ></P
6155 ><DIV
6156 CLASS="VARIABLELIST"
6157 ><DL
6158 ><DT
6159 >Typical use:</DT
6160 ><DD
6161 ><P
6162 >   Enable or disable filters based on the Content-Type header.
6163    </P
6164 ></DD
6165 ><DT
6166 >Effect:</DT
6167 ><DD
6168 ><P
6169 >    Server headers to which this action applies are filtered on-the-fly through
6170     the specified regular expression based substitutions, the result is used as
6171     tag.
6172    </P
6173 ></DD
6174 ><DT
6175 >Type:</DT
6176 ><DD
6177 ><P
6178 >Parameterized.</P
6179 ></DD
6180 ><DT
6181 >Parameter:</DT
6182 ><DD
6183 ><P
6184 >    The name of a server-header tagger, as defined in one of the
6185     <A
6186 HREF="filter-file.html"
6187 >filter files</A
6188 >.
6189    </P
6190 ></DD
6191 ><DT
6192 >Notes:</DT
6193 ><DD
6194 ><P
6195 >    Server-header taggers are applied to each header on its own,
6196     and as the header isn't modified, each tagger <SPAN
6197 CLASS="QUOTE"
6198 >"sees"</SPAN
6199 >
6200     the original.
6201    </P
6202 ><P
6203 >    Server-header taggers are executed before all other header actions
6204     that modify server headers. Their tags can be used to control
6205     all of the other server-header actions, the content filters
6206     and the crunch actions (<A
6207 HREF="actions-file.html#REDIRECT"
6208 >redirect</A
6209 >
6210     and <A
6211 HREF="actions-file.html#BLOCK"
6212 >block</A
6213 >).
6214    </P
6215 ><P
6216 >    Obviously crunching based on tags created by server-header taggers
6217     doesn't prevent the request from showing up in the server's log file.
6218    </P
6219 ></DD
6220 ><DT
6221 >Example usage (section):</DT
6222 ><DD
6223 ><P
6224 >     <TABLE
6225 BORDER="0"
6226 BGCOLOR="#E0E0E0"
6227 WIDTH="90%"
6228 ><TR
6229 ><TD
6230 ><PRE
6231 CLASS="SCREEN"
6232 ># Tag every request with the content type declared by the server
6233 {+server-header-tagger{content-type}}
6234 /
6235     </PRE
6236 ></TD
6237 ></TR
6238 ></TABLE
6239 >
6240     </P
6241 ></DD
6242 ></DL
6243 ></DIV
6244 ></DIV
6245 ><DIV
6246 CLASS="SECT3"
6247 ><H4
6248 CLASS="SECT3"
6249 ><A
6250 NAME="SESSION-COOKIES-ONLY"
6251 >8.5.32. session-cookies-only</A
6252 ></H4
6253 ><P
6254 ></P
6255 ><DIV
6256 CLASS="VARIABLELIST"
6257 ><DL
6258 ><DT
6259 >Typical use:</DT
6260 ><DD
6261 ><P
6262 >    Allow only temporary <SPAN
6263 CLASS="QUOTE"
6264 >"session"</SPAN
6265 > cookies (for the current
6266     browser session <SPAN
6267 CLASS="emphasis"
6268 ><I
6269 CLASS="EMPHASIS"
6270 >only</I
6271 ></SPAN
6272 >). 
6273    </P
6274 ></DD
6275 ><DT
6276 >Effect:</DT
6277 ><DD
6278 ><P
6279 >    Deletes the <SPAN
6280 CLASS="QUOTE"
6281 >"expires"</SPAN
6282 > field from <SPAN
6283 CLASS="QUOTE"
6284 >"Set-Cookie:"</SPAN
6285 >
6286     server headers. Most browsers will not store such cookies permanently and
6287     forget them in between sessions.
6288    </P
6289 ></DD
6290 ><DT
6291 >Type:</DT
6292 ><DD
6293 ><P
6294 >Boolean.</P
6295 ></DD
6296 ><DT
6297 >Parameter:</DT
6298 ><DD
6299 ><P
6300 >    N/A
6301    </P
6302 ></DD
6303 ><DT
6304 >Notes:</DT
6305 ><DD
6306 ><P
6307 >    This is less strict than <TT
6308 CLASS="LITERAL"
6309 ><A
6310 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6311 >crunch-incoming-cookies</A
6312 ></TT
6313 > / 
6314     <TT
6315 CLASS="LITERAL"
6316 ><A
6317 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6318 >crunch-outgoing-cookies</A
6319 ></TT
6320 > and allows you to browse
6321     websites that insist or rely on setting cookies, without compromising your privacy too badly.
6322    </P
6323 ><P
6324 >    Most browsers will not permanently store cookies that have been processed by
6325     <TT
6326 CLASS="LITERAL"
6327 >session-cookies-only</TT
6328 > and will forget about them between sessions.
6329     This makes profiling cookies useless, but won't break sites which require cookies so
6330     that you can log in for transactions. This is generally turned on for all 
6331     sites, and is the recommended setting.
6332    </P
6333 ><P
6334 >    It makes <SPAN
6335 CLASS="emphasis"
6336 ><I
6337 CLASS="EMPHASIS"
6338 >no sense at all</I
6339 ></SPAN
6340 > to use <TT
6341 CLASS="LITERAL"
6342 >session-cookies-only</TT
6343 >
6344     together with <TT
6345 CLASS="LITERAL"
6346 ><A
6347 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6348 >crunch-incoming-cookies</A
6349 ></TT
6350 > or
6351     <TT
6352 CLASS="LITERAL"
6353 ><A
6354 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6355 >crunch-outgoing-cookies</A
6356 ></TT
6357 >. If you do, cookies
6358     will be plainly killed.
6359    </P
6360 ><P
6361 >    Note that it is up to the browser how it handles such cookies without an <SPAN
6362 CLASS="QUOTE"
6363 >"expires"</SPAN
6364 >
6365     field. If you use an exotic browser, you might want to try it out to be sure.
6366    </P
6367 ><P
6368 >    This setting also has no effect on cookies that may have been stored
6369     previously by the browser before starting <SPAN
6370 CLASS="APPLICATION"
6371 >Privoxy</SPAN
6372 >.
6373     These would have to be removed manually.
6374    </P
6375 ><P
6376 >     <SPAN
6377 CLASS="APPLICATION"
6378 >Privoxy</SPAN
6379 > also uses  
6380      the <A
6381 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6382 >content-cookies filter</A
6383
6384      to block some types of cookies. Content cookies are not effected by 
6385      <TT
6386 CLASS="LITERAL"
6387 >session-cookies-only</TT
6388 >.
6389    </P
6390 ></DD
6391 ><DT
6392 >Example usage:</DT
6393 ><DD
6394 ><P
6395 >     <TABLE
6396 BORDER="0"
6397 BGCOLOR="#E0E0E0"
6398 WIDTH="90%"
6399 ><TR
6400 ><TD
6401 ><PRE
6402 CLASS="SCREEN"
6403 >+session-cookies-only</PRE
6404 ></TD
6405 ></TR
6406 ></TABLE
6407 >
6408    </P
6409 ></DD
6410 ></DL
6411 ></DIV
6412 ></DIV
6413 ><DIV
6414 CLASS="SECT3"
6415 ><H4
6416 CLASS="SECT3"
6417 ><A
6418 NAME="SET-IMAGE-BLOCKER"
6419 >8.5.33. set-image-blocker</A
6420 ></H4
6421 ><P
6422 ></P
6423 ><DIV
6424 CLASS="VARIABLELIST"
6425 ><DL
6426 ><DT
6427 >Typical use:</DT
6428 ><DD
6429 ><P
6430 >Choose the replacement for blocked images</P
6431 ></DD
6432 ><DT
6433 >Effect:</DT
6434 ><DD
6435 ><P
6436 >     This action alone doesn't do anything noticeable. If <SPAN
6437 CLASS="emphasis"
6438 ><I
6439 CLASS="EMPHASIS"
6440 >both</I
6441 ></SPAN
6442 >
6443      <TT
6444 CLASS="LITERAL"
6445 ><A
6446 HREF="actions-file.html#BLOCK"
6447 >block</A
6448 ></TT
6449 > <SPAN
6450 CLASS="emphasis"
6451 ><I
6452 CLASS="EMPHASIS"
6453 >and</I
6454 ></SPAN
6455 > <TT
6456 CLASS="LITERAL"
6457 ><A
6458 HREF="actions-file.html#HANDLE-AS-IMAGE"
6459 >handle-as-image</A
6460 ></TT
6461 > <SPAN
6462 CLASS="emphasis"
6463 ><I
6464 CLASS="EMPHASIS"
6465 >also</I
6466 ></SPAN
6467 >
6468      apply, i.e. if the request is to be blocked as an image,
6469      <SPAN
6470 CLASS="emphasis"
6471 ><I
6472 CLASS="EMPHASIS"
6473 >then</I
6474 ></SPAN
6475 > the parameter of this action decides what will be
6476      sent as a replacement.
6477    </P
6478 ></DD
6479 ><DT
6480 >Type:</DT
6481 ><DD
6482 ><P
6483 >Parameterized.</P
6484 ></DD
6485 ><DT
6486 >Parameter:</DT
6487 ><DD
6488 ><P
6489 ></P
6490 ><UL
6491 ><LI
6492 ><P
6493 >      <SPAN
6494 CLASS="QUOTE"
6495 >"pattern"</SPAN
6496 > to send a built-in checkerboard pattern image. The image is visually
6497       decent, scales very well, and makes it obvious where banners were busted.
6498      </P
6499 ></LI
6500 ><LI
6501 ><P
6502 >      <SPAN
6503 CLASS="QUOTE"
6504 >"blank"</SPAN
6505 > to send a built-in transparent image. This makes banners disappear
6506       completely, but makes it hard to detect where <SPAN
6507 CLASS="APPLICATION"
6508 >Privoxy</SPAN
6509 > has blocked
6510       images on a given page and complicates troubleshooting if <SPAN
6511 CLASS="APPLICATION"
6512 >Privoxy</SPAN
6513 >
6514       has blocked innocent images, like navigation icons.
6515      </P
6516 ></LI
6517 ><LI
6518 ><P
6519 >      <SPAN
6520 CLASS="QUOTE"
6521 >"<TT
6522 CLASS="REPLACEABLE"
6523 ><I
6524 >target-url</I
6525 ></TT
6526 >"</SPAN
6527 > to
6528       send a redirect to <TT
6529 CLASS="REPLACEABLE"
6530 ><I
6531 >target-url</I
6532 ></TT
6533 >. You can redirect
6534       to any image anywhere, even in your local filesystem via <SPAN
6535 CLASS="QUOTE"
6536 >"file:///"</SPAN
6537 > URL. 
6538       (But note that not all browsers support redirecting to a local file system).
6539      </P
6540 ><P
6541 >      A good application of redirects is to use special <SPAN
6542 CLASS="APPLICATION"
6543 >Privoxy</SPAN
6544 >-built-in
6545       URLs, which send the built-in images, as <TT
6546 CLASS="REPLACEABLE"
6547 ><I
6548 >target-url</I
6549 ></TT
6550 >.
6551       This has the same visual effect as specifying <SPAN
6552 CLASS="QUOTE"
6553 >"blank"</SPAN
6554 > or <SPAN
6555 CLASS="QUOTE"
6556 >"pattern"</SPAN
6557 > in
6558       the first place, but enables your browser to cache the replacement image, instead of requesting
6559       it over and over again.
6560      </P
6561 ></LI
6562 ></UL
6563 ></DD
6564 ><DT
6565 >Notes:</DT
6566 ><DD
6567 ><P
6568 >    The URLs for the built-in images are <SPAN
6569 CLASS="QUOTE"
6570 >"http://config.privoxy.org/send-banner?type=<TT
6571 CLASS="REPLACEABLE"
6572 ><I
6573 >type</I
6574 ></TT
6575 >"</SPAN
6576 >, where <TT
6577 CLASS="REPLACEABLE"
6578 ><I
6579 >type</I
6580 ></TT
6581 > is
6582     either <SPAN
6583 CLASS="QUOTE"
6584 >"blank"</SPAN
6585 > or <SPAN
6586 CLASS="QUOTE"
6587 >"pattern"</SPAN
6588 >.
6589    </P
6590 ><P
6591 >    There is a third (advanced) type, called <SPAN
6592 CLASS="QUOTE"
6593 >"auto"</SPAN
6594 >. It is <SPAN
6595 CLASS="emphasis"
6596 ><I
6597 CLASS="EMPHASIS"
6598 >NOT</I
6599 ></SPAN
6600 > to be
6601     used in <TT
6602 CLASS="LITERAL"
6603 >set-image-blocker</TT
6604 >, but meant for use from <A
6605 HREF="filter-file.html"
6606 >filters</A
6607 >.
6608     Auto will select the type of image that would have applied to the referring page, had it been an image.
6609    </P
6610 ></DD
6611 ><DT
6612 >Example usage:</DT
6613 ><DD
6614 ><P
6615 >    Built-in pattern:
6616    </P
6617 ><P
6618 >    <TABLE
6619 BORDER="0"
6620 BGCOLOR="#E0E0E0"
6621 WIDTH="90%"
6622 ><TR
6623 ><TD
6624 ><PRE
6625 CLASS="SCREEN"
6626 >+set-image-blocker{pattern}</PRE
6627 ></TD
6628 ></TR
6629 ></TABLE
6630 >
6631    </P
6632 ><P
6633 >    Redirect to the BSD daemon:
6634    </P
6635 ><P
6636 >    <TABLE
6637 BORDER="0"
6638 BGCOLOR="#E0E0E0"
6639 WIDTH="90%"
6640 ><TR
6641 ><TD
6642 ><PRE
6643 CLASS="SCREEN"
6644 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6645 ></TD
6646 ></TR
6647 ></TABLE
6648 >
6649    </P
6650 ><P
6651 >    Redirect to the built-in pattern for better caching:
6652    </P
6653 ><P
6654 >    <TABLE
6655 BORDER="0"
6656 BGCOLOR="#E0E0E0"
6657 WIDTH="90%"
6658 ><TR
6659 ><TD
6660 ><PRE
6661 CLASS="SCREEN"
6662 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6663 ></TD
6664 ></TR
6665 ></TABLE
6666 >
6667    </P
6668 ></DD
6669 ></DL
6670 ></DIV
6671 ></DIV
6672 ><DIV
6673 CLASS="SECT3"
6674 ><H3
6675 CLASS="SECT3"
6676 ><A
6677 NAME="AEN4070"
6678 >8.5.34. Summary</A
6679 ></H3
6680 ><P
6681 > Note that many of these actions have the potential to cause a page to
6682  misbehave, possibly even not to display at all. There are many ways 
6683  a site designer may choose to design his site, and what HTTP header 
6684  content, and other criteria, he may depend on. There is no way to have hard
6685  and fast rules for all sites. See the <A
6686 HREF="appendix.html#ACTIONSANAT"
6687 >Appendix</A
6688 > for a brief example on troubleshooting
6689  actions.</P
6690 ></DIV
6691 ></DIV
6692 ><DIV
6693 CLASS="SECT2"
6694 ><H2
6695 CLASS="SECT2"
6696 ><A
6697 NAME="ALIASES"
6698 >8.6. Aliases</A
6699 ></H2
6700 ><P
6701 > Custom <SPAN
6702 CLASS="QUOTE"
6703 >"actions"</SPAN
6704 >, known to <SPAN
6705 CLASS="APPLICATION"
6706 >Privoxy</SPAN
6707 >
6708  as <SPAN
6709 CLASS="QUOTE"
6710 >"aliases"</SPAN
6711 >, can be defined by combining other actions.
6712  These can in turn be invoked just like the built-in actions.
6713  Currently, an alias name can contain any character except space, tab,
6714  <SPAN
6715 CLASS="QUOTE"
6716 >"="</SPAN
6717 >,
6718  <SPAN
6719 CLASS="QUOTE"
6720 >"{"</SPAN
6721 > and <SPAN
6722 CLASS="QUOTE"
6723 >"}"</SPAN
6724 >, but we <SPAN
6725 CLASS="emphasis"
6726 ><I
6727 CLASS="EMPHASIS"
6728 >strongly 
6729  recommend</I
6730 ></SPAN
6731 > that you only use <SPAN
6732 CLASS="QUOTE"
6733 >"a"</SPAN
6734 > to <SPAN
6735 CLASS="QUOTE"
6736 >"z"</SPAN
6737 >,
6738  <SPAN
6739 CLASS="QUOTE"
6740 >"0"</SPAN
6741 > to <SPAN
6742 CLASS="QUOTE"
6743 >"9"</SPAN
6744 >, <SPAN
6745 CLASS="QUOTE"
6746 >"+"</SPAN
6747 >, and <SPAN
6748 CLASS="QUOTE"
6749 >"-"</SPAN
6750 >.
6751  Alias names are not case sensitive, and are not required to start with a
6752  <SPAN
6753 CLASS="QUOTE"
6754 >"+"</SPAN
6755 > or <SPAN
6756 CLASS="QUOTE"
6757 >"-"</SPAN
6758 > sign, since they are merely textually
6759  expanded.</P
6760 ><P
6761 > Aliases can be used throughout the actions file, but they <SPAN
6762 CLASS="emphasis"
6763 ><I
6764 CLASS="EMPHASIS"
6765 >must be
6766  defined in a special section at the top of the file!</I
6767 ></SPAN
6768 >
6769  And there can only be one such section per actions file. Each actions file may
6770  have its own alias section, and the aliases defined in it are only visible
6771  within that file.</P
6772 ><P
6773 > There are two main reasons to use aliases: One is to save typing for frequently
6774  used combinations of actions, the other one is a gain in flexibility: If you
6775  decide once how you want to handle shops by defining an alias called
6776  <SPAN
6777 CLASS="QUOTE"
6778 >"shop"</SPAN
6779 >, you can later change your policy on shops in
6780  <SPAN
6781 CLASS="emphasis"
6782 ><I
6783 CLASS="EMPHASIS"
6784 >one</I
6785 ></SPAN
6786 > place, and your changes will take effect everywhere
6787  in the actions file where the <SPAN
6788 CLASS="QUOTE"
6789 >"shop"</SPAN
6790 > alias is used. Calling aliases
6791  by their purpose also makes your actions files more readable.</P
6792 ><P
6793 > Currently, there is one big drawback to using aliases, though:
6794  <SPAN
6795 CLASS="APPLICATION"
6796 >Privoxy</SPAN
6797 >'s built-in web-based action file
6798  editor honors aliases when reading the actions files, but it expands
6799  them before writing. So the effects of your aliases are of course preserved,
6800  but the aliases themselves are lost when you edit sections that use aliases
6801  with it.</P
6802 ><P
6803 > Now let's define some aliases...</P
6804 ><P
6805 > <TABLE
6806 BORDER="0"
6807 BGCOLOR="#E0E0E0"
6808 WIDTH="100%"
6809 ><TR
6810 ><TD
6811 ><PRE
6812 CLASS="SCREEN"
6813 > # Useful custom aliases we can use later.
6814  #
6815  # Note the (required!) section header line and that this section
6816  # must be at the top of the actions file!
6817  #
6818  {{alias}}
6819
6820  # These aliases just save typing later:
6821  # (Note that some already use other aliases!)
6822  #
6823  +crunch-all-cookies = +<A
6824 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6825 >crunch-incoming-cookies</A
6826 > +<A
6827 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6828 >crunch-outgoing-cookies</A
6829 >
6830  -crunch-all-cookies = -<A
6831 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6832 >crunch-incoming-cookies</A
6833 > -<A
6834 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6835 >crunch-outgoing-cookies</A
6836 >
6837  +block-as-image      = +block{Blocked image.} +handle-as-image
6838  allow-all-cookies   = -crunch-all-cookies -<A
6839 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6840 >session-cookies-only</A
6841 > -<A
6842 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6843 >filter{content-cookies}</A
6844 >
6845
6846  # These aliases define combinations of actions
6847  # that are useful for certain types of sites:
6848  #
6849  fragile     = -<A
6850 HREF="actions-file.html#BLOCK"
6851 >block</A
6852 > -<A
6853 HREF="actions-file.html#FILTER"
6854 >filter</A
6855 > -crunch-all-cookies -<A
6856 HREF="actions-file.html#FAST-REDIRECTS"
6857 >fast-redirects</A
6858 > -<A
6859 HREF="actions-file.html#HIDE-REFERER"
6860 >hide-referrer</A
6861 > -<A
6862 HREF="actions-file.html#PREVENT-COMPRESSION"
6863 >prevent-compression</A
6864 >
6865
6866  shop        = -crunch-all-cookies -<A
6867 HREF="actions-file.html#FILTER-ALL-POPUPS"
6868 >filter{all-popups}</A
6869 >
6870
6871  # Short names for other aliases, for really lazy people ;-)
6872  #
6873  c0 = +crunch-all-cookies
6874  c1 = -crunch-all-cookies</PRE
6875 ></TD
6876 ></TR
6877 ></TABLE
6878 ></P
6879 ><P
6880 > ...and put them to use. These sections would appear in the lower part of an 
6881  actions file and define exceptions to the default actions (as specified further
6882  up for the <SPAN
6883 CLASS="QUOTE"
6884 >"/"</SPAN
6885 > pattern):</P
6886 ><P
6887 > <TABLE
6888 BORDER="0"
6889 BGCOLOR="#E0E0E0"
6890 WIDTH="100%"
6891 ><TR
6892 ><TD
6893 ><PRE
6894 CLASS="SCREEN"
6895 > # These sites are either very complex or very keen on
6896  # user data and require minimal interference to work:
6897  #
6898  {fragile}
6899  .office.microsoft.com
6900  .windowsupdate.microsoft.com
6901  # Gmail is really mail.google.com, not gmail.com
6902  mail.google.com
6903
6904  # Shopping sites:
6905  # Allow cookies (for setting and retrieving your customer data)
6906  #           
6907  {shop}
6908  .quietpc.com
6909  .worldpay.com   # for quietpc.com
6910  mybank.example.com
6911
6912  # These shops require pop-ups:
6913  #
6914  {-filter{all-popups} -filter{unsolicited-popups}}
6915   .dabs.com
6916   .overclockers.co.uk</PRE
6917 ></TD
6918 ></TR
6919 ></TABLE
6920 ></P
6921 ><P
6922 > Aliases like <SPAN
6923 CLASS="QUOTE"
6924 >"shop"</SPAN
6925 > and <SPAN
6926 CLASS="QUOTE"
6927 >"fragile"</SPAN
6928 > are typically used for 
6929  <SPAN
6930 CLASS="QUOTE"
6931 >"problem"</SPAN
6932 > sites that require more than one action to be disabled 
6933  in order to function properly.</P
6934 ></DIV
6935 ><DIV
6936 CLASS="SECT2"
6937 ><H2
6938 CLASS="SECT2"
6939 ><A
6940 NAME="ACT-EXAMPLES"
6941 >8.7. Actions Files Tutorial</A
6942 ></H2
6943 ><P
6944 > The above chapters have shown <A
6945 HREF="actions-file.html"
6946 >which actions files
6947  there are and how they are organized</A
6948 >, how actions are <A
6949 HREF="actions-file.html#ACTIONS"
6950 >specified</A
6951 > and <A
6952 HREF="actions-file.html#ACTIONS-APPLY"
6953 >applied
6954  to URLs</A
6955 >, how <A
6956 HREF="actions-file.html#AF-PATTERNS"
6957 >patterns</A
6958 > work, and how to
6959  define and use <A
6960 HREF="actions-file.html#ALIASES"
6961 >aliases</A
6962 >. Now, let's look at an
6963  example <TT
6964 CLASS="FILENAME"
6965 >match-all.action</TT
6966 >, <TT
6967 CLASS="FILENAME"
6968 >default.action</TT
6969 >
6970  and <TT
6971 CLASS="FILENAME"
6972 >user.action</TT
6973 > file and see how all these pieces come together:</P
6974 ><DIV
6975 CLASS="SECT3"
6976 ><H3
6977 CLASS="SECT3"
6978 ><A
6979 NAME="AEN4134"
6980 >8.7.1. match-all.action</A
6981 ></H3
6982 ><P
6983 > Remember <SPAN
6984 CLASS="emphasis"
6985 ><I
6986 CLASS="EMPHASIS"
6987 >all actions are disabled when matching starts</I
6988 ></SPAN
6989 >,
6990  so we have to explicitly enable the ones we want.</P
6991 ><P
6992 > While the <TT
6993 CLASS="FILENAME"
6994 >match-all.action</TT
6995 > file only contains a
6996  single section, it is probably the most important one. It has only one
6997  pattern, <SPAN
6998 CLASS="QUOTE"
6999 >"<TT
7000 CLASS="LITERAL"
7001 >/</TT
7002 >"</SPAN
7003 >, but this pattern
7004  <A
7005 HREF="actions-file.html#AF-PATTERNS"
7006 >matches all URLs</A
7007 >. Therefore, the set of
7008  actions used in this <SPAN
7009 CLASS="QUOTE"
7010 >"default"</SPAN
7011 > section <SPAN
7012 CLASS="emphasis"
7013 ><I
7014 CLASS="EMPHASIS"
7015 >will
7016  be applied to all requests as a start</I
7017 ></SPAN
7018 >. It can  be partly or
7019  wholly overridden by other actions files like <TT
7020 CLASS="FILENAME"
7021 >default.action</TT
7022 >
7023  and <TT
7024 CLASS="FILENAME"
7025 >user.action</TT
7026 >, but it will still be largely responsible
7027  for your overall browsing experience.</P
7028 ><P
7029 > Again, at the start of matching, all actions are disabled, so there is
7030  no need to disable any actions here. (Remember: a <SPAN
7031 CLASS="QUOTE"
7032 >"+"</SPAN
7033 >
7034  preceding the action name enables the action, a <SPAN
7035 CLASS="QUOTE"
7036 >"-"</SPAN
7037 > disables!).
7038  Also note how this long line has been made more readable by splitting it into
7039  multiple lines with line continuation.</P
7040 ><P
7041 > <TABLE
7042 BORDER="0"
7043 BGCOLOR="#E0E0E0"
7044 WIDTH="100%"
7045 ><TR
7046 ><TD
7047 ><PRE
7048 CLASS="SCREEN"
7049 >{ \
7050  +<A
7051 HREF="actions-file.html#CHANGE-X-FORWARDED-FOR"
7052 >change-x-forwarded-for{block}</A
7053 > \
7054  +<A
7055 HREF="actions-file.html#HIDE-FROM-HEADER"
7056 >hide-from-header{block}</A
7057 > \
7058  +<A
7059 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7060 >set-image-blocker{pattern}</A
7061 > \
7062 }
7063 / # Match all URLs
7064  </PRE
7065 ></TD
7066 ></TR
7067 ></TABLE
7068 ></P
7069 ><P
7070 > The default behavior is now set.</P
7071 ></DIV
7072 ><DIV
7073 CLASS="SECT3"
7074 ><H3
7075 CLASS="SECT3"
7076 ><A
7077 NAME="AEN4156"
7078 >8.7.2. default.action</A
7079 ></H3
7080 ><P
7081 > If you aren't a developer, there's no need for you to edit the
7082  <TT
7083 CLASS="FILENAME"
7084 >default.action</TT
7085 > file. It is maintained by
7086  the <SPAN
7087 CLASS="APPLICATION"
7088 >Privoxy</SPAN
7089 > developers and if you disagree with some of the
7090  sections, you should overrule them in your <TT
7091 CLASS="FILENAME"
7092 >user.action</TT
7093 >.</P
7094 ><P
7095 > Understanding the <TT
7096 CLASS="FILENAME"
7097 >default.action</TT
7098 > file can
7099  help you with your <TT
7100 CLASS="FILENAME"
7101 >user.action</TT
7102 >, though.</P
7103 ><P
7104 > The first section in this file is a special section for internal use
7105  that prevents older <SPAN
7106 CLASS="APPLICATION"
7107 >Privoxy</SPAN
7108 > versions from reading the file:</P
7109 ><P
7110 > <TABLE
7111 BORDER="0"
7112 BGCOLOR="#E0E0E0"
7113 WIDTH="100%"
7114 ><TR
7115 ><TD
7116 ><PRE
7117 CLASS="SCREEN"
7118 >##########################################################################
7119 # Settings -- Don't change! For internal Privoxy use ONLY.
7120 ##########################################################################
7121 {{settings}}
7122 for-privoxy-version=3.0.11</PRE
7123 ></TD
7124 ></TR
7125 ></TABLE
7126 ></P
7127 ><P
7128 > After that comes the (optional) alias section. We'll use the example
7129  section from the above <A
7130 HREF="actions-file.html#ALIASES"
7131 >chapter on aliases</A
7132 >,
7133  that also explains why and how aliases are used:</P
7134 ><P
7135 > <TABLE
7136 BORDER="0"
7137 BGCOLOR="#E0E0E0"
7138 WIDTH="100%"
7139 ><TR
7140 ><TD
7141 ><PRE
7142 CLASS="SCREEN"
7143 >##########################################################################
7144 # Aliases
7145 ##########################################################################
7146 {{alias}}
7147
7148  # These aliases just save typing later:
7149  # (Note that some already use other aliases!)
7150  #
7151  +crunch-all-cookies = +<A
7152 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7153 >crunch-incoming-cookies</A
7154 > +<A
7155 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7156 >crunch-outgoing-cookies</A
7157 >
7158  -crunch-all-cookies = -<A
7159 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7160 >crunch-incoming-cookies</A
7161 > -<A
7162 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7163 >crunch-outgoing-cookies</A
7164 >
7165  +block-as-image      = +block{Blocked image.} +handle-as-image
7166  mercy-for-cookies   = -crunch-all-cookies -<A
7167 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7168 >session-cookies-only</A
7169 > -<A
7170 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
7171 >filter{content-cookies}</A
7172 >
7173
7174  # These aliases define combinations of actions
7175  # that are useful for certain types of sites:
7176  #
7177  fragile     = -<A
7178 HREF="actions-file.html#BLOCK"
7179 >block</A
7180 > -<A
7181 HREF="actions-file.html#FILTER"
7182 >filter</A
7183 > -crunch-all-cookies -<A
7184 HREF="actions-file.html#FAST-REDIRECTS"
7185 >fast-redirects</A
7186 > -<A
7187 HREF="actions-file.html#HIDE-REFERER"
7188 >hide-referrer</A
7189 >
7190  shop        = -crunch-all-cookies -<A
7191 HREF="actions-file.html#FILTER-ALL-POPUPS"
7192 >filter{all-popups}</A
7193 ></PRE
7194 ></TD
7195 ></TR
7196 ></TABLE
7197 ></P
7198 ><P
7199 > The first of our specialized sections is concerned with <SPAN
7200 CLASS="QUOTE"
7201 >"fragile"</SPAN
7202 >
7203  sites, i.e. sites that require minimum interference, because they are either
7204  very complex or very keen on tracking you (and have mechanisms in place that
7205  make them unusable for people who avoid being tracked). We will simply use
7206  our pre-defined <TT
7207 CLASS="LITERAL"
7208 >fragile</TT
7209 > alias instead of stating the list
7210  of actions explicitly:</P
7211 ><P
7212 > <TABLE
7213 BORDER="0"
7214 BGCOLOR="#E0E0E0"
7215 WIDTH="100%"
7216 ><TR
7217 ><TD
7218 ><PRE
7219 CLASS="SCREEN"
7220 >##########################################################################
7221 # Exceptions for sites that'll break under the default action set:
7222 ##########################################################################
7223
7224 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7225 #
7226 { fragile }
7227 .office.microsoft.com           # surprise, surprise!
7228 .windowsupdate.microsoft.com
7229 mail.google.com</PRE
7230 ></TD
7231 ></TR
7232 ></TABLE
7233 ></P
7234 ><P
7235 > Shopping sites are not as fragile, but they typically
7236  require cookies to log in, and pop-up windows for shopping
7237  carts or item details. Again, we'll use a pre-defined alias:</P
7238 ><P
7239 > <TABLE
7240 BORDER="0"
7241 BGCOLOR="#E0E0E0"
7242 WIDTH="100%"
7243 ><TR
7244 ><TD
7245 ><PRE
7246 CLASS="SCREEN"
7247 ># Shopping sites:
7248 #
7249 { shop }
7250 .quietpc.com 
7251 .worldpay.com   # for quietpc.com
7252 .jungle.com
7253 .scan.co.uk</PRE
7254 ></TD
7255 ></TR
7256 ></TABLE
7257 ></P
7258 ><P
7259 > The <TT
7260 CLASS="LITERAL"
7261 ><A
7262 HREF="actions-file.html#FAST-REDIRECTS"
7263 >fast-redirects</A
7264 ></TT
7265 >
7266  action, which may have been enabled in <TT
7267 CLASS="FILENAME"
7268 >match-all.action</TT
7269 >,
7270  breaks some sites. So disable it for popular sites where we know it misbehaves:</P
7271 ><P
7272 > <TABLE
7273 BORDER="0"
7274 BGCOLOR="#E0E0E0"
7275 WIDTH="100%"
7276 ><TR
7277 ><TD
7278 ><PRE
7279 CLASS="SCREEN"
7280 >{ -<A
7281 HREF="actions-file.html#FAST-REDIRECTS"
7282 >fast-redirects</A
7283 > }
7284 login.yahoo.com
7285 edit.*.yahoo.com
7286 .google.com
7287 .altavista.com/.*(like|url|link):http
7288 .altavista.com/trans.*urltext=http
7289 .nytimes.com</PRE
7290 ></TD
7291 ></TR
7292 ></TABLE
7293 ></P
7294 ><P
7295 > It is important that <SPAN
7296 CLASS="APPLICATION"
7297 >Privoxy</SPAN
7298 > knows which
7299  URLs belong to images, so that <SPAN
7300 CLASS="emphasis"
7301 ><I
7302 CLASS="EMPHASIS"
7303 >if</I
7304 ></SPAN
7305 > they are to
7306  be blocked, a substitute image can be sent, rather than an HTML page.
7307  Contacting the remote site to find out is not an option, since it
7308  would destroy the loading time advantage of banner blocking, and it
7309  would feed the advertisers information about you. We can mark any
7310  URL as an image with the <TT
7311 CLASS="LITERAL"
7312 ><A
7313 HREF="actions-file.html#HANDLE-AS-IMAGE"
7314 >handle-as-image</A
7315 ></TT
7316 > action,
7317  and marking all URLs that end in a known image file extension is a
7318  good start:</P
7319 ><P
7320 > <TABLE
7321 BORDER="0"
7322 BGCOLOR="#E0E0E0"
7323 WIDTH="100%"
7324 ><TR
7325 ><TD
7326 ><PRE
7327 CLASS="SCREEN"
7328 >##########################################################################
7329 # Images:
7330 ##########################################################################
7331
7332 # Define which file types will be treated as images, in case they get
7333 # blocked further down this file:
7334 #
7335 { +<A
7336 HREF="actions-file.html#HANDLE-AS-IMAGE"
7337 >handle-as-image</A
7338 > }
7339 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7340 ></TD
7341 ></TR
7342 ></TABLE
7343 ></P
7344 ><P
7345 > And then there are known banner sources. They often use scripts to
7346  generate the banners, so it won't be visible from the URL that the
7347  request is for an image. Hence we block them <SPAN
7348 CLASS="emphasis"
7349 ><I
7350 CLASS="EMPHASIS"
7351 >and</I
7352 ></SPAN
7353 >
7354  mark them as images in one go, with the help of our
7355  <TT
7356 CLASS="LITERAL"
7357 >+block-as-image</TT
7358 > alias defined above. (We could of
7359  course just as well use <TT
7360 CLASS="LITERAL"
7361 >+<A
7362 HREF="actions-file.html#BLOCK"
7363 >block</A
7364 >
7365  +<A
7366 HREF="actions-file.html#HANDLE-AS-IMAGE"
7367 >handle-as-image</A
7368 ></TT
7369 > here.)
7370  Remember that the type of the replacement image is chosen by the
7371  <TT
7372 CLASS="LITERAL"
7373 ><A
7374 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7375 >set-image-blocker</A
7376 ></TT
7377 >
7378  action. Since all URLs have matched the default section with its
7379  <TT
7380 CLASS="LITERAL"
7381 >+<A
7382 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7383 >set-image-blocker</A
7384 >{pattern}</TT
7385 >
7386  action before, it still applies and needn't be repeated:</P
7387 ><P
7388 > <TABLE
7389 BORDER="0"
7390 BGCOLOR="#E0E0E0"
7391 WIDTH="100%"
7392 ><TR
7393 ><TD
7394 ><PRE
7395 CLASS="SCREEN"
7396 ># Known ad generators:
7397 #
7398 { +block-as-image }
7399 ar.atwola.com 
7400 .ad.doubleclick.net
7401 .ad.*.doubleclick.net
7402 .a.yimg.com/(?:(?!/i/).)*$
7403 .a[0-9].yimg.com/(?:(?!/i/).)*$
7404 bs*.gsanet.com
7405 .qkimg.net</PRE
7406 ></TD
7407 ></TR
7408 ></TABLE
7409 ></P
7410 ><P
7411 > One of the most important jobs of <SPAN
7412 CLASS="APPLICATION"
7413 >Privoxy</SPAN
7414 >
7415  is to block banners. Many of these can be <SPAN
7416 CLASS="QUOTE"
7417 >"blocked"</SPAN
7418 >
7419  by the <TT
7420 CLASS="LITERAL"
7421 ><A
7422 HREF="actions-file.html#FILTER"
7423 >filter</A
7424 >{banners-by-size}</TT
7425 >
7426  action, which we enabled above, and which deletes the references to banner
7427  images from the pages while they are loaded, so the browser doesn't request
7428  them anymore, and hence they don't need to be blocked here. But this naturally
7429  doesn't catch all banners, and some people choose not to use filters, so we
7430  need a comprehensive list of patterns for banner URLs here, and apply the
7431  <TT
7432 CLASS="LITERAL"
7433 ><A
7434 HREF="actions-file.html#BLOCK"
7435 >block</A
7436 ></TT
7437 > action to them.</P
7438 ><P
7439 > First comes many generic patterns, which do most of the work, by
7440  matching typical domain and path name components of banners. Then comes
7441  a list of individual patterns for specific sites, which is omitted here
7442  to keep the example short:</P
7443 ><P
7444 > <TABLE
7445 BORDER="0"
7446 BGCOLOR="#E0E0E0"
7447 WIDTH="100%"
7448 ><TR
7449 ><TD
7450 ><PRE
7451 CLASS="SCREEN"
7452 >##########################################################################
7453 # Block these fine banners:
7454 ##########################################################################
7455 { <A
7456 HREF="actions-file.html#BLOCK"
7457 >+block{Banner ads.}</A
7458 > }
7459
7460 # Generic patterns:
7461
7462 ad*.
7463 .*ads.
7464 banner?.
7465 count*.
7466 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7467 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7468
7469 # Site-specific patterns (abbreviated):
7470 #
7471 .hitbox.com</PRE
7472 ></TD
7473 ></TR
7474 ></TABLE
7475 ></P
7476 ><P
7477 > It's quite remarkable how many advertisers actually call their banner
7478  servers ads.<TT
7479 CLASS="REPLACEABLE"
7480 ><I
7481 >company</I
7482 ></TT
7483 >.com, or call the directory
7484  in which the banners are stored simply <SPAN
7485 CLASS="QUOTE"
7486 >"banners"</SPAN
7487 >. So the above
7488  generic patterns are surprisingly effective.</P
7489 ><P
7490 > But being very generic, they necessarily also catch URLs that we don't want
7491  to block. The pattern <TT
7492 CLASS="LITERAL"
7493 >.*ads.</TT
7494 > e.g. catches 
7495  <SPAN
7496 CLASS="QUOTE"
7497 >"nasty-<SPAN
7498 CLASS="emphasis"
7499 ><I
7500 CLASS="EMPHASIS"
7501 >ads</I
7502 ></SPAN
7503 >.nasty-corp.com"</SPAN
7504 > as intended,
7505  but also <SPAN
7506 CLASS="QUOTE"
7507 >"downlo<SPAN
7508 CLASS="emphasis"
7509 ><I
7510 CLASS="EMPHASIS"
7511 >ads</I
7512 ></SPAN
7513 >.sourcefroge.net"</SPAN
7514 > or
7515  <SPAN
7516 CLASS="QUOTE"
7517 >"<SPAN
7518 CLASS="emphasis"
7519 ><I
7520 CLASS="EMPHASIS"
7521 >ads</I
7522 ></SPAN
7523 >l.some-provider.net."</SPAN
7524 > So here come some
7525  well-known exceptions to the <TT
7526 CLASS="LITERAL"
7527 >+<A
7528 HREF="actions-file.html#BLOCK"
7529 >block</A
7530 ></TT
7531 >
7532  section above.</P
7533 ><P
7534 > Note that these are exceptions to exceptions from the default! Consider the URL
7535  <SPAN
7536 CLASS="QUOTE"
7537 >"downloads.sourcefroge.net"</SPAN
7538 >: Initially, all actions are deactivated,
7539  so it wouldn't get blocked. Then comes the defaults section, which matches the
7540  URL, but just deactivates the <TT
7541 CLASS="LITERAL"
7542 ><A
7543 HREF="actions-file.html#BLOCK"
7544 >block</A
7545 ></TT
7546 >
7547  action once again. Then it matches <TT
7548 CLASS="LITERAL"
7549 >.*ads.</TT
7550 >, an exception to the
7551  general non-blocking policy, and suddenly
7552  <TT
7553 CLASS="LITERAL"
7554 ><A
7555 HREF="actions-file.html#BLOCK"
7556 >+block</A
7557 ></TT
7558 > applies. And now, it'll match
7559  <TT
7560 CLASS="LITERAL"
7561 >.*loads.</TT
7562 >, where <TT
7563 CLASS="LITERAL"
7564 ><A
7565 HREF="actions-file.html#BLOCK"
7566 >-block</A
7567 ></TT
7568 >
7569  applies, so (unless it matches <SPAN
7570 CLASS="emphasis"
7571 ><I
7572 CLASS="EMPHASIS"
7573 >again</I
7574 ></SPAN
7575 > further down) it ends up
7576  with no <TT
7577 CLASS="LITERAL"
7578 ><A
7579 HREF="actions-file.html#BLOCK"
7580 >block</A
7581 ></TT
7582 > action applying.</P
7583 ><P
7584 > <TABLE
7585 BORDER="0"
7586 BGCOLOR="#E0E0E0"
7587 WIDTH="100%"
7588 ><TR
7589 ><TD
7590 ><PRE
7591 CLASS="SCREEN"
7592 >##########################################################################
7593 # Save some innocent victims of the above generic block patterns:
7594 ##########################################################################
7595
7596 # By domain:
7597
7598 { -<A
7599 HREF="actions-file.html#BLOCK"
7600 >block</A
7601 > }
7602 adv[io]*.  # (for advogato.org and advice.*)
7603 adsl.      # (has nothing to do with ads)
7604 adobe.     # (has nothing to do with ads either)
7605 ad[ud]*.   # (adult.* and add.*)
7606 .edu       # (universities don't host banners (yet!))
7607 .*loads.   # (downloads, uploads etc)
7608
7609 # By path:
7610 #
7611 /.*loads/
7612
7613 # Site-specific:
7614 #
7615 www.globalintersec.com/adv # (adv = advanced)
7616 www.ugu.com/sui/ugu/adv</PRE
7617 ></TD
7618 ></TR
7619 ></TABLE
7620 ></P
7621 ><P
7622 > Filtering source code can have nasty side effects,
7623  so make an exception for our friends at sourceforge.net,
7624  and all paths with <SPAN
7625 CLASS="QUOTE"
7626 >"cvs"</SPAN
7627 > in them. Note that
7628  <TT
7629 CLASS="LITERAL"
7630 >-<A
7631 HREF="actions-file.html#FILTER"
7632 >filter</A
7633 ></TT
7634 >
7635  disables <SPAN
7636 CLASS="emphasis"
7637 ><I
7638 CLASS="EMPHASIS"
7639 >all</I
7640 ></SPAN
7641 > filters in one fell swoop!</P
7642 ><P
7643 > <TABLE
7644 BORDER="0"
7645 BGCOLOR="#E0E0E0"
7646 WIDTH="100%"
7647 ><TR
7648 ><TD
7649 ><PRE
7650 CLASS="SCREEN"
7651 ># Don't filter code!
7652 #
7653 { -<A
7654 HREF="actions-file.html#FILTER"
7655 >filter</A
7656 > }
7657 /(.*/)?cvs
7658 bugzilla.
7659 developer.
7660 wiki.
7661 .sourceforge.net</PRE
7662 ></TD
7663 ></TR
7664 ></TABLE
7665 ></P
7666 ><P
7667 > The actual <TT
7668 CLASS="FILENAME"
7669 >default.action</TT
7670 > is of course much more
7671  comprehensive, but we hope this example made clear how it works.</P
7672 ></DIV
7673 ><DIV
7674 CLASS="SECT3"
7675 ><H3
7676 CLASS="SECT3"
7677 ><A
7678 NAME="AEN4269"
7679 >8.7.3. user.action</A
7680 ></H3
7681 ><P
7682 > So far we are painting with a broad brush by setting general policies,
7683  which would be a reasonable starting point for many people. Now, 
7684  you might want to be more specific and have customized rules that
7685  are more suitable to your personal habits and preferences. These would
7686  be for narrowly defined situations like your ISP or your bank, and should
7687  be placed in <TT
7688 CLASS="FILENAME"
7689 >user.action</TT
7690 >, which is parsed after all other 
7691  actions files and hence has the last word, over-riding any previously
7692  defined actions. <TT
7693 CLASS="FILENAME"
7694 >user.action</TT
7695 > is also a 
7696  <SPAN
7697 CLASS="emphasis"
7698 ><I
7699 CLASS="EMPHASIS"
7700 >safe</I
7701 ></SPAN
7702 > place for your personal settings, since
7703  <TT
7704 CLASS="FILENAME"
7705 >default.action</TT
7706 > is actively maintained by the
7707  <SPAN
7708 CLASS="APPLICATION"
7709 >Privoxy</SPAN
7710 > developers and you'll probably want
7711  to install updated versions from time to time.</P
7712 ><P
7713 > So let's look at a few examples of things that one might typically do in
7714  <TT
7715 CLASS="FILENAME"
7716 >user.action</TT
7717 >: </P
7718 ><P
7719 > <TABLE
7720 BORDER="0"
7721 BGCOLOR="#E0E0E0"
7722 WIDTH="100%"
7723 ><TR
7724 ><TD
7725 ><PRE
7726 CLASS="SCREEN"
7727 ># My user.action file. &#60;fred@example.com&#62;</PRE
7728 ></TD
7729 ></TR
7730 ></TABLE
7731 ></P
7732 ><P
7733 > As <A
7734 HREF="actions-file.html#ALIASES"
7735 >aliases</A
7736 > are local to the actions
7737  file that they are defined in, you can't use the ones from
7738  <TT
7739 CLASS="FILENAME"
7740 >default.action</TT
7741 >, unless you repeat them here:</P
7742 ><P
7743 > <TABLE
7744 BORDER="0"
7745 BGCOLOR="#E0E0E0"
7746 WIDTH="100%"
7747 ><TR
7748 ><TD
7749 ><PRE
7750 CLASS="SCREEN"
7751 ># Aliases are local to the file they are defined in.
7752 # (Re-)define aliases for this file:
7753 #
7754 {{alias}}
7755
7756 # These aliases just save typing later, and the alias names should 
7757 # be self explanatory.
7758 #
7759 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7760 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7761  allow-all-cookies  = -crunch-all-cookies -session-cookies-only
7762  allow-popups       = -filter{all-popups}
7763 +block-as-image     = +block{Blocked as image.} +handle-as-image
7764 -block-as-image     = -block
7765
7766 # These aliases define combinations of actions that are useful for
7767 # certain types of sites:
7768 #
7769 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer
7770 shop        = -crunch-all-cookies allow-popups
7771
7772 # Allow ads for selected useful free sites:
7773 #
7774 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
7775
7776 # Alias for specific file types that are text, but might have conflicting
7777 # MIME types. We want the browser to force these to be text documents.
7778 handle-as-text = -<A
7779 HREF="actions-file.html#FILTER"
7780 >filter</A
7781 > +-<A
7782 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
7783 >content-type-overwrite{text/plain}</A
7784 > +-<A
7785 HREF="actions-file.html#FORCE-TEXT-MODE"
7786 >force-text-mode</A
7787 > -<A
7788 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7789 >hide-content-disposition</A
7790 ></PRE
7791 ></TD
7792 ></TR
7793 ></TABLE
7794 >&#13;</P
7795 ><P
7796 > Say you have accounts on some sites that you visit regularly, and
7797  you don't want to have to log in manually each time. So you'd like
7798  to allow persistent cookies for these sites. The
7799  <TT
7800 CLASS="LITERAL"
7801 >allow-all-cookies</TT
7802 > alias defined above does exactly
7803  that, i.e. it disables crunching of cookies in any direction, and the 
7804  processing of cookies to make them only temporary.</P
7805 ><P
7806 > <TABLE
7807 BORDER="0"
7808 BGCOLOR="#E0E0E0"
7809 WIDTH="100%"
7810 ><TR
7811 ><TD
7812 ><PRE
7813 CLASS="SCREEN"
7814 >{ allow-all-cookies }
7815  sourceforge.net
7816  .yahoo.com
7817  .msdn.microsoft.com
7818  .redhat.com</PRE
7819 ></TD
7820 ></TR
7821 ></TABLE
7822 ></P
7823 ><P
7824 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7825 ><P
7826 > <TABLE
7827 BORDER="0"
7828 BGCOLOR="#E0E0E0"
7829 WIDTH="100%"
7830 ><TR
7831 ><TD
7832 ><PRE
7833 CLASS="SCREEN"
7834 >{ -<A
7835 HREF="actions-file.html#FILTER"
7836 >filter</A
7837 > }
7838  .your-home-banking-site.com</PRE
7839 ></TD
7840 ></TR
7841 ></TABLE
7842 ></P
7843 ><P
7844 > Some file types you may not want to filter for various reasons:</P
7845 ><P
7846 > <TABLE
7847 BORDER="0"
7848 BGCOLOR="#E0E0E0"
7849 WIDTH="100%"
7850 ><TR
7851 ><TD
7852 ><PRE
7853 CLASS="SCREEN"
7854 ># Technical documentation is likely to contain strings that might
7855 # erroneously get altered by the JavaScript-oriented filters:
7856 #
7857 .tldp.org
7858 /(.*/)?selfhtml/
7859
7860 # And this stupid host sends streaming video with a wrong MIME type,
7861 # so that Privoxy thinks it is getting HTML and starts filtering:
7862 #
7863 stupid-server.example.com/</PRE
7864 ></TD
7865 ></TR
7866 ></TABLE
7867 ></P
7868 ><P
7869 > Example of a simple <A
7870 HREF="actions-file.html#BLOCK"
7871 >block</A
7872 > action. Say you've
7873  seen an ad on your favourite page on example.com that you want to get rid of.
7874  You have right-clicked the image, selected <SPAN
7875 CLASS="QUOTE"
7876 >"copy image location"</SPAN
7877 >
7878  and pasted the URL below while removing the leading http://, into a 
7879  <TT
7880 CLASS="LITERAL"
7881 >{ +block{} }</TT
7882 > section. Note that <TT
7883 CLASS="LITERAL"
7884 >{ +handle-as-image
7885  }</TT
7886 > need not be specified, since all URLs ending in
7887  <TT
7888 CLASS="LITERAL"
7889 >.gif</TT
7890 > will be tagged as images by the general rules as set
7891  in default.action anyway:</P
7892 ><P
7893 > <TABLE
7894 BORDER="0"
7895 BGCOLOR="#E0E0E0"
7896 WIDTH="100%"
7897 ><TR
7898 ><TD
7899 ><PRE
7900 CLASS="SCREEN"
7901 >{ +<A
7902 HREF="actions-file.html#BLOCK"
7903 >block</A
7904 >{Nasty ads.} }
7905  www.example.com/nasty-ads/sponsor\.gif
7906  another.example.net/more/junk/here/</PRE
7907 ></TD
7908 ></TR
7909 ></TABLE
7910 ></P
7911 ><P
7912 > The URLs of dynamically generated banners, especially from large banner
7913  farms, often don't use the well-known image file name extensions, which
7914  makes it impossible for <SPAN
7915 CLASS="APPLICATION"
7916 >Privoxy</SPAN
7917 > to guess
7918  the file type just by looking at the URL. 
7919  You can use the <TT
7920 CLASS="LITERAL"
7921 >+block-as-image</TT
7922 > alias defined above for
7923  these cases.
7924  Note that objects which match this rule but then turn out NOT to be an
7925  image are typically rendered as a <SPAN
7926 CLASS="QUOTE"
7927 >"broken image"</SPAN
7928 > icon by the
7929  browser. Use cautiously.</P
7930 ><P
7931 > <TABLE
7932 BORDER="0"
7933 BGCOLOR="#E0E0E0"
7934 WIDTH="100%"
7935 ><TR
7936 ><TD
7937 ><PRE
7938 CLASS="SCREEN"
7939 >{ +block-as-image }
7940  .doubleclick.net
7941  .fastclick.net
7942  /Realmedia/ads/
7943  ar.atwola.com/</PRE
7944 ></TD
7945 ></TR
7946 ></TABLE
7947 ></P
7948 ><P
7949 > Now you noticed that the default configuration breaks Forbes Magazine,
7950  but you were too lazy to find out which action is the culprit, and you
7951  were again too lazy to give <A
7952 HREF="contact.html"
7953 >feedback</A
7954 >, so
7955  you just used the <TT
7956 CLASS="LITERAL"
7957 >fragile</TT
7958 > alias on the site, and
7959  -- <SPAN
7960 CLASS="emphasis"
7961 ><I
7962 CLASS="EMPHASIS"
7963 >whoa!</I
7964 ></SPAN
7965 > -- it worked. The <TT
7966 CLASS="LITERAL"
7967 >fragile</TT
7968 >
7969  aliases disables those actions that are most likely to break a site. Also,
7970  good for testing purposes to see if it is <SPAN
7971 CLASS="APPLICATION"
7972 >Privoxy</SPAN
7973 >
7974  that is causing the problem or not. We later find other regular sites 
7975  that misbehave, and add those to our personalized list of troublemakers:</P
7976 ><P
7977 ><TABLE
7978 BORDER="0"
7979 BGCOLOR="#E0E0E0"
7980 WIDTH="100%"
7981 ><TR
7982 ><TD
7983 ><PRE
7984 CLASS="SCREEN"
7985 >{ fragile }
7986  .forbes.com
7987  webmail.example.com
7988  .mybank.com</PRE
7989 ></TD
7990 ></TR
7991 ></TABLE
7992 ></P
7993 ><P
7994 > You like the <SPAN
7995 CLASS="QUOTE"
7996 >"fun"</SPAN
7997 > text replacements in <TT
7998 CLASS="FILENAME"
7999 >default.filter</TT
8000 >,
8001  but it is disabled in the distributed actions file.
8002  So you'd like to turn it on in your private,
8003  update-safe config, once and for all:</P
8004 ><P
8005 ><TABLE
8006 BORDER="0"
8007 BGCOLOR="#E0E0E0"
8008 WIDTH="100%"
8009 ><TR
8010 ><TD
8011 ><PRE
8012 CLASS="SCREEN"
8013 >{ +<A
8014 HREF="actions-file.html#FILTER-FUN"
8015 >filter{fun}</A
8016 > }
8017  / # For ALL sites!</PRE
8018 ></TD
8019 ></TR
8020 ></TABLE
8021 ></P
8022 ><P
8023 > Note that the above is not really a good idea: There are exceptions
8024  to the filters in <TT
8025 CLASS="FILENAME"
8026 >default.action</TT
8027 > for things that
8028  really shouldn't be filtered, like code on CVS-&#62;Web interfaces. Since
8029  <TT
8030 CLASS="FILENAME"
8031 >user.action</TT
8032 > has the last word, these exceptions
8033  won't be valid for the <SPAN
8034 CLASS="QUOTE"
8035 >"fun"</SPAN
8036 > filtering specified here.</P
8037 ><P
8038 > You might also worry about how your favourite free websites are
8039  funded, and find that they rely on displaying banner advertisements
8040  to survive. So you might want to specifically allow banners for those
8041  sites that you feel provide value to you:</P
8042 ><P
8043 ><TABLE
8044 BORDER="0"
8045 BGCOLOR="#E0E0E0"
8046 WIDTH="100%"
8047 ><TR
8048 ><TD
8049 ><PRE
8050 CLASS="SCREEN"
8051 >{ allow-ads }
8052  .sourceforge.net
8053  .slashdot.org
8054  .osdn.net</PRE
8055 ></TD
8056 ></TR
8057 ></TABLE
8058 >   </P
8059 ><P
8060 > Note that <TT
8061 CLASS="LITERAL"
8062 >allow-ads</TT
8063 > has been aliased to 
8064  <TT
8065 CLASS="LITERAL"
8066 >-<A
8067 HREF="actions-file.html#BLOCK"
8068 >block</A
8069 ></TT
8070 >, 
8071  <TT
8072 CLASS="LITERAL"
8073 >-<A
8074 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
8075 >filter{banners-by-size}</A
8076 ></TT
8077 >, and 
8078  <TT
8079 CLASS="LITERAL"
8080 >-<A
8081 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
8082 >filter{banners-by-link}</A
8083 ></TT
8084 > above.</P
8085 ><P
8086 > Invoke another alias here to force an over-ride of the MIME type <TT
8087 CLASS="LITERAL"
8088 > application/x-sh</TT
8089 > which typically would open a download type 
8090  dialog. In my case, I want to look at the shell script, and then I can save
8091  it should I choose to.</P
8092 ><P
8093 ><TABLE
8094 BORDER="0"
8095 BGCOLOR="#E0E0E0"
8096 WIDTH="100%"
8097 ><TR
8098 ><TD
8099 ><PRE
8100 CLASS="SCREEN"
8101 >{ handle-as-text }
8102  /.*\.sh$</PRE
8103 ></TD
8104 ></TR
8105 ></TABLE
8106 >   </P
8107 ><P
8108 > <TT
8109 CLASS="FILENAME"
8110 >user.action</TT
8111 > is generally the best place to define
8112  exceptions and additions to the default policies of
8113  <TT
8114 CLASS="FILENAME"
8115 >default.action</TT
8116 >. Some actions are safe to have their
8117  default policies set here though. So let's set a default policy to have a
8118  <SPAN
8119 CLASS="QUOTE"
8120 >"blank"</SPAN
8121 > image as opposed to the checkerboard pattern for
8122  <SPAN
8123 CLASS="emphasis"
8124 ><I
8125 CLASS="EMPHASIS"
8126 >ALL</I
8127 ></SPAN
8128 > sites. <SPAN
8129 CLASS="QUOTE"
8130 >"/"</SPAN
8131 > of course matches all URL
8132  paths and patterns:</P
8133 ><P
8134 ><TABLE
8135 BORDER="0"
8136 BGCOLOR="#E0E0E0"
8137 WIDTH="100%"
8138 ><TR
8139 ><TD
8140 ><PRE
8141 CLASS="SCREEN"
8142 >{ +<A
8143 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8144 >set-image-blocker{blank}</A
8145 > }
8146 / # ALL sites</PRE
8147 ></TD
8148 ></TR
8149 ></TABLE
8150 ></P
8151 ></DIV
8152 ></DIV
8153 ></DIV
8154 ><DIV
8155 CLASS="NAVFOOTER"
8156 ><HR
8157 ALIGN="LEFT"
8158 WIDTH="100%"><TABLE
8159 SUMMARY="Footer navigation table"
8160 WIDTH="100%"
8161 BORDER="0"
8162 CELLPADDING="0"
8163 CELLSPACING="0"
8164 ><TR
8165 ><TD
8166 WIDTH="33%"
8167 ALIGN="left"
8168 VALIGN="top"
8169 ><A
8170 HREF="config.html"
8171 ACCESSKEY="P"
8172 >Prev</A
8173 ></TD
8174 ><TD
8175 WIDTH="34%"
8176 ALIGN="center"
8177 VALIGN="top"
8178 ><A
8179 HREF="index.html"
8180 ACCESSKEY="H"
8181 >Home</A
8182 ></TD
8183 ><TD
8184 WIDTH="33%"
8185 ALIGN="right"
8186 VALIGN="top"
8187 ><A
8188 HREF="filter-file.html"
8189 ACCESSKEY="N"
8190 >Next</A
8191 ></TD
8192 ></TR
8193 ><TR
8194 ><TD
8195 WIDTH="33%"
8196 ALIGN="left"
8197 VALIGN="top"
8198 >The Main Configuration File</TD
8199 ><TD
8200 WIDTH="34%"
8201 ALIGN="center"
8202 VALIGN="top"
8203 >&nbsp;</TD
8204 ><TD
8205 WIDTH="33%"
8206 ALIGN="right"
8207 VALIGN="top"
8208 >Filter Files</TD
8209 ></TR
8210 ></TABLE
8211 ></DIV
8212 ></BODY
8213 ></HTML
8214 >