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