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