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