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