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