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