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