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