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