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