rebuild docs
[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/</PRE
2410 ></TD
2411 ></TR
2412 ></TABLE
2413 ><TABLE
2414 BORDER="0"
2415 BGCOLOR="#E0E0E0"
2416 WIDTH="90%"
2417 ><TR
2418 ><TD
2419 ><PRE
2420 CLASS="SCREEN"
2421 ># Tag all requests with the Range header set
2422 {+client-header-tagger{range-requests}}
2423 /
2424
2425 # Disable filtering for the tagged requests.
2426 #
2427 # With filtering enabled Privoxy would remove the Range headers
2428 # to be able to filter the whole response. The downside is that
2429 # it prevents clients from resuming downloads or skipping over
2430 # parts of multimedia files.
2431 {-filter -deanimate-gifs}
2432 TAG:^RANGE-REQUEST$</PRE
2433 ></TD
2434 ></TR
2435 ></TABLE
2436 ><TABLE
2437 BORDER="0"
2438 BGCOLOR="#E0E0E0"
2439 WIDTH="90%"
2440 ><TR
2441 ><TD
2442 ><PRE
2443 CLASS="SCREEN"
2444 ># Tag all requests with the client IP address
2445 #
2446 # (Technically the client IP address isn't included in the
2447 # client headers but client-header taggers can set it anyway.
2448 # For details see the tagger in default.filter)
2449 {+client-header-tagger{client-ip-address}}
2450 /
2451
2452 # Change forwarding settings for requests coming from address 10.0.0.1
2453 {+forward-override{forward-socks5 127.0.1.2:2222 .}}
2454 TAG:^IP-ADDRESS: 10\.0\.0\.1$</PRE
2455 ></TD
2456 ></TR
2457 ></TABLE
2458 ></DD
2459 ></DL
2460 ></DIV
2461 ></DIV
2462 ><DIV
2463 CLASS="SECT3"
2464 ><H4
2465 CLASS="SECT3"
2466 ><A
2467 NAME="CONTENT-TYPE-OVERWRITE"
2468 >8.5.6. content-type-overwrite</A
2469 ></H4
2470 ><P
2471 ></P
2472 ><DIV
2473 CLASS="VARIABLELIST"
2474 ><DL
2475 ><DT
2476 >Typical use:</DT
2477 ><DD
2478 ><P
2479 >Stop useless download menus from popping up, or change the browser's rendering mode</P
2480 ></DD
2481 ><DT
2482 >Effect:</DT
2483 ><DD
2484 ><P
2485 >    Replaces the <SPAN
2486 CLASS="QUOTE"
2487 >"Content-Type:"</SPAN
2488 > HTTP server header.
2489    </P
2490 ></DD
2491 ><DT
2492 >Type:</DT
2493 ><DD
2494 ><P
2495 >Parameterized.</P
2496 ></DD
2497 ><DT
2498 >Parameter:</DT
2499 ><DD
2500 ><P
2501 >    Any string.
2502    </P
2503 ></DD
2504 ><DT
2505 >Notes:</DT
2506 ><DD
2507 ><P
2508 >    The <SPAN
2509 CLASS="QUOTE"
2510 >"Content-Type:"</SPAN
2511 > HTTP server header is used by the
2512     browser to decide what to do with the document. The value of this
2513     header can cause the browser to open a download menu instead of
2514     displaying the document by itself, even if the document's format is
2515     supported by the browser.
2516    </P
2517 ><P
2518 >    The declared content type can also affect which rendering mode
2519     the browser chooses. If XHTML is delivered as <SPAN
2520 CLASS="QUOTE"
2521 >"text/html"</SPAN
2522 >,
2523     many browsers treat it as yet another broken HTML document.
2524     If it is send as <SPAN
2525 CLASS="QUOTE"
2526 >"application/xml"</SPAN
2527 >, browsers with
2528     XHTML support will only display it, if the syntax is correct.
2529    </P
2530 ><P
2531 >    If you see a web site that proudly uses XHTML buttons, but sets
2532     <SPAN
2533 CLASS="QUOTE"
2534 >"Content-Type: text/html"</SPAN
2535 >, you can use <SPAN
2536 CLASS="APPLICATION"
2537 >Privoxy</SPAN
2538 >
2539     to overwrite it with <SPAN
2540 CLASS="QUOTE"
2541 >"application/xml"</SPAN
2542 > and validate
2543     the web master's claim inside your XHTML-supporting browser.
2544     If the syntax is incorrect, the browser will complain loudly.
2545    </P
2546 ><P
2547 >    You can also go the opposite direction: if your browser prints
2548     error messages instead of rendering a document falsely declared
2549     as XHTML, you can overwrite the content type with
2550     <SPAN
2551 CLASS="QUOTE"
2552 >"text/html"</SPAN
2553 > and have it rendered as broken HTML document.
2554    </P
2555 ><P
2556 >    By default <TT
2557 CLASS="LITERAL"
2558 >content-type-overwrite</TT
2559 > only replaces
2560     <SPAN
2561 CLASS="QUOTE"
2562 >"Content-Type:"</SPAN
2563 > headers that look like some kind of text.
2564     If you want to overwrite it unconditionally, you have to combine it with
2565     <TT
2566 CLASS="LITERAL"
2567 ><A
2568 HREF="actions-file.html#FORCE-TEXT-MODE"
2569 >force-text-mode</A
2570 ></TT
2571 >.
2572     This limitation exists for a reason, think twice before circumventing it.
2573    </P
2574 ><P
2575 >    Most of the time it's easier to replace this action with a custom
2576     <TT
2577 CLASS="LITERAL"
2578 ><A
2579 HREF="actions-file.html#SERVER-HEADER-FILTER"
2580 >server-header filter</A
2581 ></TT
2582 >.
2583     It allows you to activate it for every document of a certain site and it will still
2584     only replace the content types you aimed at.
2585    </P
2586 ><P
2587 >    Of course you can apply <TT
2588 CLASS="LITERAL"
2589 >content-type-overwrite</TT
2590 >
2591     to a whole site and then make URL based exceptions, but it's a lot
2592     more work to get the same precision.
2593    </P
2594 ></DD
2595 ><DT
2596 >Example usage (sections):</DT
2597 ><DD
2598 ><TABLE
2599 BORDER="0"
2600 BGCOLOR="#E0E0E0"
2601 WIDTH="90%"
2602 ><TR
2603 ><TD
2604 ><PRE
2605 CLASS="SCREEN"
2606 ># Check if www.example.net/ really uses valid XHTML
2607 { +content-type-overwrite{application/xml} }
2608 www.example.net/
2609
2610 # but leave the content type unmodified if the URL looks like a style sheet
2611 {-content-type-overwrite}
2612 www.example.net/.*\.css$
2613 www.example.net/.*style</PRE
2614 ></TD
2615 ></TR
2616 ></TABLE
2617 ></DD
2618 ></DL
2619 ></DIV
2620 ></DIV
2621 ><DIV
2622 CLASS="SECT3"
2623 ><H4
2624 CLASS="SECT3"
2625 ><A
2626 NAME="CRUNCH-CLIENT-HEADER"
2627 >8.5.7. crunch-client-header</A
2628 ></H4
2629 ><P
2630 ></P
2631 ><DIV
2632 CLASS="VARIABLELIST"
2633 ><DL
2634 ><DT
2635 >Typical use:</DT
2636 ><DD
2637 ><P
2638 >Remove a client header <SPAN
2639 CLASS="APPLICATION"
2640 >Privoxy</SPAN
2641 > has no dedicated action for.</P
2642 ></DD
2643 ><DT
2644 >Effect:</DT
2645 ><DD
2646 ><P
2647 >    Deletes every header sent by the client that contains the string the user supplied as parameter.
2648    </P
2649 ></DD
2650 ><DT
2651 >Type:</DT
2652 ><DD
2653 ><P
2654 >Parameterized.</P
2655 ></DD
2656 ><DT
2657 >Parameter:</DT
2658 ><DD
2659 ><P
2660 >    Any string.
2661    </P
2662 ></DD
2663 ><DT
2664 >Notes:</DT
2665 ><DD
2666 ><P
2667 >    This action allows you to block client headers for which no dedicated
2668     <SPAN
2669 CLASS="APPLICATION"
2670 >Privoxy</SPAN
2671 > action exists.
2672     <SPAN
2673 CLASS="APPLICATION"
2674 >Privoxy</SPAN
2675 > will remove every client header that
2676     contains the string you supplied as parameter.
2677    </P
2678 ><P
2679 >    Regular expressions are <SPAN
2680 CLASS="emphasis"
2681 ><I
2682 CLASS="EMPHASIS"
2683 >not supported</I
2684 ></SPAN
2685 > and you can't
2686     use this action to block different headers in the same request, unless
2687     they contain the same string.
2688    </P
2689 ><P
2690 >    <TT
2691 CLASS="LITERAL"
2692 >crunch-client-header</TT
2693 > is only meant for quick tests.
2694     If you have to block several different headers, or only want to modify
2695     parts of them, you should use a
2696     <TT
2697 CLASS="LITERAL"
2698 ><A
2699 HREF="actions-file.html#CLIENT-HEADER-FILTER"
2700 >client-header filter</A
2701 ></TT
2702 >.
2703    </P
2704 ><DIV
2705 CLASS="WARNING"
2706 ><P
2707 ></P
2708 ><TABLE
2709 CLASS="WARNING"
2710 BORDER="1"
2711 WIDTH="90%"
2712 ><TR
2713 ><TD
2714 ALIGN="CENTER"
2715 ><B
2716 >Warning</B
2717 ></TD
2718 ></TR
2719 ><TR
2720 ><TD
2721 ALIGN="LEFT"
2722 ><P
2723 >      Don't block any header without understanding the consequences.
2724      </P
2725 ></TD
2726 ></TR
2727 ></TABLE
2728 ></DIV
2729 ></DD
2730 ><DT
2731 >Example usage (section):</DT
2732 ><DD
2733 ><TABLE
2734 BORDER="0"
2735 BGCOLOR="#E0E0E0"
2736 WIDTH="90%"
2737 ><TR
2738 ><TD
2739 ><PRE
2740 CLASS="SCREEN"
2741 ># Block the non-existent "Privacy-Violation:" client header
2742 { +crunch-client-header{Privacy-Violation:} }
2743 /</PRE
2744 ></TD
2745 ></TR
2746 ></TABLE
2747 ></DD
2748 ></DL
2749 ></DIV
2750 ></DIV
2751 ><DIV
2752 CLASS="SECT3"
2753 ><H4
2754 CLASS="SECT3"
2755 ><A
2756 NAME="CRUNCH-IF-NONE-MATCH"
2757 >8.5.8. crunch-if-none-match</A
2758 ></H4
2759 ><P
2760 ></P
2761 ><DIV
2762 CLASS="VARIABLELIST"
2763 ><DL
2764 ><DT
2765 >Typical use:</DT
2766 ><DD
2767 ><P
2768 >Prevent yet another way to track the user's steps between sessions.</P
2769 ></DD
2770 ><DT
2771 >Effect:</DT
2772 ><DD
2773 ><P
2774 >    Deletes the <SPAN
2775 CLASS="QUOTE"
2776 >"If-None-Match:"</SPAN
2777 > HTTP client header.
2778    </P
2779 ></DD
2780 ><DT
2781 >Type:</DT
2782 ><DD
2783 ><P
2784 >Boolean.</P
2785 ></DD
2786 ><DT
2787 >Parameter:</DT
2788 ><DD
2789 ><P
2790 >    N/A
2791    </P
2792 ></DD
2793 ><DT
2794 >Notes:</DT
2795 ><DD
2796 ><P
2797 >    Removing the <SPAN
2798 CLASS="QUOTE"
2799 >"If-None-Match:"</SPAN
2800 > HTTP client header
2801     is useful for filter testing, where you want to force a real
2802     reload instead of getting status code <SPAN
2803 CLASS="QUOTE"
2804 >"304"</SPAN
2805 > which
2806     would cause the browser to use a cached copy of the page.
2807    </P
2808 ><P
2809 >    It is also useful to make sure the header isn't used as a cookie
2810     replacement (unlikely but possible).
2811    </P
2812 ><P
2813 >    Blocking the <SPAN
2814 CLASS="QUOTE"
2815 >"If-None-Match:"</SPAN
2816 > header shouldn't cause any
2817     caching problems, as long as the <SPAN
2818 CLASS="QUOTE"
2819 >"If-Modified-Since:"</SPAN
2820 > header
2821     isn't blocked or missing as well.
2822    </P
2823 ><P
2824 >    It is recommended to use this action together with
2825     <TT
2826 CLASS="LITERAL"
2827 ><A
2828 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2829 >hide-if-modified-since</A
2830 ></TT
2831 >
2832     and
2833     <TT
2834 CLASS="LITERAL"
2835 ><A
2836 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2837 >overwrite-last-modified</A
2838 ></TT
2839 >.
2840    </P
2841 ></DD
2842 ><DT
2843 >Example usage (section):</DT
2844 ><DD
2845 ><TABLE
2846 BORDER="0"
2847 BGCOLOR="#E0E0E0"
2848 WIDTH="90%"
2849 ><TR
2850 ><TD
2851 ><PRE
2852 CLASS="SCREEN"
2853 ># Let the browser revalidate cached documents but don't
2854 # allow the server to use the revalidation headers for user tracking.
2855 {+hide-if-modified-since{-60} \
2856  +overwrite-last-modified{randomize} \
2857  +crunch-if-none-match}
2858 /</PRE
2859 ></TD
2860 ></TR
2861 ></TABLE
2862 ></DD
2863 ></DL
2864 ></DIV
2865 ></DIV
2866 ><DIV
2867 CLASS="SECT3"
2868 ><H4
2869 CLASS="SECT3"
2870 ><A
2871 NAME="CRUNCH-INCOMING-COOKIES"
2872 >8.5.9. crunch-incoming-cookies</A
2873 ></H4
2874 ><P
2875 ></P
2876 ><DIV
2877 CLASS="VARIABLELIST"
2878 ><DL
2879 ><DT
2880 >Typical use:</DT
2881 ><DD
2882 ><P
2883 >    Prevent the web server from setting HTTP cookies on your system
2884    </P
2885 ></DD
2886 ><DT
2887 >Effect:</DT
2888 ><DD
2889 ><P
2890 >    Deletes any <SPAN
2891 CLASS="QUOTE"
2892 >"Set-Cookie:"</SPAN
2893 > HTTP headers from server replies.
2894    </P
2895 ></DD
2896 ><DT
2897 >Type:</DT
2898 ><DD
2899 ><P
2900 >Boolean.</P
2901 ></DD
2902 ><DT
2903 >Parameter:</DT
2904 ><DD
2905 ><P
2906 >    N/A
2907    </P
2908 ></DD
2909 ><DT
2910 >Notes:</DT
2911 ><DD
2912 ><P
2913 >    This action is only concerned with <SPAN
2914 CLASS="emphasis"
2915 ><I
2916 CLASS="EMPHASIS"
2917 >incoming</I
2918 ></SPAN
2919 > HTTP cookies. For
2920     <SPAN
2921 CLASS="emphasis"
2922 ><I
2923 CLASS="EMPHASIS"
2924 >outgoing</I
2925 ></SPAN
2926 > HTTP cookies, use
2927     <TT
2928 CLASS="LITERAL"
2929 ><A
2930 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2931 >crunch-outgoing-cookies</A
2932 ></TT
2933 >.
2934     Use <SPAN
2935 CLASS="emphasis"
2936 ><I
2937 CLASS="EMPHASIS"
2938 >both</I
2939 ></SPAN
2940 > to disable HTTP cookies completely.
2941    </P
2942 ><P
2943 >    It makes <SPAN
2944 CLASS="emphasis"
2945 ><I
2946 CLASS="EMPHASIS"
2947 >no sense at all</I
2948 ></SPAN
2949 > to use this action in conjunction
2950     with the <TT
2951 CLASS="LITERAL"
2952 ><A
2953 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2954 >session-cookies-only</A
2955 ></TT
2956 > action,
2957     since it would prevent the session cookies from being set. See also
2958     <TT
2959 CLASS="LITERAL"
2960 ><A
2961 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2962 >filter-content-cookies</A
2963 ></TT
2964 >.
2965    </P
2966 ></DD
2967 ><DT
2968 >Example usage:</DT
2969 ><DD
2970 ><TABLE
2971 BORDER="0"
2972 BGCOLOR="#E0E0E0"
2973 WIDTH="90%"
2974 ><TR
2975 ><TD
2976 ><PRE
2977 CLASS="SCREEN"
2978 >+crunch-incoming-cookies</PRE
2979 ></TD
2980 ></TR
2981 ></TABLE
2982 ></DD
2983 ></DL
2984 ></DIV
2985 ></DIV
2986 ><DIV
2987 CLASS="SECT3"
2988 ><H4
2989 CLASS="SECT3"
2990 ><A
2991 NAME="CRUNCH-SERVER-HEADER"
2992 >8.5.10. crunch-server-header</A
2993 ></H4
2994 ><P
2995 ></P
2996 ><DIV
2997 CLASS="VARIABLELIST"
2998 ><DL
2999 ><DT
3000 >Typical use:</DT
3001 ><DD
3002 ><P
3003 >Remove a server header <SPAN
3004 CLASS="APPLICATION"
3005 >Privoxy</SPAN
3006 > has no dedicated action for.</P
3007 ></DD
3008 ><DT
3009 >Effect:</DT
3010 ><DD
3011 ><P
3012 >    Deletes every header sent by the server that contains the string the user supplied as parameter.
3013    </P
3014 ></DD
3015 ><DT
3016 >Type:</DT
3017 ><DD
3018 ><P
3019 >Parameterized.</P
3020 ></DD
3021 ><DT
3022 >Parameter:</DT
3023 ><DD
3024 ><P
3025 >    Any string.
3026    </P
3027 ></DD
3028 ><DT
3029 >Notes:</DT
3030 ><DD
3031 ><P
3032 >    This action allows you to block server headers for which no dedicated
3033     <SPAN
3034 CLASS="APPLICATION"
3035 >Privoxy</SPAN
3036 > action exists. <SPAN
3037 CLASS="APPLICATION"
3038 >Privoxy</SPAN
3039 >
3040     will remove every server header that contains the string you supplied as parameter.
3041    </P
3042 ><P
3043 >    Regular expressions are <SPAN
3044 CLASS="emphasis"
3045 ><I
3046 CLASS="EMPHASIS"
3047 >not supported</I
3048 ></SPAN
3049 > and you can't
3050     use this action to block different headers in the same request, unless
3051     they contain the same string.
3052    </P
3053 ><P
3054 >    <TT
3055 CLASS="LITERAL"
3056 >crunch-server-header</TT
3057 > is only meant for quick tests.
3058     If you have to block several different headers, or only want to modify
3059     parts of them, you should use a custom
3060     <TT
3061 CLASS="LITERAL"
3062 ><A
3063 HREF="actions-file.html#SERVER-HEADER-FILTER"
3064 >server-header filter</A
3065 ></TT
3066 >.
3067    </P
3068 ><DIV
3069 CLASS="WARNING"
3070 ><P
3071 ></P
3072 ><TABLE
3073 CLASS="WARNING"
3074 BORDER="1"
3075 WIDTH="90%"
3076 ><TR
3077 ><TD
3078 ALIGN="CENTER"
3079 ><B
3080 >Warning</B
3081 ></TD
3082 ></TR
3083 ><TR
3084 ><TD
3085 ALIGN="LEFT"
3086 ><P
3087 >     Don't block any header without understanding the consequences.
3088      </P
3089 ></TD
3090 ></TR
3091 ></TABLE
3092 ></DIV
3093 ></DD
3094 ><DT
3095 >Example usage (section):</DT
3096 ><DD
3097 ><TABLE
3098 BORDER="0"
3099 BGCOLOR="#E0E0E0"
3100 WIDTH="90%"
3101 ><TR
3102 ><TD
3103 ><PRE
3104 CLASS="SCREEN"
3105 ># Crunch server headers that try to prevent caching
3106 { +crunch-server-header{no-cache} }
3107 /</PRE
3108 ></TD
3109 ></TR
3110 ></TABLE
3111 ></DD
3112 ></DL
3113 ></DIV
3114 ></DIV
3115 ><DIV
3116 CLASS="SECT3"
3117 ><H4
3118 CLASS="SECT3"
3119 ><A
3120 NAME="CRUNCH-OUTGOING-COOKIES"
3121 >8.5.11. crunch-outgoing-cookies</A
3122 ></H4
3123 ><P
3124 ></P
3125 ><DIV
3126 CLASS="VARIABLELIST"
3127 ><DL
3128 ><DT
3129 >Typical use:</DT
3130 ><DD
3131 ><P
3132 >    Prevent the web server from reading any HTTP cookies from your system
3133    </P
3134 ></DD
3135 ><DT
3136 >Effect:</DT
3137 ><DD
3138 ><P
3139 >    Deletes any <SPAN
3140 CLASS="QUOTE"
3141 >"Cookie:"</SPAN
3142 > HTTP headers from client requests.
3143    </P
3144 ></DD
3145 ><DT
3146 >Type:</DT
3147 ><DD
3148 ><P
3149 >Boolean.</P
3150 ></DD
3151 ><DT
3152 >Parameter:</DT
3153 ><DD
3154 ><P
3155 >    N/A
3156    </P
3157 ></DD
3158 ><DT
3159 >Notes:</DT
3160 ><DD
3161 ><P
3162 >    This action is only concerned with <SPAN
3163 CLASS="emphasis"
3164 ><I
3165 CLASS="EMPHASIS"
3166 >outgoing</I
3167 ></SPAN
3168 > HTTP cookies. For
3169     <SPAN
3170 CLASS="emphasis"
3171 ><I
3172 CLASS="EMPHASIS"
3173 >incoming</I
3174 ></SPAN
3175 > HTTP cookies, use
3176     <TT
3177 CLASS="LITERAL"
3178 ><A
3179 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3180 >crunch-incoming-cookies</A
3181 ></TT
3182 >.
3183     Use <SPAN
3184 CLASS="emphasis"
3185 ><I
3186 CLASS="EMPHASIS"
3187 >both</I
3188 ></SPAN
3189 > to disable HTTP cookies completely.
3190    </P
3191 ><P
3192 >    It makes <SPAN
3193 CLASS="emphasis"
3194 ><I
3195 CLASS="EMPHASIS"
3196 >no sense at all</I
3197 ></SPAN
3198 > to use this action in conjunction
3199     with the <TT
3200 CLASS="LITERAL"
3201 ><A
3202 HREF="actions-file.html#SESSION-COOKIES-ONLY"
3203 >session-cookies-only</A
3204 ></TT
3205 > action,
3206     since it would prevent the session cookies from being read.
3207    </P
3208 ></DD
3209 ><DT
3210 >Example usage:</DT
3211 ><DD
3212 ><TABLE
3213 BORDER="0"
3214 BGCOLOR="#E0E0E0"
3215 WIDTH="90%"
3216 ><TR
3217 ><TD
3218 ><PRE
3219 CLASS="SCREEN"
3220 >+crunch-outgoing-cookies</PRE
3221 ></TD
3222 ></TR
3223 ></TABLE
3224 ></DD
3225 ></DL
3226 ></DIV
3227 ></DIV
3228 ><DIV
3229 CLASS="SECT3"
3230 ><H4
3231 CLASS="SECT3"
3232 ><A
3233 NAME="DEANIMATE-GIFS"
3234 >8.5.12. deanimate-gifs</A
3235 ></H4
3236 ><P
3237 ></P
3238 ><DIV
3239 CLASS="VARIABLELIST"
3240 ><DL
3241 ><DT
3242 >Typical use:</DT
3243 ><DD
3244 ><P
3245 >Stop those annoying, distracting animated GIF images.</P
3246 ></DD
3247 ><DT
3248 >Effect:</DT
3249 ><DD
3250 ><P
3251 >    De-animate GIF animations, i.e. reduce them to their first or last image.
3252    </P
3253 ></DD
3254 ><DT
3255 >Type:</DT
3256 ><DD
3257 ><P
3258 >Parameterized.</P
3259 ></DD
3260 ><DT
3261 >Parameter:</DT
3262 ><DD
3263 ><P
3264 >    <SPAN
3265 CLASS="QUOTE"
3266 >"last"</SPAN
3267 > or <SPAN
3268 CLASS="QUOTE"
3269 >"first"</SPAN
3270 >
3271    </P
3272 ></DD
3273 ><DT
3274 >Notes:</DT
3275 ><DD
3276 ><P
3277 >    This will also shrink the images considerably (in bytes, not pixels!). If
3278     the option <SPAN
3279 CLASS="QUOTE"
3280 >"first"</SPAN
3281 > is given, the first frame of the animation
3282     is used as the replacement. If <SPAN
3283 CLASS="QUOTE"
3284 >"last"</SPAN
3285 > is given, the last
3286     frame of the animation is used instead, which probably makes more sense for
3287     most banner animations, but also has the risk of not showing the entire
3288     last frame (if it is only a delta to an earlier frame).
3289    </P
3290 ><P
3291 >    You can safely use this action with patterns that will also match non-GIF
3292     objects, because no attempt will be made at anything that doesn't look like
3293     a GIF.
3294    </P
3295 ></DD
3296 ><DT
3297 >Example usage:</DT
3298 ><DD
3299 ><TABLE
3300 BORDER="0"
3301 BGCOLOR="#E0E0E0"
3302 WIDTH="90%"
3303 ><TR
3304 ><TD
3305 ><PRE
3306 CLASS="SCREEN"
3307 >+deanimate-gifs{last}</PRE
3308 ></TD
3309 ></TR
3310 ></TABLE
3311 ></DD
3312 ></DL
3313 ></DIV
3314 ></DIV
3315 ><DIV
3316 CLASS="SECT3"
3317 ><H4
3318 CLASS="SECT3"
3319 ><A
3320 NAME="DOWNGRADE-HTTP-VERSION"
3321 >8.5.13. downgrade-http-version</A
3322 ></H4
3323 ><P
3324 ></P
3325 ><DIV
3326 CLASS="VARIABLELIST"
3327 ><DL
3328 ><DT
3329 >Typical use:</DT
3330 ><DD
3331 ><P
3332 >Work around (very rare) problems with HTTP/1.1</P
3333 ></DD
3334 ><DT
3335 >Effect:</DT
3336 ><DD
3337 ><P
3338 >    Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3339    </P
3340 ></DD
3341 ><DT
3342 >Type:</DT
3343 ><DD
3344 ><P
3345 >Boolean.</P
3346 ></DD
3347 ><DT
3348 >Parameter:</DT
3349 ><DD
3350 ><P
3351 >    N/A
3352    </P
3353 ></DD
3354 ><DT
3355 >Notes:</DT
3356 ><DD
3357 ><P
3358 >    This is a left-over from the time when <SPAN
3359 CLASS="APPLICATION"
3360 >Privoxy</SPAN
3361 >
3362     didn't support important HTTP/1.1 features well. It is left here for the
3363     unlikely case that you experience HTTP/1.1-related problems with some server
3364     out there.
3365    </P
3366 ><P
3367 >    Note that enabling this action is only a workaround. It should not
3368     be enabled for sites that work without it. While it shouldn't break
3369     any pages, it has an (usually negative) performance impact.
3370   </P
3371 ><P
3372 >    If you come across a site where enabling this action helps, please report it,
3373     so the cause of the problem can be analyzed. If the problem turns out to be
3374     caused by a bug in  <SPAN
3375 CLASS="APPLICATION"
3376 >Privoxy</SPAN
3377 > it should be
3378     fixed so the following release works without the work around.
3379    </P
3380 ></DD
3381 ><DT
3382 >Example usage (section):</DT
3383 ><DD
3384 ><TABLE
3385 BORDER="0"
3386 BGCOLOR="#E0E0E0"
3387 WIDTH="90%"
3388 ><TR
3389 ><TD
3390 ><PRE
3391 CLASS="SCREEN"
3392 >{+downgrade-http-version}
3393 problem-host.example.com</PRE
3394 ></TD
3395 ></TR
3396 ></TABLE
3397 ></DD
3398 ></DL
3399 ></DIV
3400 ></DIV
3401 ><DIV
3402 CLASS="SECT3"
3403 ><H4
3404 CLASS="SECT3"
3405 ><A
3406 NAME="EXTERNAL-FILTER"
3407 >8.5.14. external-filter</A
3408 ></H4
3409 ><P
3410 ></P
3411 ><DIV
3412 CLASS="VARIABLELIST"
3413 ><DL
3414 ><DT
3415 >Typical use:</DT
3416 ><DD
3417 ><P
3418 >Modify content using a programming language of your choice.</P
3419 ></DD
3420 ><DT
3421 >Effect:</DT
3422 ><DD
3423 ><P
3424 >    All instances of text-based type, most notably HTML and JavaScript, to which
3425     this action applies, can be filtered on-the-fly through the specified external
3426     filter.
3427     By default plain text documents are exempted from filtering, because web
3428     servers often use the <TT
3429 CLASS="LITERAL"
3430 >text/plain</TT
3431 > MIME type for all files
3432     whose type they don't know.)
3433    </P
3434 ></DD
3435 ><DT
3436 >Type:</DT
3437 ><DD
3438 ><P
3439 >Multi-value.</P
3440 ></DD
3441 ><DT
3442 >Parameter:</DT
3443 ><DD
3444 ><P
3445 >    The name of an external content filter, as defined in the
3446     <A
3447 HREF="filter-file.html"
3448 >filter file</A
3449 >.
3450     External filters can be defined in one or more files as defined by the
3451     <TT
3452 CLASS="LITERAL"
3453 ><A
3454 HREF="config.html#FILTERFILE"
3455 >filterfile</A
3456 ></TT
3457 >
3458     option in the <A
3459 HREF="config.html"
3460 >config file</A
3461 >.
3462    </P
3463 ><P
3464 >    When used in its negative form,
3465     and without parameters, <SPAN
3466 CLASS="emphasis"
3467 ><I
3468 CLASS="EMPHASIS"
3469 >all</I
3470 ></SPAN
3471 > filtering with external
3472     filters is completely disabled.
3473   </P
3474 ></DD
3475 ><DT
3476 >Notes:</DT
3477 ><DD
3478 ><P
3479 >    External filters are scripts or programs that can modify the content in
3480     case common <TT
3481 CLASS="LITERAL"
3482 ><A
3483 HREF="actions-file.html#FILTER"
3484 >filters</A
3485 ></TT
3486 >
3487     aren't powerful enough. With the exception that this action doesn't
3488     use pcrs-based filters, the notes in the
3489     <TT
3490 CLASS="LITERAL"
3491 ><A
3492 HREF="actions-file.html#FILTER"
3493 >filter</A
3494 ></TT
3495 > section apply.
3496    </P
3497 ><DIV
3498 CLASS="WARNING"
3499 ><P
3500 ></P
3501 ><TABLE
3502 CLASS="WARNING"
3503 BORDER="1"
3504 WIDTH="90%"
3505 ><TR
3506 ><TD
3507 ALIGN="CENTER"
3508 ><B
3509 >Warning</B
3510 ></TD
3511 ></TR
3512 ><TR
3513 ><TD
3514 ALIGN="LEFT"
3515 ><P
3516 >     Currently external filters are executed with <SPAN
3517 CLASS="APPLICATION"
3518 >Privoxy</SPAN
3519 >'s privileges.
3520      Only use external filters you understand and trust.
3521     </P
3522 ></TD
3523 ></TR
3524 ></TABLE
3525 ></DIV
3526 ><P
3527 >    This feature is experimental, the <TT
3528 CLASS="LITERAL"
3529 ><A
3530 HREF="filter-file.html#EXTERNAL-FILTER-SYNTAX"
3531 >syntax</A
3532 ></TT
3533 >
3534     may change in the future.
3535    </P
3536 ></DD
3537 ><DT
3538 >Example usage:</DT
3539 ><DD
3540 ><TABLE
3541 BORDER="0"
3542 BGCOLOR="#E0E0E0"
3543 WIDTH="90%"
3544 ><TR
3545 ><TD
3546 ><PRE
3547 CLASS="SCREEN"
3548 >+external-filter{fancy-filter}</PRE
3549 ></TD
3550 ></TR
3551 ></TABLE
3552 ></DD
3553 ></DL
3554 ></DIV
3555 ></DIV
3556 ><DIV
3557 CLASS="SECT3"
3558 ><H4
3559 CLASS="SECT3"
3560 ><A
3561 NAME="FAST-REDIRECTS"
3562 >8.5.15. fast-redirects</A
3563 ></H4
3564 ><P
3565 ></P
3566 ><DIV
3567 CLASS="VARIABLELIST"
3568 ><DL
3569 ><DT
3570 >Typical use:</DT
3571 ><DD
3572 ><P
3573 >Fool some click-tracking scripts and speed up indirect links.</P
3574 ></DD
3575 ><DT
3576 >Effect:</DT
3577 ><DD
3578 ><P
3579 >    Detects redirection URLs and redirects the browser without contacting
3580     the redirection server first.
3581    </P
3582 ></DD
3583 ><DT
3584 >Type:</DT
3585 ><DD
3586 ><P
3587 >Parameterized.</P
3588 ></DD
3589 ><DT
3590 >Parameter:</DT
3591 ><DD
3592 ><P
3593 ></P
3594 ><UL
3595 ><LI
3596 ><P
3597 >      <SPAN
3598 CLASS="QUOTE"
3599 >"simple-check"</SPAN
3600 > to just search for the string <SPAN
3601 CLASS="QUOTE"
3602 >"http://"</SPAN
3603 >
3604       to detect redirection URLs.
3605      </P
3606 ></LI
3607 ><LI
3608 ><P
3609 >      <SPAN
3610 CLASS="QUOTE"
3611 >"check-decoded-url"</SPAN
3612 > to decode URLs (if necessary) before searching
3613       for redirection URLs.
3614      </P
3615 ></LI
3616 ></UL
3617 ></DD
3618 ><DT
3619 >Notes:</DT
3620 ><DD
3621 ><P
3622 >    Many sites, like yahoo.com, don't just link to other sites. Instead, they
3623     will link to some script on their own servers, giving the destination as a
3624     parameter, which will then redirect you to the final target. URLs
3625     resulting from this scheme typically look like:
3626     <SPAN
3627 CLASS="QUOTE"
3628 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
3629 >.
3630   </P
3631 ><P
3632 >    Sometimes, there are even multiple consecutive redirects encoded in the
3633     URL. These redirections via scripts make your web browsing more traceable,
3634     since the server from which you follow such a link can see where you go
3635     to. Apart from that, valuable bandwidth and time is wasted, while your
3636     browser asks the server for one redirect after the other. Plus, it feeds
3637     the advertisers.
3638    </P
3639 ><P
3640 >    This feature is currently not very smart and is scheduled for improvement.
3641     If it is enabled by default, you will have to create some exceptions to
3642     this action. It can lead to failures in several ways:
3643    </P
3644 ><P
3645 >    Not every URLs with other URLs as parameters is evil.
3646     Some sites offer a real service that requires this information to work.
3647     For example a validation service needs to know, which document to validate.
3648     <TT
3649 CLASS="LITERAL"
3650 >fast-redirects</TT
3651 > assumes that every URL parameter that
3652     looks like another URL is a redirection target, and will always redirect to
3653     the last one. Most of the time the assumption is correct, but if it isn't,
3654     the user gets redirected anyway.
3655    </P
3656 ><P
3657 >    Another failure occurs if the URL contains other parameters after the URL parameter.
3658     The URL:
3659     <SPAN
3660 CLASS="QUOTE"
3661 >"http://www.example.org/?redirect=http%3a//www.example.net/&#38;foo=bar"</SPAN
3662 >.
3663     contains the redirection URL <SPAN
3664 CLASS="QUOTE"
3665 >"http://www.example.net/"</SPAN
3666 >,
3667     followed by another parameter. <TT
3668 CLASS="LITERAL"
3669 >fast-redirects</TT
3670 > doesn't know that
3671     and will cause a redirect to <SPAN
3672 CLASS="QUOTE"
3673 >"http://www.example.net/&#38;foo=bar"</SPAN
3674 >.
3675     Depending on the target server configuration, the parameter will be silently ignored
3676     or lead to a <SPAN
3677 CLASS="QUOTE"
3678 >"page not found"</SPAN
3679 > error. You can prevent this problem by
3680     first using the <TT
3681 CLASS="LITERAL"
3682 ><A
3683 HREF="actions-file.html#REDIRECT"
3684 >redirect</A
3685 ></TT
3686 > action
3687     to remove the last part of the URL, but it requires a little effort.
3688    </P
3689 ><P
3690 >    To detect a redirection URL, <TT
3691 CLASS="LITERAL"
3692 >fast-redirects</TT
3693 > only
3694     looks for the string <SPAN
3695 CLASS="QUOTE"
3696 >"http://"</SPAN
3697 >, either in plain text
3698     (invalid but often used) or encoded as <SPAN
3699 CLASS="QUOTE"
3700 >"http%3a//"</SPAN
3701 >.
3702     Some sites use their own URL encoding scheme, encrypt the address
3703     of the target server or replace it with a database id. In theses cases
3704     <TT
3705 CLASS="LITERAL"
3706 >fast-redirects</TT
3707 > is fooled and the request reaches the
3708     redirection server where it probably gets logged.
3709    </P
3710 ></DD
3711 ><DT
3712 >Example usage:</DT
3713 ><DD
3714 ><TABLE
3715 BORDER="0"
3716 BGCOLOR="#E0E0E0"
3717 WIDTH="90%"
3718 ><TR
3719 ><TD
3720 ><PRE
3721 CLASS="SCREEN"
3722 > { +fast-redirects{simple-check} }
3723    one.example.com
3724
3725  { +fast-redirects{check-decoded-url} }
3726    another.example.com/testing</PRE
3727 ></TD
3728 ></TR
3729 ></TABLE
3730 ></DD
3731 ></DL
3732 ></DIV
3733 ></DIV
3734 ><DIV
3735 CLASS="SECT3"
3736 ><H4
3737 CLASS="SECT3"
3738 ><A
3739 NAME="FILTER"
3740 >8.5.16. filter</A
3741 ></H4
3742 ><P
3743 ></P
3744 ><DIV
3745 CLASS="VARIABLELIST"
3746 ><DL
3747 ><DT
3748 >Typical use:</DT
3749 ><DD
3750 ><P
3751 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size),
3752          do fun text replacements, add personalized effects, etc.</P
3753 ></DD
3754 ><DT
3755 >Effect:</DT
3756 ><DD
3757 ><P
3758 >    All instances of text-based type, most notably HTML and JavaScript, to which
3759     this action applies, can be filtered on-the-fly through the specified regular
3760     expression based substitutions. (Note: as of version 3.0.3 plain text documents
3761     are exempted from filtering, because web servers often use the
3762    <TT
3763 CLASS="LITERAL"
3764 >text/plain</TT
3765 > MIME type for all files whose type they don't know.)
3766    </P
3767 ></DD
3768 ><DT
3769 >Type:</DT
3770 ><DD
3771 ><P
3772 >Multi-value.</P
3773 ></DD
3774 ><DT
3775 >Parameter:</DT
3776 ><DD
3777 ><P
3778 >    The name of a content filter, as defined in the <A
3779 HREF="filter-file.html"
3780 >filter file</A
3781 >.
3782     Filters can be defined in one or more  files as defined by the
3783     <TT
3784 CLASS="LITERAL"
3785 ><A
3786 HREF="config.html#FILTERFILE"
3787 >filterfile</A
3788 ></TT
3789 >
3790     option in the <A
3791 HREF="config.html"
3792 >config file</A
3793 >.
3794     <TT
3795 CLASS="FILENAME"
3796 >default.filter</TT
3797 > is the collection of filters
3798     supplied by the developers. Locally defined filters should go
3799     in their own file, such as <TT
3800 CLASS="FILENAME"
3801 >user.filter</TT
3802 >.
3803    </P
3804 ><P
3805 >     When used in its negative form,
3806      and without parameters, <SPAN
3807 CLASS="emphasis"
3808 ><I
3809 CLASS="EMPHASIS"
3810 >all</I
3811 ></SPAN
3812 > filtering is completely disabled.
3813   </P
3814 ></DD
3815 ><DT
3816 >Notes:</DT
3817 ><DD
3818 ><P
3819 >    For your convenience, there are a number of pre-defined filters available
3820     in the distribution filter file that you can use. See the examples below for
3821     a list.
3822    </P
3823 ><P
3824 >    Filtering requires buffering the page content, which may appear to
3825     slow down page rendering since nothing is displayed until all content has
3826     passed the filters. (The total time until the page is completely rendered
3827     doesn't change much, but it may be perceived as slower since the page is
3828     not incrementally displayed.)
3829     This effect will be more noticeable on slower connections.
3830    </P
3831 ><P
3832 >   <SPAN
3833 CLASS="QUOTE"
3834 >"Rolling your own"</SPAN
3835 >
3836     filters requires a knowledge of
3837      <A
3838 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
3839 TARGET="_top"
3840 ><SPAN
3841 CLASS="QUOTE"
3842 >"Regular
3843      Expressions"</SPAN
3844 ></A
3845 > and
3846       <A
3847 HREF="http://en.wikipedia.org/wiki/Html"
3848 TARGET="_top"
3849 ><SPAN
3850 CLASS="QUOTE"
3851 >"HTML"</SPAN
3852 ></A
3853 >.
3854     This is very powerful feature, and potentially very intrusive.
3855     Filters should be used with caution, and where an equivalent
3856     <SPAN
3857 CLASS="QUOTE"
3858 >"action"</SPAN
3859 > is not available.
3860    </P
3861 ><P
3862 >    The amount of data that can be filtered is limited to the
3863     <TT
3864 CLASS="LITERAL"
3865 ><A
3866 HREF="config.html#BUFFER-LIMIT"
3867 >buffer-limit</A
3868 ></TT
3869 >
3870     option in the main <A
3871 HREF="config.html"
3872 >config file</A
3873 >. The
3874     default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
3875     data, and all pending data, is passed through unfiltered.
3876    </P
3877 ><P
3878 >    Inappropriate MIME types, such as zipped files, are not filtered at all.
3879     (Again, only text-based types except plain text). Encrypted SSL data
3880     (from HTTPS servers) cannot be filtered either, since this would violate
3881     the integrity of the secure transaction. In some situations it might
3882     be necessary to protect certain text, like source code, from filtering
3883     by defining appropriate <TT
3884 CLASS="LITERAL"
3885 >-filter</TT
3886 > exceptions.
3887    </P
3888 ><P
3889 >    Compressed content can't be filtered either, but if <SPAN
3890 CLASS="APPLICATION"
3891 >Privoxy</SPAN
3892 >
3893     is compiled with zlib support and a supported compression algorithm
3894     is used (gzip or deflate), <SPAN
3895 CLASS="APPLICATION"
3896 >Privoxy</SPAN
3897 > can first decompress the content
3898     and then filter it.
3899    </P
3900 ><P
3901 >    If you use a <SPAN
3902 CLASS="APPLICATION"
3903 >Privoxy</SPAN
3904 > version without zlib support, but want filtering to work on
3905     as much documents as possible, even those that would normally be sent compressed,
3906     you must use the <TT
3907 CLASS="LITERAL"
3908 ><A
3909 HREF="actions-file.html#PREVENT-COMPRESSION"
3910 >prevent-compression</A
3911 ></TT
3912 >
3913     action in conjunction with <TT
3914 CLASS="LITERAL"
3915 >filter</TT
3916 >.
3917    </P
3918 ><P
3919 >    Content filtering can achieve some of the same effects as the
3920     <TT
3921 CLASS="LITERAL"
3922 ><A
3923 HREF="actions-file.html#BLOCK"
3924 >block</A
3925 ></TT
3926 >
3927     action, i.e. it can be used to block ads and banners. But the mechanism
3928     works quite differently. One effective use, is to block ad banners
3929     based on their size (see below), since many of these seem to be somewhat
3930     standardized.
3931    </P
3932 ><P
3933 >    <A
3934 HREF="contact.html"
3935 >Feedback</A
3936 > with suggestions for new or
3937     improved filters is particularly welcome!
3938    </P
3939 ><P
3940 >    The below list has only the names and a one-line description of each
3941     predefined filter. There are <A
3942 HREF="filter-file.html#PREDEFINED-FILTERS"
3943 >more
3944     verbose explanations</A
3945 > of what these filters do in the <A
3946 HREF="filter-file.html"
3947 >filter file chapter</A
3948 >.
3949    </P
3950 ></DD
3951 ><DT
3952 >Example usage (with filters from the distribution <TT
3953 CLASS="FILENAME"
3954 >default.filter</TT
3955 > file).
3956   See <A
3957 HREF="filter-file.html#PREDEFINED-FILTERS"
3958 >the Predefined Filters section</A
3959 > for
3960   more explanation on each:</DT
3961 ><DD
3962 ><P
3963 >    <A
3964 NAME="FILTER-JS-ANNOYANCES"
3965 ></A
3966 >
3967    </P
3968 ><TABLE
3969 BORDER="0"
3970 BGCOLOR="#E0E0E0"
3971 WIDTH="90%"
3972 ><TR
3973 ><TD
3974 ><PRE
3975 CLASS="SCREEN"
3976 >+filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.</PRE
3977 ></TD
3978 ></TR
3979 ></TABLE
3980 ><P
3981 >    <A
3982 NAME="FILTER-JS-EVENTS"
3983 ></A
3984 >
3985    </P
3986 ><TABLE
3987 BORDER="0"
3988 BGCOLOR="#E0E0E0"
3989 WIDTH="90%"
3990 ><TR
3991 ><TD
3992 ><PRE
3993 CLASS="SCREEN"
3994 >+filter{js-events}           # Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites).</PRE
3995 ></TD
3996 ></TR
3997 ></TABLE
3998 ><P
3999 >    <A
4000 NAME="FILTER-HTML-ANNOYANCES"
4001 ></A
4002 >
4003    </P
4004 ><TABLE
4005 BORDER="0"
4006 BGCOLOR="#E0E0E0"
4007 WIDTH="90%"
4008 ><TR
4009 ><TD
4010 ><PRE
4011 CLASS="SCREEN"
4012 >+filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.</PRE
4013 ></TD
4014 ></TR
4015 ></TABLE
4016 ><P
4017 >    <A
4018 NAME="FILTER-CONTENT-COOKIES"
4019 ></A
4020 >
4021    </P
4022 ><TABLE
4023 BORDER="0"
4024 BGCOLOR="#E0E0E0"
4025 WIDTH="90%"
4026 ><TR
4027 ><TD
4028 ><PRE
4029 CLASS="SCREEN"
4030 >+filter{content-cookies}     # Kill cookies that come in the HTML or JS content.</PRE
4031 ></TD
4032 ></TR
4033 ></TABLE
4034 ><P
4035 >    <A
4036 NAME="FILTER-REFRESH-TAGS"
4037 ></A
4038 >
4039    </P
4040 ><TABLE
4041 BORDER="0"
4042 BGCOLOR="#E0E0E0"
4043 WIDTH="90%"
4044 ><TR
4045 ><TD
4046 ><PRE
4047 CLASS="SCREEN"
4048 >+filter{refresh-tags}        # Kill automatic refresh tags if refresh time is larger than 9 seconds.</PRE
4049 ></TD
4050 ></TR
4051 ></TABLE
4052 ><P
4053 >    <A
4054 NAME="FILTER-UNSOLICITED-POPUPS"
4055 ></A
4056 >
4057    </P
4058 ><TABLE
4059 BORDER="0"
4060 BGCOLOR="#E0E0E0"
4061 WIDTH="90%"
4062 ><TR
4063 ><TD
4064 ><PRE
4065 CLASS="SCREEN"
4066 >+filter{unsolicited-popups}  # Disable only unsolicited pop-up windows.</PRE
4067 ></TD
4068 ></TR
4069 ></TABLE
4070 ><P
4071 >    <A
4072 NAME="FILTER-ALL-POPUPS"
4073 ></A
4074 >
4075    </P
4076 ><TABLE
4077 BORDER="0"
4078 BGCOLOR="#E0E0E0"
4079 WIDTH="90%"
4080 ><TR
4081 ><TD
4082 ><PRE
4083 CLASS="SCREEN"
4084 >+filter{all-popups}          # Kill all popups in JavaScript and HTML.</PRE
4085 ></TD
4086 ></TR
4087 ></TABLE
4088 ><P
4089 >    <A
4090 NAME="FILTER-IMG-REORDER"
4091 ></A
4092 >
4093    </P
4094 ><TABLE
4095 BORDER="0"
4096 BGCOLOR="#E0E0E0"
4097 WIDTH="90%"
4098 ><TR
4099 ><TD
4100 ><PRE
4101 CLASS="SCREEN"
4102 >+filter{img-reorder}         # Reorder attributes in &#60;img&#62; tags to make the banners-by-* filters more effective.</PRE
4103 ></TD
4104 ></TR
4105 ></TABLE
4106 ><P
4107 >    <A
4108 NAME="FILTER-BANNERS-BY-SIZE"
4109 ></A
4110 >
4111    </P
4112 ><TABLE
4113 BORDER="0"
4114 BGCOLOR="#E0E0E0"
4115 WIDTH="90%"
4116 ><TR
4117 ><TD
4118 ><PRE
4119 CLASS="SCREEN"
4120 >+filter{banners-by-size}     # Kill banners by size.</PRE
4121 ></TD
4122 ></TR
4123 ></TABLE
4124 ><P
4125 >    <A
4126 NAME="FILTER-BANNERS-BY-LINK"
4127 ></A
4128 >
4129    </P
4130 ><TABLE
4131 BORDER="0"
4132 BGCOLOR="#E0E0E0"
4133 WIDTH="90%"
4134 ><TR
4135 ><TD
4136 ><PRE
4137 CLASS="SCREEN"
4138 >+filter{banners-by-link}     # Kill banners by their links to known clicktrackers.</PRE
4139 ></TD
4140 ></TR
4141 ></TABLE
4142 ><P
4143 >    <A
4144 NAME="FILTER-WEBBUGS"
4145 ></A
4146 >
4147    </P
4148 ><TABLE
4149 BORDER="0"
4150 BGCOLOR="#E0E0E0"
4151 WIDTH="90%"
4152 ><TR
4153 ><TD
4154 ><PRE
4155 CLASS="SCREEN"
4156 >+filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).</PRE
4157 ></TD
4158 ></TR
4159 ></TABLE
4160 ><P
4161 >    <A
4162 NAME="FILTER-TINY-TEXTFORMS"
4163 ></A
4164 >
4165    </P
4166 ><TABLE
4167 BORDER="0"
4168 BGCOLOR="#E0E0E0"
4169 WIDTH="90%"
4170 ><TR
4171 ><TD
4172 ><PRE
4173 CLASS="SCREEN"
4174 >+filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.</PRE
4175 ></TD
4176 ></TR
4177 ></TABLE
4178 ><P
4179 >    <A
4180 NAME="FILTER-JUMPING-WINDOWS"
4181 ></A
4182 >
4183    </P
4184 ><TABLE
4185 BORDER="0"
4186 BGCOLOR="#E0E0E0"
4187 WIDTH="90%"
4188 ><TR
4189 ><TD
4190 ><PRE
4191 CLASS="SCREEN"
4192 >+filter{jumping-windows}     # Prevent windows from resizing and moving themselves.</PRE
4193 ></TD
4194 ></TR
4195 ></TABLE
4196 ><P
4197 >    <A
4198 NAME="FILTER-FRAMESET-BORDERS"
4199 ></A
4200 >
4201    </P
4202 ><TABLE
4203 BORDER="0"
4204 BGCOLOR="#E0E0E0"
4205 WIDTH="90%"
4206 ><TR
4207 ><TD
4208 ><PRE
4209 CLASS="SCREEN"
4210 >+filter{frameset-borders}    # Give frames a border and make them resizable.</PRE
4211 ></TD
4212 ></TR
4213 ></TABLE
4214 ><P
4215 >    <A
4216 NAME="FILTER-IFRAMES"
4217 ></A
4218 >
4219    </P
4220 ><TABLE
4221 BORDER="0"
4222 BGCOLOR="#E0E0E0"
4223 WIDTH="90%"
4224 ><TR
4225 ><TD
4226 ><PRE
4227 CLASS="SCREEN"
4228 >+filter{iframes}             # Removes all detected iframes. Should only be enabled for individual sites.</PRE
4229 ></TD
4230 ></TR
4231 ></TABLE
4232 ><P
4233 >    <A
4234 NAME="FILTER-DEMORONIZER"
4235 ></A
4236 >
4237    </P
4238 ><TABLE
4239 BORDER="0"
4240 BGCOLOR="#E0E0E0"
4241 WIDTH="90%"
4242 ><TR
4243 ><TD
4244 ><PRE
4245 CLASS="SCREEN"
4246 >+filter{demoronizer}         # Fix MS's non-standard use of standard charsets.</PRE
4247 ></TD
4248 ></TR
4249 ></TABLE
4250 ><P
4251 >    <A
4252 NAME="FILTER-SHOCKWAVE-FLASH"
4253 ></A
4254 >
4255    </P
4256 ><TABLE
4257 BORDER="0"
4258 BGCOLOR="#E0E0E0"
4259 WIDTH="90%"
4260 ><TR
4261 ><TD
4262 ><PRE
4263 CLASS="SCREEN"
4264 >+filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.</PRE
4265 ></TD
4266 ></TR
4267 ></TABLE
4268 ><P
4269 >    <A
4270 NAME="FILTER-QUICKTIME-KIOSKMODE"
4271 ></A
4272 >
4273    </P
4274 ><TABLE
4275 BORDER="0"
4276 BGCOLOR="#E0E0E0"
4277 WIDTH="90%"
4278 ><TR
4279 ><TD
4280 ><PRE
4281 CLASS="SCREEN"
4282 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable.</PRE
4283 ></TD
4284 ></TR
4285 ></TABLE
4286 ><P
4287 >    <A
4288 NAME="FILTER-FUN"
4289 ></A
4290 >
4291    </P
4292 ><TABLE
4293 BORDER="0"
4294 BGCOLOR="#E0E0E0"
4295 WIDTH="90%"
4296 ><TR
4297 ><TD
4298 ><PRE
4299 CLASS="SCREEN"
4300 >+filter{fun}                 # Text replacements for subversive browsing fun!</PRE
4301 ></TD
4302 ></TR
4303 ></TABLE
4304 ><P
4305 >    <A
4306 NAME="FILTER-CRUDE-PARENTAL"
4307 ></A
4308 >
4309    </P
4310 ><TABLE
4311 BORDER="0"
4312 BGCOLOR="#E0E0E0"
4313 WIDTH="90%"
4314 ><TR
4315 ><TD
4316 ><PRE
4317 CLASS="SCREEN"
4318 >+filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.</PRE
4319 ></TD
4320 ></TR
4321 ></TABLE
4322 ><P
4323 >    <A
4324 NAME="FILTER-IE-EXPLOITS"
4325 ></A
4326 >
4327    </P
4328 ><TABLE
4329 BORDER="0"
4330 BGCOLOR="#E0E0E0"
4331 WIDTH="90%"
4332 ><TR
4333 ><TD
4334 ><PRE
4335 CLASS="SCREEN"
4336 >+filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.</PRE
4337 ></TD
4338 ></TR
4339 ></TABLE
4340 ><P
4341 >    <A
4342 NAME="FILTER-SITE-SPECIFICS"
4343 ></A
4344 >
4345    </P
4346 ><TABLE
4347 BORDER="0"
4348 BGCOLOR="#E0E0E0"
4349 WIDTH="90%"
4350 ><TR
4351 ><TD
4352 ><PRE
4353 CLASS="SCREEN"
4354 >+filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!</PRE
4355 ></TD
4356 ></TR
4357 ></TABLE
4358 ><P
4359 >    <A
4360 NAME="FILTER-NO-PING"
4361 ></A
4362 >
4363    </P
4364 ><TABLE
4365 BORDER="0"
4366 BGCOLOR="#E0E0E0"
4367 WIDTH="90%"
4368 ><TR
4369 ><TD
4370 ><PRE
4371 CLASS="SCREEN"
4372 >+filter{no-ping}             # Removes non-standard ping attributes in &#60;a&#62; and &#60;area&#62; tags.</PRE
4373 ></TD
4374 ></TR
4375 ></TABLE
4376 ><P
4377 >    <A
4378 NAME="FILTER-GOOGLE"
4379 ></A
4380 >
4381    </P
4382 ><TABLE
4383 BORDER="0"
4384 BGCOLOR="#E0E0E0"
4385 WIDTH="90%"
4386 ><TR
4387 ><TD
4388 ><PRE
4389 CLASS="SCREEN"
4390 >+filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</PRE
4391 ></TD
4392 ></TR
4393 ></TABLE
4394 ><P
4395 >    <A
4396 NAME="FILTER-YAHOO"
4397 ></A
4398 >
4399    </P
4400 ><TABLE
4401 BORDER="0"
4402 BGCOLOR="#E0E0E0"
4403 WIDTH="90%"
4404 ><TR
4405 ><TD
4406 ><PRE
4407 CLASS="SCREEN"
4408 >+filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.</PRE
4409 ></TD
4410 ></TR
4411 ></TABLE
4412 ><P
4413 >    <A
4414 NAME="FILTER-MSN"
4415 ></A
4416 >
4417    </P
4418 ><TABLE
4419 BORDER="0"
4420 BGCOLOR="#E0E0E0"
4421 WIDTH="90%"
4422 ><TR
4423 ><TD
4424 ><PRE
4425 CLASS="SCREEN"
4426 >+filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</PRE
4427 ></TD
4428 ></TR
4429 ></TABLE
4430 ><P
4431 >    <A
4432 NAME="FILTER-BLOGSPOT"
4433 ></A
4434 >
4435    </P
4436 ><TABLE
4437 BORDER="0"
4438 BGCOLOR="#E0E0E0"
4439 WIDTH="90%"
4440 ><TR
4441 ><TD
4442 ><PRE
4443 CLASS="SCREEN"
4444 >+filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.</PRE
4445 ></TD
4446 ></TR
4447 ></TABLE
4448 ></DD
4449 ></DL
4450 ></DIV
4451 ></DIV
4452 ><DIV
4453 CLASS="SECT3"
4454 ><H4
4455 CLASS="SECT3"
4456 ><A
4457 NAME="FORCE-TEXT-MODE"
4458 >8.5.17. force-text-mode</A
4459 ></H4
4460 ><P
4461 ></P
4462 ><DIV
4463 CLASS="VARIABLELIST"
4464 ><DL
4465 ><DT
4466 >Typical use:</DT
4467 ><DD
4468 ><P
4469 >Force <SPAN
4470 CLASS="APPLICATION"
4471 >Privoxy</SPAN
4472 > to treat a document as if it was in some kind of <SPAN
4473 CLASS="emphasis"
4474 ><I
4475 CLASS="EMPHASIS"
4476 >text</I
4477 ></SPAN
4478 > format.   </P
4479 ></DD
4480 ><DT
4481 >Effect:</DT
4482 ><DD
4483 ><P
4484 >    Declares a document as text, even if the <SPAN
4485 CLASS="QUOTE"
4486 >"Content-Type:"</SPAN
4487 > isn't detected as such.
4488    </P
4489 ></DD
4490 ><DT
4491 >Type:</DT
4492 ><DD
4493 ><P
4494 >Boolean.</P
4495 ></DD
4496 ><DT
4497 >Parameter:</DT
4498 ><DD
4499 ><P
4500 >    N/A
4501    </P
4502 ></DD
4503 ><DT
4504 >Notes:</DT
4505 ><DD
4506 ><P
4507 >    As explained <TT
4508 CLASS="LITERAL"
4509 ><A
4510 HREF="actions-file.html#FILTER"
4511 >above</A
4512 ></TT
4513 >,
4514     <SPAN
4515 CLASS="APPLICATION"
4516 >Privoxy</SPAN
4517 > tries to only filter files that are
4518     in some kind of text format. The same restrictions apply to
4519     <TT
4520 CLASS="LITERAL"
4521 ><A
4522 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4523 >content-type-overwrite</A
4524 ></TT
4525 >.
4526     <TT
4527 CLASS="LITERAL"
4528 >force-text-mode</TT
4529 > declares a document as text,
4530     without looking at the <SPAN
4531 CLASS="QUOTE"
4532 >"Content-Type:"</SPAN
4533 > first.
4534    </P
4535 ><DIV
4536 CLASS="WARNING"
4537 ><P
4538 ></P
4539 ><TABLE
4540 CLASS="WARNING"
4541 BORDER="1"
4542 WIDTH="90%"
4543 ><TR
4544 ><TD
4545 ALIGN="CENTER"
4546 ><B
4547 >Warning</B
4548 ></TD
4549 ></TR
4550 ><TR
4551 ><TD
4552 ALIGN="LEFT"
4553 ><P
4554 >     Think twice before activating this action. Filtering binary data
4555      with regular expressions can cause file damage.
4556     </P
4557 ></TD
4558 ></TR
4559 ></TABLE
4560 ></DIV
4561 ></DD
4562 ><DT
4563 >Example usage:</DT
4564 ><DD
4565 ><TABLE
4566 BORDER="0"
4567 BGCOLOR="#E0E0E0"
4568 WIDTH="90%"
4569 ><TR
4570 ><TD
4571 ><PRE
4572 CLASS="SCREEN"
4573 >+force-text-mode</PRE
4574 ></TD
4575 ></TR
4576 ></TABLE
4577 ></DD
4578 ></DL
4579 ></DIV
4580 ></DIV
4581 ><DIV
4582 CLASS="SECT3"
4583 ><H4
4584 CLASS="SECT3"
4585 ><A
4586 NAME="FORWARD-OVERRIDE"
4587 >8.5.18. forward-override</A
4588 ></H4
4589 ><P
4590 ></P
4591 ><DIV
4592 CLASS="VARIABLELIST"
4593 ><DL
4594 ><DT
4595 >Typical use:</DT
4596 ><DD
4597 ><P
4598 >Change the forwarding settings based on User-Agent or request origin</P
4599 ></DD
4600 ><DT
4601 >Effect:</DT
4602 ><DD
4603 ><P
4604 >    Overrules the forward directives in the configuration file.
4605    </P
4606 ></DD
4607 ><DT
4608 >Type:</DT
4609 ><DD
4610 ><P
4611 >Parameterized.</P
4612 ></DD
4613 ><DT
4614 >Parameter:</DT
4615 ><DD
4616 ><P
4617 ></P
4618 ><UL
4619 ><LI
4620 ><P
4621 ><SPAN
4622 CLASS="QUOTE"
4623 >"forward ."</SPAN
4624 > to use a direct connection without any additional proxies.</P
4625 ></LI
4626 ><LI
4627 ><P
4628 >      <SPAN
4629 CLASS="QUOTE"
4630 >"forward 127.0.0.1:8123"</SPAN
4631 > to use the HTTP proxy listening at 127.0.0.1 port 8123.
4632      </P
4633 ></LI
4634 ><LI
4635 ><P
4636 >      <SPAN
4637 CLASS="QUOTE"
4638 >"forward-socks4a 127.0.0.1:9050 ."</SPAN
4639 > to use the socks4a proxy listening at
4640       127.0.0.1 port 9050. Replace <SPAN
4641 CLASS="QUOTE"
4642 >"forward-socks4a"</SPAN
4643 > with <SPAN
4644 CLASS="QUOTE"
4645 >"forward-socks4"</SPAN
4646 >
4647       to use a socks4 connection  (with local DNS resolution) instead, use <SPAN
4648 CLASS="QUOTE"
4649 >"forward-socks5"</SPAN
4650 >
4651       for socks5 connections (with remote DNS resolution).
4652      </P
4653 ></LI
4654 ><LI
4655 ><P
4656 >      <SPAN
4657 CLASS="QUOTE"
4658 >"forward-socks4a 127.0.0.1:9050 proxy.example.org:8000"</SPAN
4659 > to use the socks4a proxy
4660       listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000.
4661       Replace <SPAN
4662 CLASS="QUOTE"
4663 >"forward-socks4a"</SPAN
4664 > with <SPAN
4665 CLASS="QUOTE"
4666 >"forward-socks4"</SPAN
4667 > to use a socks4 connection
4668       (with local DNS resolution) instead, use <SPAN
4669 CLASS="QUOTE"
4670 >"forward-socks5"</SPAN
4671 >
4672       for socks5 connections (with remote DNS resolution).
4673      </P
4674 ></LI
4675 ><LI
4676 ><P
4677 >      <SPAN
4678 CLASS="QUOTE"
4679 >"forward-webserver 127.0.0.1:80"</SPAN
4680 > to use the HTTP
4681       server listening at 127.0.0.1 port 80 without adjusting the
4682       request headers.
4683      </P
4684 ><P
4685 >      This makes it more convenient to use Privoxy to make
4686       existing websites available as onion services as well.
4687      </P
4688 ><P
4689 >      Many websites serve content with hardcoded URLs and
4690       can't be easily adjusted to change the domain based
4691       on the one used by the client.
4692      </P
4693 ><P
4694 >      Putting Privoxy between Tor and the webserver (or an stunnel
4695       that forwards to the webserver) allows to rewrite headers and
4696       content to make client and server happy at the same time.
4697      </P
4698 ><P
4699 >      Using Privoxy for webservers that are only reachable through
4700       onion addresses and whose location is supposed to be secret
4701       is not recommended and should not be necessary anyway.
4702      </P
4703 ></LI
4704 ></UL
4705 ></DD
4706 ><DT
4707 >Notes:</DT
4708 ><DD
4709 ><P
4710 >    This action takes parameters similar to the
4711     <A
4712 HREF="config.html#FORWARDING"
4713 >forward</A
4714 > directives in the configuration
4715     file, but without the URL pattern. It can be used as replacement, but normally it's only
4716     used in cases where matching based on the request URL isn't sufficient.
4717    </P
4718 ><DIV
4719 CLASS="WARNING"
4720 ><P
4721 ></P
4722 ><TABLE
4723 CLASS="WARNING"
4724 BORDER="1"
4725 WIDTH="90%"
4726 ><TR
4727 ><TD
4728 ALIGN="CENTER"
4729 ><B
4730 >Warning</B
4731 ></TD
4732 ></TR
4733 ><TR
4734 ><TD
4735 ALIGN="LEFT"
4736 ><P
4737 >     Please read the description for the <A
4738 HREF="config.html#FORWARDING"
4739 >forward</A
4740 > directives before
4741      using this action. Forwarding to the wrong people will reduce your privacy and increase the
4742      chances of man-in-the-middle attacks.
4743     </P
4744 ><P
4745 >     If the ports are missing or invalid, default values will be used. This might change
4746      in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy
4747      to exit. Due to design limitations, invalid parameter syntax isn't detected until the
4748      action is used the first time.
4749     </P
4750 ><P
4751 >     Use the <A
4752 HREF="http://config.privoxy.org/show-url-info"
4753 TARGET="_top"
4754 >show-url-info CGI page</A
4755 >
4756      to verify that your forward settings do what you thought the do.
4757     </P
4758 ></TD
4759 ></TR
4760 ></TABLE
4761 ></DIV
4762 ></DD
4763 ><DT
4764 >Example usage:</DT
4765 ><DD
4766 ><TABLE
4767 BORDER="0"
4768 BGCOLOR="#E0E0E0"
4769 WIDTH="90%"
4770 ><TR
4771 ><TD
4772 ><PRE
4773 CLASS="SCREEN"
4774 ># Use an ssh tunnel for requests previously tagged as
4775 # <SPAN
4776 CLASS="QUOTE"
4777 >"User-Agent: fetch libfetch/2.0"</SPAN
4778 > and make sure
4779 # resuming downloads continues to work.
4780 #
4781 # This way you can continue to use Tor for your normal browsing,
4782 # without overloading the Tor network with your FreeBSD ports updates
4783 # or downloads of bigger files like ISOs.
4784 #
4785 # Note that HTTP headers are easy to fake and therefore their
4786 # values are as (un)trustworthy as your clients and users.
4787 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
4788  -hide-if-modified-since      \
4789  -overwrite-last-modified     \
4790 }
4791 TAG:^User-Agent: fetch libfetch/2\.0$</PRE
4792 ></TD
4793 ></TR
4794 ></TABLE
4795 ></DD
4796 ></DL
4797 ></DIV
4798 ></DIV
4799 ><DIV
4800 CLASS="SECT3"
4801 ><H4
4802 CLASS="SECT3"
4803 ><A
4804 NAME="HANDLE-AS-EMPTY-DOCUMENT"
4805 >8.5.19. handle-as-empty-document</A
4806 ></H4
4807 ><P
4808 ></P
4809 ><DIV
4810 CLASS="VARIABLELIST"
4811 ><DL
4812 ><DT
4813 >Typical use:</DT
4814 ><DD
4815 ><P
4816 >Mark URLs that should be replaced by empty documents <SPAN
4817 CLASS="emphasis"
4818 ><I
4819 CLASS="EMPHASIS"
4820 >if they get blocked</I
4821 ></SPAN
4822 ></P
4823 ></DD
4824 ><DT
4825 >Effect:</DT
4826 ><DD
4827 ><P
4828 >    This action alone doesn't do anything noticeable. It just marks URLs.
4829     If the <TT
4830 CLASS="LITERAL"
4831 ><A
4832 HREF="actions-file.html#BLOCK"
4833 >block</A
4834 ></TT
4835 > action <SPAN
4836 CLASS="emphasis"
4837 ><I
4838 CLASS="EMPHASIS"
4839 >also applies</I
4840 ></SPAN
4841 >,
4842     the presence or absence of this mark decides whether an HTML <SPAN
4843 CLASS="QUOTE"
4844 >"BLOCKED"</SPAN
4845 >
4846     page, or an empty document will be sent to the client as a substitute for the blocked content.
4847     The <SPAN
4848 CLASS="emphasis"
4849 ><I
4850 CLASS="EMPHASIS"
4851 >empty</I
4852 ></SPAN
4853 > document isn't literally empty, but actually contains a single space.
4854    </P
4855 ></DD
4856 ><DT
4857 >Type:</DT
4858 ><DD
4859 ><P
4860 >Boolean.</P
4861 ></DD
4862 ><DT
4863 >Parameter:</DT
4864 ><DD
4865 ><P
4866 >    N/A
4867    </P
4868 ></DD
4869 ><DT
4870 >Notes:</DT
4871 ><DD
4872 ><P
4873 >    Some browsers complain about syntax errors if JavaScript documents
4874     are blocked with <SPAN
4875 CLASS="APPLICATION"
4876 >Privoxy's</SPAN
4877 >
4878     default HTML page; this option can be used to silence them.
4879     And of course this action can also be used to eliminate the <SPAN
4880 CLASS="APPLICATION"
4881 >Privoxy</SPAN
4882 >
4883     BLOCKED message in frames.
4884    </P
4885 ><P
4886 >    The content type for the empty document can be specified with
4887     <TT
4888 CLASS="LITERAL"
4889 ><A
4890 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4891 >content-type-overwrite{}</A
4892 ></TT
4893 >,
4894     but usually this isn't necessary.
4895    </P
4896 ></DD
4897 ><DT
4898 >Example usage:</DT
4899 ><DD
4900 ><TABLE
4901 BORDER="0"
4902 BGCOLOR="#E0E0E0"
4903 WIDTH="90%"
4904 ><TR
4905 ><TD
4906 ><PRE
4907 CLASS="SCREEN"
4908 ># Block all documents on example.org that end with ".js",
4909 # but send an empty document instead of the usual HTML message.
4910 {+block{Blocked JavaScript} +handle-as-empty-document}
4911 example.org/.*\.js$</PRE
4912 ></TD
4913 ></TR
4914 ></TABLE
4915 ></DD
4916 ></DL
4917 ></DIV
4918 ></DIV
4919 ><DIV
4920 CLASS="SECT3"
4921 ><H4
4922 CLASS="SECT3"
4923 ><A
4924 NAME="HANDLE-AS-IMAGE"
4925 >8.5.20. handle-as-image</A
4926 ></H4
4927 ><P
4928 ></P
4929 ><DIV
4930 CLASS="VARIABLELIST"
4931 ><DL
4932 ><DT
4933 >Typical use:</DT
4934 ><DD
4935 ><P
4936 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
4937 CLASS="emphasis"
4938 ><I
4939 CLASS="EMPHASIS"
4940 >if they do get blocked</I
4941 ></SPAN
4942 >, rather than HTML pages)</P
4943 ></DD
4944 ><DT
4945 >Effect:</DT
4946 ><DD
4947 ><P
4948 >    This action alone doesn't do anything noticeable. It just marks URLs as images.
4949     If the <TT
4950 CLASS="LITERAL"
4951 ><A
4952 HREF="actions-file.html#BLOCK"
4953 >block</A
4954 ></TT
4955 > action <SPAN
4956 CLASS="emphasis"
4957 ><I
4958 CLASS="EMPHASIS"
4959 >also applies</I
4960 ></SPAN
4961 >,
4962     the presence or absence of this mark decides whether an HTML <SPAN
4963 CLASS="QUOTE"
4964 >"blocked"</SPAN
4965 >
4966     page, or a replacement image (as determined by the <TT
4967 CLASS="LITERAL"
4968 ><A
4969 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4970 >set-image-blocker</A
4971 ></TT
4972 > action) will be sent to the
4973     client as a substitute for the blocked content.
4974    </P
4975 ></DD
4976 ><DT
4977 >Type:</DT
4978 ><DD
4979 ><P
4980 >Boolean.</P
4981 ></DD
4982 ><DT
4983 >Parameter:</DT
4984 ><DD
4985 ><P
4986 >    N/A
4987    </P
4988 ></DD
4989 ><DT
4990 >Notes:</DT
4991 ><DD
4992 ><P
4993 >    The below generic example section is actually part of <TT
4994 CLASS="FILENAME"
4995 >default.action</TT
4996 >.
4997     It marks all URLs with well-known image file name extensions as images and should
4998     be left intact.
4999    </P
5000 ><P
5001 >    Users will probably only want to use the handle-as-image action in conjunction with
5002     <TT
5003 CLASS="LITERAL"
5004 ><A
5005 HREF="actions-file.html#BLOCK"
5006 >block</A
5007 ></TT
5008 >, to block sources of banners, whose URLs don't
5009     reflect the file type, like in the second example section.
5010    </P
5011 ><P
5012 >    Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
5013     frames require an HTML page to be sent, or they won't display properly.
5014     Forcing <TT
5015 CLASS="LITERAL"
5016 >handle-as-image</TT
5017 > in this situation will not replace the
5018     ad frame with an image, but lead to error messages.
5019    </P
5020 ></DD
5021 ><DT
5022 >Example usage (sections):</DT
5023 ><DD
5024 ><TABLE
5025 BORDER="0"
5026 BGCOLOR="#E0E0E0"
5027 WIDTH="90%"
5028 ><TR
5029 ><TD
5030 ><PRE
5031 CLASS="SCREEN"
5032 ># Generic image extensions:
5033 #
5034 {+handle-as-image}
5035 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
5036
5037 # These don't look like images, but they're banners and should be
5038 # blocked as images:
5039 #
5040 {+block{Nasty banners.} +handle-as-image}
5041 nasty-banner-server.example.com/junk.cgi\?output=trash</PRE
5042 ></TD
5043 ></TR
5044 ></TABLE
5045 ></DD
5046 ></DL
5047 ></DIV
5048 ></DIV
5049 ><DIV
5050 CLASS="SECT3"
5051 ><H4
5052 CLASS="SECT3"
5053 ><A
5054 NAME="HIDE-ACCEPT-LANGUAGE"
5055 >8.5.21. hide-accept-language</A
5056 ></H4
5057 ><P
5058 ></P
5059 ><DIV
5060 CLASS="VARIABLELIST"
5061 ><DL
5062 ><DT
5063 >Typical use:</DT
5064 ><DD
5065 ><P
5066 >Pretend to use different language settings.</P
5067 ></DD
5068 ><DT
5069 >Effect:</DT
5070 ><DD
5071 ><P
5072 >    Deletes or replaces the <SPAN
5073 CLASS="QUOTE"
5074 >"Accept-Language:"</SPAN
5075 > HTTP header in client requests.
5076    </P
5077 ></DD
5078 ><DT
5079 >Type:</DT
5080 ><DD
5081 ><P
5082 >Parameterized.</P
5083 ></DD
5084 ><DT
5085 >Parameter:</DT
5086 ><DD
5087 ><P
5088 >    Keyword: <SPAN
5089 CLASS="QUOTE"
5090 >"block"</SPAN
5091 >, or any user defined value.
5092    </P
5093 ></DD
5094 ><DT
5095 >Notes:</DT
5096 ><DD
5097 ><P
5098 >    Faking the browser's language settings can be useful to make a
5099     foreign User-Agent set with
5100     <TT
5101 CLASS="LITERAL"
5102 ><A
5103 HREF="actions-file.html#HIDE-USER-AGENT"
5104 >hide-user-agent</A
5105 ></TT
5106 >
5107     more believable.
5108    </P
5109 ><P
5110 >    However some sites with content in different languages check the
5111     <SPAN
5112 CLASS="QUOTE"
5113 >"Accept-Language:"</SPAN
5114 > to decide which one to take by default.
5115     Sometimes it isn't possible to later switch to another language without
5116     changing the <SPAN
5117 CLASS="QUOTE"
5118 >"Accept-Language:"</SPAN
5119 > header first.
5120    </P
5121 ><P
5122 >    Therefore it's a good idea to either only change the
5123     <SPAN
5124 CLASS="QUOTE"
5125 >"Accept-Language:"</SPAN
5126 > header to languages you understand,
5127     or to languages that aren't wide spread.
5128    </P
5129 ><P
5130 >    Before setting the <SPAN
5131 CLASS="QUOTE"
5132 >"Accept-Language:"</SPAN
5133 > header
5134     to a rare language, you should consider that it helps to
5135     make your requests unique and thus easier to trace.
5136     If you don't plan to change this header frequently,
5137     you should stick to a common language.
5138    </P
5139 ></DD
5140 ><DT
5141 >Example usage (section):</DT
5142 ><DD
5143 ><TABLE
5144 BORDER="0"
5145 BGCOLOR="#E0E0E0"
5146 WIDTH="90%"
5147 ><TR
5148 ><TD
5149 ><PRE
5150 CLASS="SCREEN"
5151 ># Pretend to use Canadian language settings.
5152 {+hide-accept-language{en-ca} \
5153 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
5154 }
5155 /</PRE
5156 ></TD
5157 ></TR
5158 ></TABLE
5159 ></DD
5160 ></DL
5161 ></DIV
5162 ></DIV
5163 ><DIV
5164 CLASS="SECT3"
5165 ><H4
5166 CLASS="SECT3"
5167 ><A
5168 NAME="HIDE-CONTENT-DISPOSITION"
5169 >8.5.22. hide-content-disposition</A
5170 ></H4
5171 ><P
5172 ></P
5173 ><DIV
5174 CLASS="VARIABLELIST"
5175 ><DL
5176 ><DT
5177 >Typical use:</DT
5178 ><DD
5179 ><P
5180 >Prevent download menus for content you prefer to view inside the browser.</P
5181 ></DD
5182 ><DT
5183 >Effect:</DT
5184 ><DD
5185 ><P
5186 >    Deletes or replaces the <SPAN
5187 CLASS="QUOTE"
5188 >"Content-Disposition:"</SPAN
5189 > HTTP header set by some servers.
5190    </P
5191 ></DD
5192 ><DT
5193 >Type:</DT
5194 ><DD
5195 ><P
5196 >Parameterized.</P
5197 ></DD
5198 ><DT
5199 >Parameter:</DT
5200 ><DD
5201 ><P
5202 >    Keyword: <SPAN
5203 CLASS="QUOTE"
5204 >"block"</SPAN
5205 >, or any user defined value.
5206    </P
5207 ></DD
5208 ><DT
5209 >Notes:</DT
5210 ><DD
5211 ><P
5212 >    Some servers set the <SPAN
5213 CLASS="QUOTE"
5214 >"Content-Disposition:"</SPAN
5215 > HTTP header for
5216     documents they assume you want to save locally before viewing them.
5217     The <SPAN
5218 CLASS="QUOTE"
5219 >"Content-Disposition:"</SPAN
5220 > header contains the file name
5221     the browser is supposed to use by default.
5222    </P
5223 ><P
5224 >    In most browsers that understand this header, it makes it impossible to
5225     <SPAN
5226 CLASS="emphasis"
5227 ><I
5228 CLASS="EMPHASIS"
5229 >just view</I
5230 ></SPAN
5231 > the document, without downloading it first,
5232     even if it's just a simple text file or an image.
5233    </P
5234 ><P
5235 >    Removing the <SPAN
5236 CLASS="QUOTE"
5237 >"Content-Disposition:"</SPAN
5238 > header helps
5239     to prevent this annoyance, but some browsers additionally check the
5240     <SPAN
5241 CLASS="QUOTE"
5242 >"Content-Type:"</SPAN
5243 > header, before they decide if they can
5244     display a document without saving it first. In these cases, you have
5245     to change this header as well, before the browser stops displaying
5246     download menus.
5247    </P
5248 ><P
5249 >    It is also possible to change the server's file name suggestion
5250     to another one, but in most cases it isn't worth the time to set
5251     it up.
5252    </P
5253 ><P
5254 >    This action will probably be removed in the future,
5255     use server-header filters instead.
5256    </P
5257 ></DD
5258 ><DT
5259 >Example usage:</DT
5260 ><DD
5261 ><TABLE
5262 BORDER="0"
5263 BGCOLOR="#E0E0E0"
5264 WIDTH="90%"
5265 ><TR
5266 ><TD
5267 ><PRE
5268 CLASS="SCREEN"
5269 ># Disarm the download link in Sourceforge's patch tracker
5270 { -filter \
5271  +content-type-overwrite{text/plain}\
5272  +hide-content-disposition{block} }
5273  .sourceforge.net/tracker/download\.php</PRE
5274 ></TD
5275 ></TR
5276 ></TABLE
5277 ></DD
5278 ></DL
5279 ></DIV
5280 ></DIV
5281 ><DIV
5282 CLASS="SECT3"
5283 ><H4
5284 CLASS="SECT3"
5285 ><A
5286 NAME="HIDE-IF-MODIFIED-SINCE"
5287 >8.5.23. hide-if-modified-since</A
5288 ></H4
5289 ><P
5290 ></P
5291 ><DIV
5292 CLASS="VARIABLELIST"
5293 ><DL
5294 ><DT
5295 >Typical use:</DT
5296 ><DD
5297 ><P
5298 >Prevent yet another way to track the user's steps between sessions.</P
5299 ></DD
5300 ><DT
5301 >Effect:</DT
5302 ><DD
5303 ><P
5304 >    Deletes the <SPAN
5305 CLASS="QUOTE"
5306 >"If-Modified-Since:"</SPAN
5307 > HTTP client header or modifies its value.
5308    </P
5309 ></DD
5310 ><DT
5311 >Type:</DT
5312 ><DD
5313 ><P
5314 >Parameterized.</P
5315 ></DD
5316 ><DT
5317 >Parameter:</DT
5318 ><DD
5319 ><P
5320 >    Keyword: <SPAN
5321 CLASS="QUOTE"
5322 >"block"</SPAN
5323 >, or a user defined value that specifies a range of hours.
5324    </P
5325 ></DD
5326 ><DT
5327 >Notes:</DT
5328 ><DD
5329 ><P
5330 >    Removing this header is useful for filter testing, where you want to force a real
5331     reload instead of getting status code <SPAN
5332 CLASS="QUOTE"
5333 >"304"</SPAN
5334 >, which would cause the
5335     browser to use a cached copy of the page.
5336    </P
5337 ><P
5338 >    Instead of removing the header, <TT
5339 CLASS="LITERAL"
5340 >hide-if-modified-since</TT
5341 > can
5342     also add or subtract a random amount of time to/from the header's value.
5343     You specify a range of minutes where the random factor should be chosen from and
5344     <SPAN
5345 CLASS="APPLICATION"
5346 >Privoxy</SPAN
5347 > does the rest. A negative value means
5348     subtracting, a positive value adding.
5349    </P
5350 ><P
5351 >    Randomizing the value of the <SPAN
5352 CLASS="QUOTE"
5353 >"If-Modified-Since:"</SPAN
5354 > makes
5355     it less likely that the server can use the time as a cookie replacement,
5356     but you will run into caching problems if the random range is too high.
5357    </P
5358 ><P
5359 >    It is a good idea to only use a small negative value and let
5360     <TT
5361 CLASS="LITERAL"
5362 ><A
5363 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
5364 >overwrite-last-modified</A
5365 ></TT
5366 >
5367     handle the greater changes.
5368    </P
5369 ><P
5370 >    It is also recommended to use this action together with
5371     <TT
5372 CLASS="LITERAL"
5373 ><A
5374 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5375 >crunch-if-none-match</A
5376 ></TT
5377 >,
5378     otherwise it's more or less pointless.
5379    </P
5380 ></DD
5381 ><DT
5382 >Example usage (section):</DT
5383 ><DD
5384 ><TABLE
5385 BORDER="0"
5386 BGCOLOR="#E0E0E0"
5387 WIDTH="90%"
5388 ><TR
5389 ><TD
5390 ><PRE
5391 CLASS="SCREEN"
5392 ># Let the browser revalidate but make tracking based on the time less likely.
5393 {+hide-if-modified-since{-60} \
5394  +overwrite-last-modified{randomize} \
5395  +crunch-if-none-match}
5396 /</PRE
5397 ></TD
5398 ></TR
5399 ></TABLE
5400 ></DD
5401 ></DL
5402 ></DIV
5403 ></DIV
5404 ><DIV
5405 CLASS="SECT3"
5406 ><H4
5407 CLASS="SECT3"
5408 ><A
5409 NAME="HIDE-FROM-HEADER"
5410 >8.5.24. hide-from-header</A
5411 ></H4
5412 ><P
5413 ></P
5414 ><DIV
5415 CLASS="VARIABLELIST"
5416 ><DL
5417 ><DT
5418 >Typical use:</DT
5419 ><DD
5420 ><P
5421 >Keep your (old and ill) browser from telling web servers your email address</P
5422 ></DD
5423 ><DT
5424 >Effect:</DT
5425 ><DD
5426 ><P
5427 >    Deletes any existing <SPAN
5428 CLASS="QUOTE"
5429 >"From:"</SPAN
5430 > HTTP header, or replaces it with the
5431     specified string.
5432    </P
5433 ></DD
5434 ><DT
5435 >Type:</DT
5436 ><DD
5437 ><P
5438 >Parameterized.</P
5439 ></DD
5440 ><DT
5441 >Parameter:</DT
5442 ><DD
5443 ><P
5444 >    Keyword: <SPAN
5445 CLASS="QUOTE"
5446 >"block"</SPAN
5447 >, or any user defined value.
5448    </P
5449 ></DD
5450 ><DT
5451 >Notes:</DT
5452 ><DD
5453 ><P
5454 >    The keyword <SPAN
5455 CLASS="QUOTE"
5456 >"block"</SPAN
5457 > will completely remove the header
5458     (not to be confused with the <TT
5459 CLASS="LITERAL"
5460 ><A
5461 HREF="actions-file.html#BLOCK"
5462 >block</A
5463 ></TT
5464 >
5465     action).
5466    </P
5467 ><P
5468 >    Alternately, you can specify any value you prefer to be sent to the web
5469     server. If you do, it is a matter of fairness not to use any address that
5470     is actually used by a real person.
5471    </P
5472 ><P
5473 >    This action is rarely needed, as modern web browsers don't send
5474     <SPAN
5475 CLASS="QUOTE"
5476 >"From:"</SPAN
5477 > headers anymore.
5478    </P
5479 ></DD
5480 ><DT
5481 >Example usage:</DT
5482 ><DD
5483 ><TABLE
5484 BORDER="0"
5485 BGCOLOR="#E0E0E0"
5486 WIDTH="90%"
5487 ><TR
5488 ><TD
5489 ><PRE
5490 CLASS="SCREEN"
5491 >+hide-from-header{block}</PRE
5492 ></TD
5493 ></TR
5494 ></TABLE
5495 ><P
5496 >or</P
5497 ><TABLE
5498 BORDER="0"
5499 BGCOLOR="#E0E0E0"
5500 WIDTH="90%"
5501 ><TR
5502 ><TD
5503 ><PRE
5504 CLASS="SCREEN"
5505 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
5506 ></TD
5507 ></TR
5508 ></TABLE
5509 ></DD
5510 ></DL
5511 ></DIV
5512 ></DIV
5513 ><DIV
5514 CLASS="SECT3"
5515 ><H4
5516 CLASS="SECT3"
5517 ><A
5518 NAME="HIDE-REFERRER"
5519 >8.5.25. hide-referrer</A
5520 ></H4
5521 ><A
5522 NAME="HIDE-REFERER"
5523 ></A
5524 ><P
5525 ></P
5526 ><DIV
5527 CLASS="VARIABLELIST"
5528 ><DL
5529 ><DT
5530 >Typical use:</DT
5531 ><DD
5532 ><P
5533 >Conceal which link you followed to get to a particular site</P
5534 ></DD
5535 ><DT
5536 >Effect:</DT
5537 ><DD
5538 ><P
5539 >    Deletes the <SPAN
5540 CLASS="QUOTE"
5541 >"Referer:"</SPAN
5542 > (sic) HTTP header from the client request,
5543     or replaces it with a forged one.
5544    </P
5545 ></DD
5546 ><DT
5547 >Type:</DT
5548 ><DD
5549 ><P
5550 >Parameterized.</P
5551 ></DD
5552 ><DT
5553 >Parameter:</DT
5554 ><DD
5555 ><P
5556 ></P
5557 ><UL
5558 ><LI
5559 ><P
5560 ><SPAN
5561 CLASS="QUOTE"
5562 >"conditional-block"</SPAN
5563 > to delete the header completely if the host has changed.</P
5564 ></LI
5565 ><LI
5566 ><P
5567 ><SPAN
5568 CLASS="QUOTE"
5569 >"conditional-forge"</SPAN
5570 > to forge the header if the host has changed.</P
5571 ></LI
5572 ><LI
5573 ><P
5574 ><SPAN
5575 CLASS="QUOTE"
5576 >"block"</SPAN
5577 > to delete the header unconditionally.</P
5578 ></LI
5579 ><LI
5580 ><P
5581 ><SPAN
5582 CLASS="QUOTE"
5583 >"forge"</SPAN
5584 > to pretend to be coming from the homepage of the server we are talking to.</P
5585 ></LI
5586 ><LI
5587 ><P
5588 >Any other string to set a user defined referrer.</P
5589 ></LI
5590 ></UL
5591 ></DD
5592 ><DT
5593 >Notes:</DT
5594 ><DD
5595 ><P
5596 >    <TT
5597 CLASS="LITERAL"
5598 >conditional-block</TT
5599 > is the only parameter,
5600     that isn't easily detected in the server's log file. If it blocks the
5601     referrer, the request will look like the visitor used a bookmark or
5602     typed in the address directly.
5603    </P
5604 ><P
5605 >    Leaving the referrer unmodified for requests on the same host
5606     allows the server owner to see the visitor's <SPAN
5607 CLASS="QUOTE"
5608 >"click path"</SPAN
5609 >,
5610     but in most cases she could also get that information by comparing
5611     other parts of the log file: for example the User-Agent if it isn't
5612     a very common one, or the user's IP address if it doesn't change between
5613     different requests.
5614    </P
5615 ><P
5616 >    Always blocking the referrer, or using a custom one, can lead to
5617     failures on servers that check the referrer before they answer any
5618     requests, in an attempt to prevent their content from being
5619     embedded or linked to elsewhere.
5620    </P
5621 ><P
5622 >    Both <TT
5623 CLASS="LITERAL"
5624 >conditional-block</TT
5625 > and <TT
5626 CLASS="LITERAL"
5627 >forge</TT
5628 >
5629     will work with referrer checks, as long as content and valid referring page
5630     are on the same host. Most of the time that's the case.
5631    </P
5632 ><P
5633 >    <TT
5634 CLASS="LITERAL"
5635 >hide-referer</TT
5636 > is an alternate spelling of
5637     <TT
5638 CLASS="LITERAL"
5639 >hide-referrer</TT
5640 > and the two can be can be freely
5641     substituted with each other. (<SPAN
5642 CLASS="QUOTE"
5643 >"referrer"</SPAN
5644 > is the
5645     correct English spelling, however the HTTP specification has a bug - it
5646     requires it to be spelled as <SPAN
5647 CLASS="QUOTE"
5648 >"referer"</SPAN
5649 >.)
5650    </P
5651 ></DD
5652 ><DT
5653 >Example usage:</DT
5654 ><DD
5655 ><TABLE
5656 BORDER="0"
5657 BGCOLOR="#E0E0E0"
5658 WIDTH="90%"
5659 ><TR
5660 ><TD
5661 ><PRE
5662 CLASS="SCREEN"
5663 >+hide-referrer{forge}</PRE
5664 ></TD
5665 ></TR
5666 ></TABLE
5667 ><P
5668 >or</P
5669 ><TABLE
5670 BORDER="0"
5671 BGCOLOR="#E0E0E0"
5672 WIDTH="90%"
5673 ><TR
5674 ><TD
5675 ><PRE
5676 CLASS="SCREEN"
5677 >+hide-referrer{http://www.yahoo.com/}</PRE
5678 ></TD
5679 ></TR
5680 ></TABLE
5681 ></DD
5682 ></DL
5683 ></DIV
5684 ></DIV
5685 ><DIV
5686 CLASS="SECT3"
5687 ><H4
5688 CLASS="SECT3"
5689 ><A
5690 NAME="HIDE-USER-AGENT"
5691 >8.5.26. hide-user-agent</A
5692 ></H4
5693 ><P
5694 ></P
5695 ><DIV
5696 CLASS="VARIABLELIST"
5697 ><DL
5698 ><DT
5699 >Typical use:</DT
5700 ><DD
5701 ><P
5702 >Try to conceal your type of browser and client operating system</P
5703 ></DD
5704 ><DT
5705 >Effect:</DT
5706 ><DD
5707 ><P
5708 >    Replaces the value of the <SPAN
5709 CLASS="QUOTE"
5710 >"User-Agent:"</SPAN
5711 > HTTP header
5712     in client requests with the specified value.
5713    </P
5714 ></DD
5715 ><DT
5716 >Type:</DT
5717 ><DD
5718 ><P
5719 >Parameterized.</P
5720 ></DD
5721 ><DT
5722 >Parameter:</DT
5723 ><DD
5724 ><P
5725 >    Any user-defined string.
5726    </P
5727 ></DD
5728 ><DT
5729 >Notes:</DT
5730 ><DD
5731 ><DIV
5732 CLASS="WARNING"
5733 ><P
5734 ></P
5735 ><TABLE
5736 CLASS="WARNING"
5737 BORDER="1"
5738 WIDTH="90%"
5739 ><TR
5740 ><TD
5741 ALIGN="CENTER"
5742 ><B
5743 >Warning</B
5744 ></TD
5745 ></TR
5746 ><TR
5747 ><TD
5748 ALIGN="LEFT"
5749 ><P
5750 >     This can lead to problems on web sites that depend on looking at this header in
5751      order to customize their content for different browsers (which, by the
5752      way, is <SPAN
5753 CLASS="emphasis"
5754 ><I
5755 CLASS="EMPHASIS"
5756 >NOT</I
5757 ></SPAN
5758 > the right thing to do: good web sites
5759      work browser-independently).
5760     </P
5761 ></TD
5762 ></TR
5763 ></TABLE
5764 ></DIV
5765 ><P
5766 >    Using this action in multi-user setups or wherever different types of
5767     browsers will access the same <SPAN
5768 CLASS="APPLICATION"
5769 >Privoxy</SPAN
5770 > is
5771     <SPAN
5772 CLASS="emphasis"
5773 ><I
5774 CLASS="EMPHASIS"
5775 >not recommended</I
5776 ></SPAN
5777 >. In single-user, single-browser
5778     setups, you might use it to delete your OS version information from
5779     the headers, because it is an invitation to exploit known bugs for your
5780     OS. It is also occasionally useful to forge this in order to access
5781     sites that won't let you in otherwise (though there may be a good
5782     reason in some cases).
5783    </P
5784 ><P
5785 >     More information on known user-agent strings can be found at
5786      <A
5787 HREF="http://www.user-agents.org/"
5788 TARGET="_top"
5789 >http://www.user-agents.org/</A
5790 >
5791      and
5792      <A
5793 HREF="http://en.wikipedia.org/wiki/User_agent"
5794 TARGET="_top"
5795 >http://en.wikipedia.org/wiki/User_agent</A
5796 >.
5797    </P
5798 ></DD
5799 ><DT
5800 >Example usage:</DT
5801 ><DD
5802 ><TABLE
5803 BORDER="0"
5804 BGCOLOR="#E0E0E0"
5805 WIDTH="90%"
5806 ><TR
5807 ><TD
5808 ><PRE
5809 CLASS="SCREEN"
5810 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
5811 ></TD
5812 ></TR
5813 ></TABLE
5814 ></DD
5815 ></DL
5816 ></DIV
5817 ></DIV
5818 ><DIV
5819 CLASS="SECT3"
5820 ><H4
5821 CLASS="SECT3"
5822 ><A
5823 NAME="LIMIT-CONNECT"
5824 >8.5.27. limit-connect</A
5825 ></H4
5826 ><P
5827 ></P
5828 ><DIV
5829 CLASS="VARIABLELIST"
5830 ><DL
5831 ><DT
5832 >Typical use:</DT
5833 ><DD
5834 ><P
5835 >Prevent abuse of <SPAN
5836 CLASS="APPLICATION"
5837 >Privoxy</SPAN
5838 > as a TCP proxy relay or disable SSL for untrusted sites</P
5839 ></DD
5840 ><DT
5841 >Effect:</DT
5842 ><DD
5843 ><P
5844 >    Specifies to which ports HTTP CONNECT requests are allowable.
5845    </P
5846 ></DD
5847 ><DT
5848 >Type:</DT
5849 ><DD
5850 ><P
5851 >Parameterized.</P
5852 ></DD
5853 ><DT
5854 >Parameter:</DT
5855 ><DD
5856 ><P
5857 >    A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5858     defaulting to 0 and the maximum to 65K).
5859    </P
5860 ></DD
5861 ><DT
5862 >Notes:</DT
5863 ><DD
5864 ><P
5865 >    By default, i.e. if no <TT
5866 CLASS="LITERAL"
5867 >limit-connect</TT
5868 > action applies,
5869     <SPAN
5870 CLASS="APPLICATION"
5871 >Privoxy</SPAN
5872 > allows HTTP CONNECT requests to all
5873     ports. Use <TT
5874 CLASS="LITERAL"
5875 >limit-connect</TT
5876 > if fine-grained control
5877     is desired for some or all destinations.
5878    </P
5879 ><P
5880 >    The CONNECT methods exists in HTTP to allow access to secure websites
5881     (<SPAN
5882 CLASS="QUOTE"
5883 >"https://"</SPAN
5884 > URLs) through proxies. It works very simply:
5885     the proxy connects to the server on the specified port, and then
5886     short-circuits its connections to the client and to the remote server.
5887     This means CONNECT-enabled proxies can be used as TCP relays very easily.
5888   </P
5889 ><P
5890 >   <SPAN
5891 CLASS="APPLICATION"
5892 >Privoxy</SPAN
5893 > relays HTTPS traffic without seeing
5894    the decoded content. Websites can leverage this limitation to circumvent <SPAN
5895 CLASS="APPLICATION"
5896 >Privoxy</SPAN
5897 >'s
5898    filters. By specifying an invalid port range you can disable HTTPS entirely.
5899   </P
5900 ></DD
5901 ><DT
5902 >Example usages:</DT
5903 ><DD
5904 ><TABLE
5905 BORDER="0"
5906 BGCOLOR="#E0E0E0"
5907 WIDTH="90%"
5908 ><TR
5909 ><TD
5910 ><PRE
5911 CLASS="SCREEN"
5912 >+limit-connect{443}                   # Port 443 is OK.
5913 +limit-connect{80,443}                # Ports 80 and 443 are OK.
5914 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5915 +limit-connect{-}                     # All ports are OK
5916 +limit-connect{,}                     # No HTTPS/SSL traffic is allowed</PRE
5917 ></TD
5918 ></TR
5919 ></TABLE
5920 ></DD
5921 ></DL
5922 ></DIV
5923 ></DIV
5924 ><DIV
5925 CLASS="SECT3"
5926 ><H4
5927 CLASS="SECT3"
5928 ><A
5929 NAME="LIMIT-COOKIE-LIFETIME"
5930 >8.5.28. limit-cookie-lifetime</A
5931 ></H4
5932 ><P
5933 ></P
5934 ><DIV
5935 CLASS="VARIABLELIST"
5936 ><DL
5937 ><DT
5938 >Typical use:</DT
5939 ><DD
5940 ><P
5941 >Limit the lifetime of HTTP cookies to a couple of minutes or hours.</P
5942 ></DD
5943 ><DT
5944 >Effect:</DT
5945 ><DD
5946 ><P
5947 >    Overwrites the expires field in Set-Cookie server headers if it's above the specified limit.
5948    </P
5949 ></DD
5950 ><DT
5951 >Type:</DT
5952 ><DD
5953 ><P
5954 >Parameterized.</P
5955 ></DD
5956 ><DT
5957 >Parameter:</DT
5958 ><DD
5959 ><P
5960 >    The lifetime limit in minutes, or 0.
5961    </P
5962 ></DD
5963 ><DT
5964 >Notes:</DT
5965 ><DD
5966 ><P
5967 >    This action reduces the lifetime of HTTP cookies coming from the
5968     server to the specified number of minutes, starting from the time
5969     the cookie passes Privoxy.
5970    </P
5971 ><P
5972 >    Cookies with a lifetime below the limit are not modified.
5973     The lifetime of session cookies is set to the specified limit.
5974    </P
5975 ><P
5976 >    The effect of this action depends on the server.
5977    </P
5978 ><P
5979 >    In case of servers which refresh their cookies with each response
5980     (or at least frequently), the lifetime limit set by this action
5981     is updated as well.
5982     Thus, a session associated with the cookie continues to work with
5983     this action enabled, as long as a new request is made before the
5984     last limit set is reached.
5985    </P
5986 ><P
5987 >    However, some servers send their cookies once, with a lifetime of several
5988     years (the year 2037 is a popular choice), and do not refresh them
5989     until a certain event in the future, for example the user logging out.
5990     In this case this action may limit the absolute lifetime of the session,
5991     even if requests are made frequently.
5992    </P
5993 ><P
5994 >    If the parameter is <SPAN
5995 CLASS="QUOTE"
5996 >"0"</SPAN
5997 >, this action behaves like
5998     <TT
5999 CLASS="LITERAL"
6000 ><A
6001 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6002 >session-cookies-only</A
6003 ></TT
6004 >.
6005    </P
6006 ></DD
6007 ><DT
6008 >Example usages:</DT
6009 ><DD
6010 ><TABLE
6011 BORDER="0"
6012 BGCOLOR="#E0E0E0"
6013 WIDTH="90%"
6014 ><TR
6015 ><TD
6016 ><PRE
6017 CLASS="SCREEN"
6018 >+limit-cookie-lifetime{60}</PRE
6019 ></TD
6020 ></TR
6021 ></TABLE
6022 ></DD
6023 ></DL
6024 ></DIV
6025 ></DIV
6026 ><DIV
6027 CLASS="SECT3"
6028 ><H4
6029 CLASS="SECT3"
6030 ><A
6031 NAME="PREVENT-COMPRESSION"
6032 >8.5.29. prevent-compression</A
6033 ></H4
6034 ><P
6035 ></P
6036 ><DIV
6037 CLASS="VARIABLELIST"
6038 ><DL
6039 ><DT
6040 >Typical use:</DT
6041 ><DD
6042 ><P
6043 >    Ensure that servers send the content uncompressed, so it can be
6044     passed through <TT
6045 CLASS="LITERAL"
6046 ><A
6047 HREF="actions-file.html#FILTER"
6048 >filter</A
6049 ></TT
6050 >s.
6051    </P
6052 ></DD
6053 ><DT
6054 >Effect:</DT
6055 ><DD
6056 ><P
6057 >    Removes the Accept-Encoding header which can be used to ask for compressed transfer.
6058    </P
6059 ></DD
6060 ><DT
6061 >Type:</DT
6062 ><DD
6063 ><P
6064 >Boolean.</P
6065 ></DD
6066 ><DT
6067 >Parameter:</DT
6068 ><DD
6069 ><P
6070 >    N/A
6071    </P
6072 ></DD
6073 ><DT
6074 >Notes:</DT
6075 ><DD
6076 ><P
6077 >    More and more websites send their content compressed by default, which
6078     is generally a good idea and saves bandwidth. But the <TT
6079 CLASS="LITERAL"
6080 ><A
6081 HREF="actions-file.html#FILTER"
6082 >filter</A
6083 ></TT
6084 > and
6085     <TT
6086 CLASS="LITERAL"
6087 ><A
6088 HREF="actions-file.html#DEANIMATE-GIFS"
6089 >deanimate-gifs</A
6090 ></TT
6091 >
6092     actions need access to the uncompressed data.
6093    </P
6094 ><P
6095 >    When compiled with zlib support (available since <SPAN
6096 CLASS="APPLICATION"
6097 >Privoxy</SPAN
6098 > 3.0.7), content that should be
6099     filtered is decompressed on-the-fly and you don't have to worry about this action.
6100     If you are using an older <SPAN
6101 CLASS="APPLICATION"
6102 >Privoxy</SPAN
6103 > version, or one that hasn't been compiled with zlib
6104     support, this action can be used to convince the server to send the content uncompressed.
6105    </P
6106 ><P
6107 >    Most text-based instances compress very well, the size is seldom decreased by less than 50%,
6108     for markup-heavy instances like news feeds saving more than 90% of the original size isn't
6109     unusual.
6110    </P
6111 ><P
6112 >    Not using compression will therefore slow down the transfer, and you should only
6113     enable this action if you really need it. As of <SPAN
6114 CLASS="APPLICATION"
6115 >Privoxy</SPAN
6116 > 3.0.7 it's disabled in all
6117     predefined action settings.
6118    </P
6119 ><P
6120 >    Note that some (rare) ill-configured sites don't handle requests for uncompressed
6121     documents correctly. Broken PHP applications tend to send an empty document body,
6122     some IIS versions only send the beginning of the content. If you enable
6123     <TT
6124 CLASS="LITERAL"
6125 >prevent-compression</TT
6126 > per default, you might want to add
6127     exceptions for those sites. See the example for how to do that.
6128    </P
6129 ></DD
6130 ><DT
6131 >Example usage (sections):</DT
6132 ><DD
6133 ><TABLE
6134 BORDER="0"
6135 BGCOLOR="#E0E0E0"
6136 WIDTH="90%"
6137 ><TR
6138 ><TD
6139 ><PRE
6140 CLASS="SCREEN"
6141 ># Selectively turn off compression, and enable a filter
6142 #
6143 { +filter{tiny-textforms} +prevent-compression }
6144 # Match only these sites
6145  .google.
6146  sourceforge.net
6147  sf.net
6148
6149 # Or instead, we could set a universal default:
6150 #
6151 { +prevent-compression }
6152  / # Match all sites
6153
6154 # Then maybe make exceptions for broken sites:
6155 #
6156 { -prevent-compression }
6157 .compusa.com/</PRE
6158 ></TD
6159 ></TR
6160 ></TABLE
6161 ></DD
6162 ></DL
6163 ></DIV
6164 ></DIV
6165 ><DIV
6166 CLASS="SECT3"
6167 ><H4
6168 CLASS="SECT3"
6169 ><A
6170 NAME="OVERWRITE-LAST-MODIFIED"
6171 >8.5.30. overwrite-last-modified</A
6172 ></H4
6173 ><P
6174 ></P
6175 ><DIV
6176 CLASS="VARIABLELIST"
6177 ><DL
6178 ><DT
6179 >Typical use:</DT
6180 ><DD
6181 ><P
6182 >Prevent yet another way to track the user's steps between sessions.</P
6183 ></DD
6184 ><DT
6185 >Effect:</DT
6186 ><DD
6187 ><P
6188 >    Deletes the <SPAN
6189 CLASS="QUOTE"
6190 >"Last-Modified:"</SPAN
6191 > HTTP server header or modifies its value.
6192    </P
6193 ></DD
6194 ><DT
6195 >Type:</DT
6196 ><DD
6197 ><P
6198 >Parameterized.</P
6199 ></DD
6200 ><DT
6201 >Parameter:</DT
6202 ><DD
6203 ><P
6204 >    One of the keywords: <SPAN
6205 CLASS="QUOTE"
6206 >"block"</SPAN
6207 >, <SPAN
6208 CLASS="QUOTE"
6209 >"reset-to-request-time"</SPAN
6210 >
6211     and <SPAN
6212 CLASS="QUOTE"
6213 >"randomize"</SPAN
6214 >
6215    </P
6216 ></DD
6217 ><DT
6218 >Notes:</DT
6219 ><DD
6220 ><P
6221 >    Removing the <SPAN
6222 CLASS="QUOTE"
6223 >"Last-Modified:"</SPAN
6224 > header is useful for filter
6225     testing, where you want to force a real reload instead of getting status
6226     code <SPAN
6227 CLASS="QUOTE"
6228 >"304"</SPAN
6229 >, which would cause the browser to reuse the old
6230     version of the page.
6231    </P
6232 ><P
6233 >    The <SPAN
6234 CLASS="QUOTE"
6235 >"randomize"</SPAN
6236 > option overwrites the value of the
6237     <SPAN
6238 CLASS="QUOTE"
6239 >"Last-Modified:"</SPAN
6240 > header with a randomly chosen time
6241     between the original value and the current time. In theory the server
6242     could send each document with a different <SPAN
6243 CLASS="QUOTE"
6244 >"Last-Modified:"</SPAN
6245 >
6246     header to track visits without using cookies. <SPAN
6247 CLASS="QUOTE"
6248 >"Randomize"</SPAN
6249 >
6250     makes it impossible and the browser can still revalidate cached documents.
6251    </P
6252 ><P
6253 >    <SPAN
6254 CLASS="QUOTE"
6255 >"reset-to-request-time"</SPAN
6256 > overwrites the value of the
6257     <SPAN
6258 CLASS="QUOTE"
6259 >"Last-Modified:"</SPAN
6260 > header with the current time. You could use
6261     this option together with
6262     <TT
6263 CLASS="LITERAL"
6264 ><A
6265 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
6266 >hide-if-modified-since</A
6267 ></TT
6268 >
6269     to further customize your random range.
6270    </P
6271 ><P
6272 >    The preferred parameter here is <SPAN
6273 CLASS="QUOTE"
6274 >"randomize"</SPAN
6275 >. It is safe
6276     to use, as long as the time settings are more or less correct.
6277     If the server sets the <SPAN
6278 CLASS="QUOTE"
6279 >"Last-Modified:"</SPAN
6280 > header to the time
6281     of the request, the random range becomes zero and the value stays the same.
6282     Therefore you should later randomize it a second time with
6283     <TT
6284 CLASS="LITERAL"
6285 ><A
6286 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
6287 >hided-if-modified-since</A
6288 ></TT
6289 >,
6290     just to be sure.
6291    </P
6292 ><P
6293 >    It is also recommended to use this action together with
6294     <TT
6295 CLASS="LITERAL"
6296 ><A
6297 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
6298 >crunch-if-none-match</A
6299 ></TT
6300 >.
6301    </P
6302 ></DD
6303 ><DT
6304 >Example usage:</DT
6305 ><DD
6306 ><TABLE
6307 BORDER="0"
6308 BGCOLOR="#E0E0E0"
6309 WIDTH="90%"
6310 ><TR
6311 ><TD
6312 ><PRE
6313 CLASS="SCREEN"
6314 ># Let the browser revalidate without being tracked across sessions
6315 { +hide-if-modified-since{-60} \
6316  +overwrite-last-modified{randomize} \
6317  +crunch-if-none-match}
6318 /</PRE
6319 ></TD
6320 ></TR
6321 ></TABLE
6322 ></DD
6323 ></DL
6324 ></DIV
6325 ></DIV
6326 ><DIV
6327 CLASS="SECT3"
6328 ><H4
6329 CLASS="SECT3"
6330 ><A
6331 NAME="REDIRECT"
6332 >8.5.31. redirect</A
6333 ></H4
6334 ><P
6335 ></P
6336 ><DIV
6337 CLASS="VARIABLELIST"
6338 ><DL
6339 ><DT
6340 >Typical use:</DT
6341 ><DD
6342 ><P
6343 >    Redirect requests to other sites.
6344    </P
6345 ></DD
6346 ><DT
6347 >Effect:</DT
6348 ><DD
6349 ><P
6350 >    Convinces the browser that the requested document has been moved
6351     to another location and the browser should get it from there.
6352    </P
6353 ></DD
6354 ><DT
6355 >Type:</DT
6356 ><DD
6357 ><P
6358 >Parameterized</P
6359 ></DD
6360 ><DT
6361 >Parameter:</DT
6362 ><DD
6363 ><P
6364 >    An absolute URL or a single pcrs command.
6365    </P
6366 ></DD
6367 ><DT
6368 >Notes:</DT
6369 ><DD
6370 ><P
6371 >    Requests to which this action applies are answered with a
6372     HTTP redirect to URLs of your choosing. The new URL is
6373     either provided as parameter, or derived by applying a
6374     single pcrs command to the original URL.
6375    </P
6376 ><P
6377 >    The syntax for pcrs commands is documented in the
6378     <A
6379 HREF="filter-file.html"
6380 >filter file</A
6381 > section.
6382    </P
6383 ><P
6384 >    Requests can't be blocked and redirected at the same time,
6385     applying this action together with
6386     <TT
6387 CLASS="LITERAL"
6388 ><A
6389 HREF="actions-file.html#BLOCK"
6390 >block</A
6391 ></TT
6392 >
6393     is a configuration error. Currently the request is blocked
6394     and an error message logged, the behavior may change in the
6395     future and result in Privoxy rejecting the action file.
6396    </P
6397 ><P
6398 >    This action can be combined with
6399     <TT
6400 CLASS="LITERAL"
6401 ><A
6402 HREF="actions-file.html#FAST-REDIRECTS"
6403 >fast-redirects{check-decoded-url}</A
6404 ></TT
6405 >
6406     to redirect to a decoded version of a rewritten URL.
6407    </P
6408 ><P
6409 >    Use this action carefully, make sure not to create redirection loops
6410     and be aware that using your own redirects might make it
6411     possible to fingerprint your requests.
6412    </P
6413 ><P
6414 >    In case of problems with your redirects, or simply to watch
6415     them working, enable <A
6416 HREF="config.html#DEBUG"
6417 >debug 128</A
6418 >.
6419    </P
6420 ></DD
6421 ><DT
6422 >Example usages:</DT
6423 ><DD
6424 ><TABLE
6425 BORDER="0"
6426 BGCOLOR="#E0E0E0"
6427 WIDTH="90%"
6428 ><TR
6429 ><TD
6430 ><PRE
6431 CLASS="SCREEN"
6432 ># Replace example.com's style sheet with another one
6433 { +redirect{http://localhost/css-replacements/example.com.css} }
6434  example.com/stylesheet\.css
6435
6436 # Create a short, easy to remember nickname for a favorite site
6437 # (relies on the browser to accept and forward invalid URLs to <SPAN
6438 CLASS="APPLICATION"
6439 >Privoxy</SPAN
6440 >)
6441 { +redirect{https://www.privoxy.org/user-manual/actions-file.html} }
6442  a
6443
6444 # Always use the expanded view for Undeadly.org articles
6445 # (Note the $ at the end of the URL pattern to make sure
6446 # the request for the rewritten URL isn't redirected as well)
6447 {+redirect{s@$@&#38;mode=expanded@}}
6448 undeadly.org/cgi\?action=article&#38;sid=\d*$
6449
6450 # Redirect Google search requests to MSN
6451 {+redirect{s@^http://[^/]*/search\?q=([^&#38;]*).*@http://search.msn.com/results.aspx?q=$1@}}
6452 .google.com/search
6453
6454 # Redirect MSN search requests to Yahoo
6455 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&#38;]*).*@http://search.yahoo.com/search?p=$1@}}
6456 search.msn.com//results\.aspx\?q=
6457
6458 # Redirect http://example.com/&#38;bla=fasel&#38;toChange=foo (and any other value but "bar")
6459 # to       http://example.com/&#38;bla=fasel&#38;toChange=bar
6460 #
6461 # The URL pattern makes sure that the following request isn't redirected again.
6462 {+redirect{s@toChange=[^&#38;]+@toChange=bar@}}
6463 example.com/.*toChange=(?!bar)
6464
6465 # Add a shortcut to look up illumos bugs
6466 {+redirect{s@^http://i([0-9]+)/.*@https://www.illumos.org/issues/$1@}}
6467 # Redirected URL = http://i4974/
6468 # Redirect Destination = https://www.illumos.org/issues/4974
6469 i[0-9][0-9][0-9][0-9]*/
6470
6471 # Redirect remote requests for this manual
6472 # to the local version delivered by Privoxy
6473 {+redirect{s@^http://www@http://config@}}
6474 www.privoxy.org/user-manual/</PRE
6475 ></TD
6476 ></TR
6477 ></TABLE
6478 ></DD
6479 ></DL
6480 ></DIV
6481 ></DIV
6482 ><DIV
6483 CLASS="SECT3"
6484 ><H4
6485 CLASS="SECT3"
6486 ><A
6487 NAME="SERVER-HEADER-FILTER"
6488 >8.5.32. server-header-filter</A
6489 ></H4
6490 ><P
6491 ></P
6492 ><DIV
6493 CLASS="VARIABLELIST"
6494 ><DL
6495 ><DT
6496 >Typical use:</DT
6497 ><DD
6498 ><P
6499 >   Rewrite or remove single server headers.
6500    </P
6501 ></DD
6502 ><DT
6503 >Effect:</DT
6504 ><DD
6505 ><P
6506 >    All server headers to which this action applies are filtered on-the-fly
6507     through the specified regular expression based substitutions.
6508    </P
6509 ></DD
6510 ><DT
6511 >Type:</DT
6512 ><DD
6513 ><P
6514 >Multi-value.</P
6515 ></DD
6516 ><DT
6517 >Parameter:</DT
6518 ><DD
6519 ><P
6520 >    The name of a server-header filter, as defined in one of the
6521     <A
6522 HREF="filter-file.html"
6523 >filter files</A
6524 >.
6525    </P
6526 ></DD
6527 ><DT
6528 >Notes:</DT
6529 ><DD
6530 ><P
6531 >    Server-header filters are applied to each header on its own, not to
6532     all at once. This makes it easier to diagnose problems, but on the downside
6533     you can't write filters that only change header x if header y's value is z.
6534     You can do that by using tags though.
6535    </P
6536 ><P
6537 >    Server-header filters are executed after the other header actions have finished
6538     and use their output as input.
6539    </P
6540 ><P
6541 >    Please refer to the <A
6542 HREF="filter-file.html"
6543 >filter file chapter</A
6544 >
6545     to learn which server-header filters are available by default, and how to
6546     create your own.
6547    </P
6548 ></DD
6549 ><DT
6550 >Example usage (section):</DT
6551 ><DD
6552 ><TABLE
6553 BORDER="0"
6554 BGCOLOR="#E0E0E0"
6555 WIDTH="90%"
6556 ><TR
6557 ><TD
6558 ><PRE
6559 CLASS="SCREEN"
6560 >{+server-header-filter{html-to-xml}}
6561 example.org/xml-instance-that-is-delivered-as-html
6562
6563 {+server-header-filter{xml-to-html}}
6564 example.org/instance-that-is-delivered-as-xml-but-is-not</PRE
6565 ></TD
6566 ></TR
6567 ></TABLE
6568 ></DD
6569 ></DL
6570 ></DIV
6571 ></DIV
6572 ><DIV
6573 CLASS="SECT3"
6574 ><H4
6575 CLASS="SECT3"
6576 ><A
6577 NAME="SERVER-HEADER-TAGGER"
6578 >8.5.33. server-header-tagger</A
6579 ></H4
6580 ><P
6581 ></P
6582 ><DIV
6583 CLASS="VARIABLELIST"
6584 ><DL
6585 ><DT
6586 >Typical use:</DT
6587 ><DD
6588 ><P
6589 >   Enable or disable filters based on the Content-Type header.
6590    </P
6591 ></DD
6592 ><DT
6593 >Effect:</DT
6594 ><DD
6595 ><P
6596 >    Server headers to which this action applies are filtered on-the-fly through
6597     the specified regular expression based substitutions, the result is used as
6598     tag.
6599    </P
6600 ></DD
6601 ><DT
6602 >Type:</DT
6603 ><DD
6604 ><P
6605 >Multi-value.</P
6606 ></DD
6607 ><DT
6608 >Parameter:</DT
6609 ><DD
6610 ><P
6611 >    The name of a server-header tagger, as defined in one of the
6612     <A
6613 HREF="filter-file.html"
6614 >filter files</A
6615 >.
6616    </P
6617 ></DD
6618 ><DT
6619 >Notes:</DT
6620 ><DD
6621 ><P
6622 >    Server-header taggers are applied to each header on its own,
6623     and as the header isn't modified, each tagger <SPAN
6624 CLASS="QUOTE"
6625 >"sees"</SPAN
6626 >
6627     the original.
6628    </P
6629 ><P
6630 >    Server-header taggers are executed before all other header actions
6631     that modify server headers. Their tags can be used to control
6632     all of the other server-header actions, the content filters
6633     and the crunch actions (<A
6634 HREF="actions-file.html#REDIRECT"
6635 >redirect</A
6636 >
6637     and <A
6638 HREF="actions-file.html#BLOCK"
6639 >block</A
6640 >).
6641    </P
6642 ><P
6643 >    Obviously crunching based on tags created by server-header taggers
6644     doesn't prevent the request from showing up in the server's log file.
6645    </P
6646 ></DD
6647 ><DT
6648 >Example usage (section):</DT
6649 ><DD
6650 ><TABLE
6651 BORDER="0"
6652 BGCOLOR="#E0E0E0"
6653 WIDTH="90%"
6654 ><TR
6655 ><TD
6656 ><PRE
6657 CLASS="SCREEN"
6658 ># Tag every request with the content type declared by the server
6659 {+server-header-tagger{content-type}}
6660 /
6661
6662 # If the response has a tag starting with 'image/' enable an external
6663 # filter that only applies to images.
6664 #
6665 # Note that the filter is not available by default, it's just a
6666 # <TT
6667 CLASS="LITERAL"
6668 ><A
6669 HREF="filter-file.html#EXTERNAL-FILTER-SYNTAX"
6670 >silly example</A
6671 ></TT
6672 >.
6673 {+external-filter{rotate-image} +force-text-mode}
6674 TAG:^image/</PRE
6675 ></TD
6676 ></TR
6677 ></TABLE
6678 ></DD
6679 ></DL
6680 ></DIV
6681 ></DIV
6682 ><DIV
6683 CLASS="SECT3"
6684 ><H4
6685 CLASS="SECT3"
6686 ><A
6687 NAME="SESSION-COOKIES-ONLY"
6688 >8.5.34. session-cookies-only</A
6689 ></H4
6690 ><P
6691 ></P
6692 ><DIV
6693 CLASS="VARIABLELIST"
6694 ><DL
6695 ><DT
6696 >Typical use:</DT
6697 ><DD
6698 ><P
6699 >    Allow only temporary <SPAN
6700 CLASS="QUOTE"
6701 >"session"</SPAN
6702 > cookies (for the current
6703     browser session <SPAN
6704 CLASS="emphasis"
6705 ><I
6706 CLASS="EMPHASIS"
6707 >only</I
6708 ></SPAN
6709 >).
6710    </P
6711 ></DD
6712 ><DT
6713 >Effect:</DT
6714 ><DD
6715 ><P
6716 >    Deletes the <SPAN
6717 CLASS="QUOTE"
6718 >"expires"</SPAN
6719 > field from <SPAN
6720 CLASS="QUOTE"
6721 >"Set-Cookie:"</SPAN
6722 >
6723     server headers. Most browsers will not store such cookies permanently and
6724     forget them in between sessions.
6725    </P
6726 ></DD
6727 ><DT
6728 >Type:</DT
6729 ><DD
6730 ><P
6731 >Boolean.</P
6732 ></DD
6733 ><DT
6734 >Parameter:</DT
6735 ><DD
6736 ><P
6737 >    N/A
6738    </P
6739 ></DD
6740 ><DT
6741 >Notes:</DT
6742 ><DD
6743 ><P
6744 >    This is less strict than <TT
6745 CLASS="LITERAL"
6746 ><A
6747 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6748 >crunch-incoming-cookies</A
6749 ></TT
6750 > /
6751     <TT
6752 CLASS="LITERAL"
6753 ><A
6754 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6755 >crunch-outgoing-cookies</A
6756 ></TT
6757 > and allows you to browse
6758     websites that insist or rely on setting cookies, without compromising your privacy too badly.
6759    </P
6760 ><P
6761 >    Most browsers will not permanently store cookies that have been processed by
6762     <TT
6763 CLASS="LITERAL"
6764 >session-cookies-only</TT
6765 > and will forget about them between sessions.
6766     This makes profiling cookies useless, but won't break sites which require cookies so
6767     that you can log in for transactions. This is generally turned on for all
6768     sites, and is the recommended setting.
6769    </P
6770 ><P
6771 >    It makes <SPAN
6772 CLASS="emphasis"
6773 ><I
6774 CLASS="EMPHASIS"
6775 >no sense at all</I
6776 ></SPAN
6777 > to use <TT
6778 CLASS="LITERAL"
6779 >session-cookies-only</TT
6780 >
6781     together with <TT
6782 CLASS="LITERAL"
6783 ><A
6784 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6785 >crunch-incoming-cookies</A
6786 ></TT
6787 > or
6788     <TT
6789 CLASS="LITERAL"
6790 ><A
6791 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6792 >crunch-outgoing-cookies</A
6793 ></TT
6794 >. If you do, cookies
6795     will be plainly killed.
6796    </P
6797 ><P
6798 >    Note that it is up to the browser how it handles such cookies without an <SPAN
6799 CLASS="QUOTE"
6800 >"expires"</SPAN
6801 >
6802     field. If you use an exotic browser, you might want to try it out to be sure.
6803    </P
6804 ><P
6805 >    This setting also has no effect on cookies that may have been stored
6806     previously by the browser before starting <SPAN
6807 CLASS="APPLICATION"
6808 >Privoxy</SPAN
6809 >.
6810     These would have to be removed manually.
6811    </P
6812 ><P
6813 >     <SPAN
6814 CLASS="APPLICATION"
6815 >Privoxy</SPAN
6816 > also uses
6817      the <A
6818 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6819 >content-cookies filter</A
6820 >
6821      to block some types of cookies. Content cookies are not effected by
6822      <TT
6823 CLASS="LITERAL"
6824 >session-cookies-only</TT
6825 >.
6826    </P
6827 ></DD
6828 ><DT
6829 >Example usage:</DT
6830 ><DD
6831 ><TABLE
6832 BORDER="0"
6833 BGCOLOR="#E0E0E0"
6834 WIDTH="90%"
6835 ><TR
6836 ><TD
6837 ><PRE
6838 CLASS="SCREEN"
6839 >+session-cookies-only</PRE
6840 ></TD
6841 ></TR
6842 ></TABLE
6843 ></DD
6844 ></DL
6845 ></DIV
6846 ></DIV
6847 ><DIV
6848 CLASS="SECT3"
6849 ><H4
6850 CLASS="SECT3"
6851 ><A
6852 NAME="SET-IMAGE-BLOCKER"
6853 >8.5.35. set-image-blocker</A
6854 ></H4
6855 ><P
6856 ></P
6857 ><DIV
6858 CLASS="VARIABLELIST"
6859 ><DL
6860 ><DT
6861 >Typical use:</DT
6862 ><DD
6863 ><P
6864 >Choose the replacement for blocked images</P
6865 ></DD
6866 ><DT
6867 >Effect:</DT
6868 ><DD
6869 ><P
6870 >     This action alone doesn't do anything noticeable. If <SPAN
6871 CLASS="emphasis"
6872 ><I
6873 CLASS="EMPHASIS"
6874 >both</I
6875 ></SPAN
6876 >
6877      <TT
6878 CLASS="LITERAL"
6879 ><A
6880 HREF="actions-file.html#BLOCK"
6881 >block</A
6882 ></TT
6883 > <SPAN
6884 CLASS="emphasis"
6885 ><I
6886 CLASS="EMPHASIS"
6887 >and</I
6888 ></SPAN
6889 > <TT
6890 CLASS="LITERAL"
6891 ><A
6892 HREF="actions-file.html#HANDLE-AS-IMAGE"
6893 >handle-as-image</A
6894 ></TT
6895 > <SPAN
6896 CLASS="emphasis"
6897 ><I
6898 CLASS="EMPHASIS"
6899 >also</I
6900 ></SPAN
6901 >
6902      apply, i.e. if the request is to be blocked as an image,
6903      <SPAN
6904 CLASS="emphasis"
6905 ><I
6906 CLASS="EMPHASIS"
6907 >then</I
6908 ></SPAN
6909 > the parameter of this action decides what will be
6910      sent as a replacement.
6911    </P
6912 ></DD
6913 ><DT
6914 >Type:</DT
6915 ><DD
6916 ><P
6917 >Parameterized.</P
6918 ></DD
6919 ><DT
6920 >Parameter:</DT
6921 ><DD
6922 ><P
6923 ></P
6924 ><UL
6925 ><LI
6926 ><P
6927 >      <SPAN
6928 CLASS="QUOTE"
6929 >"pattern"</SPAN
6930 > to send a built-in checkerboard pattern image. The image is visually
6931       decent, scales very well, and makes it obvious where banners were busted.
6932      </P
6933 ></LI
6934 ><LI
6935 ><P
6936 >      <SPAN
6937 CLASS="QUOTE"
6938 >"blank"</SPAN
6939 > to send a built-in transparent image. This makes banners disappear
6940       completely, but makes it hard to detect where <SPAN
6941 CLASS="APPLICATION"
6942 >Privoxy</SPAN
6943 > has blocked
6944       images on a given page and complicates troubleshooting if <SPAN
6945 CLASS="APPLICATION"
6946 >Privoxy</SPAN
6947 >
6948       has blocked innocent images, like navigation icons.
6949      </P
6950 ></LI
6951 ><LI
6952 ><P
6953 >      <SPAN
6954 CLASS="QUOTE"
6955 >"<TT
6956 CLASS="REPLACEABLE"
6957 ><I
6958 >target-url</I
6959 ></TT
6960 >"</SPAN
6961 > to
6962       send a redirect to <TT
6963 CLASS="REPLACEABLE"
6964 ><I
6965 >target-url</I
6966 ></TT
6967 >. You can redirect
6968       to any image anywhere, even in your local filesystem via <SPAN
6969 CLASS="QUOTE"
6970 >"file:///"</SPAN
6971 > URL.
6972       (But note that not all browsers support redirecting to a local file system).
6973      </P
6974 ><P
6975 >      A good application of redirects is to use special <SPAN
6976 CLASS="APPLICATION"
6977 >Privoxy</SPAN
6978 >-built-in
6979       URLs, which send the built-in images, as <TT
6980 CLASS="REPLACEABLE"
6981 ><I
6982 >target-url</I
6983 ></TT
6984 >.
6985       This has the same visual effect as specifying <SPAN
6986 CLASS="QUOTE"
6987 >"blank"</SPAN
6988 > or <SPAN
6989 CLASS="QUOTE"
6990 >"pattern"</SPAN
6991 > in
6992       the first place, but enables your browser to cache the replacement image, instead of requesting
6993       it over and over again.
6994      </P
6995 ></LI
6996 ></UL
6997 ></DD
6998 ><DT
6999 >Notes:</DT
7000 ><DD
7001 ><P
7002 >    The URLs for the built-in images are <SPAN
7003 CLASS="QUOTE"
7004 >"http://config.privoxy.org/send-banner?type=<TT
7005 CLASS="REPLACEABLE"
7006 ><I
7007 >type</I
7008 ></TT
7009 >"</SPAN
7010 >, where <TT
7011 CLASS="REPLACEABLE"
7012 ><I
7013 >type</I
7014 ></TT
7015 > is
7016     either <SPAN
7017 CLASS="QUOTE"
7018 >"blank"</SPAN
7019 > or <SPAN
7020 CLASS="QUOTE"
7021 >"pattern"</SPAN
7022 >.
7023    </P
7024 ><P
7025 >    There is a third (advanced) type, called <SPAN
7026 CLASS="QUOTE"
7027 >"auto"</SPAN
7028 >. It is <SPAN
7029 CLASS="emphasis"
7030 ><I
7031 CLASS="EMPHASIS"
7032 >NOT</I
7033 ></SPAN
7034 > to be
7035     used in <TT
7036 CLASS="LITERAL"
7037 >set-image-blocker</TT
7038 >, but meant for use from <A
7039 HREF="filter-file.html"
7040 >filters</A
7041 >.
7042     Auto will select the type of image that would have applied to the referring page, had it been an image.
7043    </P
7044 ></DD
7045 ><DT
7046 >Example usage:</DT
7047 ><DD
7048 ><P
7049 >    Built-in pattern:
7050    </P
7051 ><TABLE
7052 BORDER="0"
7053 BGCOLOR="#E0E0E0"
7054 WIDTH="90%"
7055 ><TR
7056 ><TD
7057 ><PRE
7058 CLASS="SCREEN"
7059 >+set-image-blocker{pattern}</PRE
7060 ></TD
7061 ></TR
7062 ></TABLE
7063 ><P
7064 >    Redirect to the BSD daemon:
7065    </P
7066 ><TABLE
7067 BORDER="0"
7068 BGCOLOR="#E0E0E0"
7069 WIDTH="90%"
7070 ><TR
7071 ><TD
7072 ><PRE
7073 CLASS="SCREEN"
7074 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
7075 ></TD
7076 ></TR
7077 ></TABLE
7078 ><P
7079 >    Redirect to the built-in pattern for better caching:
7080    </P
7081 ><TABLE
7082 BORDER="0"
7083 BGCOLOR="#E0E0E0"
7084 WIDTH="90%"
7085 ><TR
7086 ><TD
7087 ><PRE
7088 CLASS="SCREEN"
7089 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
7090 ></TD
7091 ></TR
7092 ></TABLE
7093 ></DD
7094 ></DL
7095 ></DIV
7096 ></DIV
7097 ><DIV
7098 CLASS="SECT3"
7099 ><H3
7100 CLASS="SECT3"
7101 ><A
7102 NAME="SUMMARY"
7103 >8.5.36. Summary</A
7104 ></H3
7105 ><P
7106 > Note that many of these actions have the potential to cause a page to
7107  misbehave, possibly even not to display at all. There are many ways
7108  a site designer may choose to design his site, and what HTTP header
7109  content, and other criteria, he may depend on. There is no way to have hard
7110  and fast rules for all sites. See the <A
7111 HREF="appendix.html#ACTIONSANAT"
7112 >Appendix</A
7113 > for a brief example on troubleshooting
7114  actions.</P
7115 ></DIV
7116 ></DIV
7117 ><DIV
7118 CLASS="SECT2"
7119 ><H2
7120 CLASS="SECT2"
7121 ><A
7122 NAME="ALIASES"
7123 >8.6. Aliases</A
7124 ></H2
7125 ><P
7126 > Custom <SPAN
7127 CLASS="QUOTE"
7128 >"actions"</SPAN
7129 >, known to <SPAN
7130 CLASS="APPLICATION"
7131 >Privoxy</SPAN
7132 >
7133  as <SPAN
7134 CLASS="QUOTE"
7135 >"aliases"</SPAN
7136 >, can be defined by combining other actions.
7137  These can in turn be invoked just like the built-in actions.
7138  Currently, an alias name can contain any character except space, tab,
7139  <SPAN
7140 CLASS="QUOTE"
7141 >"="</SPAN
7142 >,
7143  <SPAN
7144 CLASS="QUOTE"
7145 >"{"</SPAN
7146 > and <SPAN
7147 CLASS="QUOTE"
7148 >"}"</SPAN
7149 >, but we <SPAN
7150 CLASS="emphasis"
7151 ><I
7152 CLASS="EMPHASIS"
7153 >strongly
7154  recommend</I
7155 ></SPAN
7156 > that you only use <SPAN
7157 CLASS="QUOTE"
7158 >"a"</SPAN
7159 > to <SPAN
7160 CLASS="QUOTE"
7161 >"z"</SPAN
7162 >,
7163  <SPAN
7164 CLASS="QUOTE"
7165 >"0"</SPAN
7166 > to <SPAN
7167 CLASS="QUOTE"
7168 >"9"</SPAN
7169 >, <SPAN
7170 CLASS="QUOTE"
7171 >"+"</SPAN
7172 >, and <SPAN
7173 CLASS="QUOTE"
7174 >"-"</SPAN
7175 >.
7176  Alias names are not case sensitive, and are not required to start with a
7177  <SPAN
7178 CLASS="QUOTE"
7179 >"+"</SPAN
7180 > or <SPAN
7181 CLASS="QUOTE"
7182 >"-"</SPAN
7183 > sign, since they are merely textually
7184  expanded.</P
7185 ><P
7186 > Aliases can be used throughout the actions file, but they <SPAN
7187 CLASS="emphasis"
7188 ><I
7189 CLASS="EMPHASIS"
7190 >must be
7191  defined in a special section at the top of the file!</I
7192 ></SPAN
7193 >
7194  And there can only be one such section per actions file. Each actions file may
7195  have its own alias section, and the aliases defined in it are only visible
7196  within that file.</P
7197 ><P
7198 > There are two main reasons to use aliases: One is to save typing for frequently
7199  used combinations of actions, the other one is a gain in flexibility: If you
7200  decide once how you want to handle shops by defining an alias called
7201  <SPAN
7202 CLASS="QUOTE"
7203 >"shop"</SPAN
7204 >, you can later change your policy on shops in
7205  <SPAN
7206 CLASS="emphasis"
7207 ><I
7208 CLASS="EMPHASIS"
7209 >one</I
7210 ></SPAN
7211 > place, and your changes will take effect everywhere
7212  in the actions file where the <SPAN
7213 CLASS="QUOTE"
7214 >"shop"</SPAN
7215 > alias is used. Calling aliases
7216  by their purpose also makes your actions files more readable.</P
7217 ><P
7218 > Currently, there is one big drawback to using aliases, though:
7219  <SPAN
7220 CLASS="APPLICATION"
7221 >Privoxy</SPAN
7222 >'s built-in web-based action file
7223  editor honors aliases when reading the actions files, but it expands
7224  them before writing. So the effects of your aliases are of course preserved,
7225  but the aliases themselves are lost when you edit sections that use aliases
7226  with it.</P
7227 ><P
7228 > Now let's define some aliases...</P
7229 ><TABLE
7230 BORDER="0"
7231 BGCOLOR="#E0E0E0"
7232 WIDTH="100%"
7233 ><TR
7234 ><TD
7235 ><PRE
7236 CLASS="SCREEN"
7237 > # Useful custom aliases we can use later.
7238  #
7239  # Note the (required!) section header line and that this section
7240  # must be at the top of the actions file!
7241  #
7242  {{alias}}
7243
7244  # These aliases just save typing later:
7245  # (Note that some already use other aliases!)
7246  #
7247  +crunch-all-cookies = +<A
7248 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7249 >crunch-incoming-cookies</A
7250 > +<A
7251 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7252 >crunch-outgoing-cookies</A
7253 >
7254  -crunch-all-cookies = -<A
7255 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7256 >crunch-incoming-cookies</A
7257 > -<A
7258 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7259 >crunch-outgoing-cookies</A
7260 >
7261  +block-as-image      = +block{Blocked image.} +handle-as-image
7262  allow-all-cookies   = -crunch-all-cookies -<A
7263 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7264 >session-cookies-only</A
7265 > -<A
7266 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
7267 >filter{content-cookies}</A
7268 >
7269
7270  # These aliases define combinations of actions
7271  # that are useful for certain types of sites:
7272  #
7273  fragile     = -<A
7274 HREF="actions-file.html#BLOCK"
7275 >block</A
7276 > -<A
7277 HREF="actions-file.html#FILTER"
7278 >filter</A
7279 > -crunch-all-cookies -<A
7280 HREF="actions-file.html#FAST-REDIRECTS"
7281 >fast-redirects</A
7282 > -<A
7283 HREF="actions-file.html#HIDE-REFERER"
7284 >hide-referrer</A
7285 > -<A
7286 HREF="actions-file.html#PREVENT-COMPRESSION"
7287 >prevent-compression</A
7288 >
7289
7290  shop        = -crunch-all-cookies -<A
7291 HREF="actions-file.html#FILTER-ALL-POPUPS"
7292 >filter{all-popups}</A
7293 >
7294
7295  # Short names for other aliases, for really lazy people ;-)
7296  #
7297  c0 = +crunch-all-cookies
7298  c1 = -crunch-all-cookies</PRE
7299 ></TD
7300 ></TR
7301 ></TABLE
7302 ><P
7303 > ...and put them to use. These sections would appear in the lower part of an
7304  actions file and define exceptions to the default actions (as specified further
7305  up for the <SPAN
7306 CLASS="QUOTE"
7307 >"/"</SPAN
7308 > pattern):</P
7309 ><TABLE
7310 BORDER="0"
7311 BGCOLOR="#E0E0E0"
7312 WIDTH="100%"
7313 ><TR
7314 ><TD
7315 ><PRE
7316 CLASS="SCREEN"
7317 > # These sites are either very complex or very keen on
7318  # user data and require minimal interference to work:
7319  #
7320  {fragile}
7321  .office.microsoft.com
7322  .windowsupdate.microsoft.com
7323  # Gmail is really mail.google.com, not gmail.com
7324  mail.google.com
7325
7326  # Shopping sites:
7327  # Allow cookies (for setting and retrieving your customer data)
7328  #
7329  {shop}
7330  .quietpc.com
7331  .worldpay.com   # for quietpc.com
7332  mybank.example.com
7333
7334  # These shops require pop-ups:
7335  #
7336  {-filter{all-popups} -filter{unsolicited-popups}}
7337   .dabs.com
7338   .overclockers.co.uk</PRE
7339 ></TD
7340 ></TR
7341 ></TABLE
7342 ><P
7343 > Aliases like <SPAN
7344 CLASS="QUOTE"
7345 >"shop"</SPAN
7346 > and <SPAN
7347 CLASS="QUOTE"
7348 >"fragile"</SPAN
7349 > are typically used for
7350  <SPAN
7351 CLASS="QUOTE"
7352 >"problem"</SPAN
7353 > sites that require more than one action to be disabled
7354  in order to function properly.</P
7355 ></DIV
7356 ><DIV
7357 CLASS="SECT2"
7358 ><H2
7359 CLASS="SECT2"
7360 ><A
7361 NAME="ACT-EXAMPLES"
7362 >8.7. Actions Files Tutorial</A
7363 ></H2
7364 ><P
7365 > The above chapters have shown <A
7366 HREF="actions-file.html"
7367 >which actions files
7368  there are and how they are organized</A
7369 >, how actions are <A
7370 HREF="actions-file.html#ACTIONS"
7371 >specified</A
7372 > and <A
7373 HREF="actions-file.html#ACTIONS-APPLY"
7374 >applied
7375  to URLs</A
7376 >, how <A
7377 HREF="actions-file.html#AF-PATTERNS"
7378 >patterns</A
7379 > work, and how to
7380  define and use <A
7381 HREF="actions-file.html#ALIASES"
7382 >aliases</A
7383 >. Now, let's look at an
7384  example <TT
7385 CLASS="FILENAME"
7386 >match-all.action</TT
7387 >, <TT
7388 CLASS="FILENAME"
7389 >default.action</TT
7390 >
7391  and <TT
7392 CLASS="FILENAME"
7393 >user.action</TT
7394 > file and see how all these pieces come together:</P
7395 ><DIV
7396 CLASS="SECT3"
7397 ><H3
7398 CLASS="SECT3"
7399 ><A
7400 NAME="MATCH-ALL"
7401 >8.7.1. match-all.action</A
7402 ></H3
7403 ><P
7404 > Remember <SPAN
7405 CLASS="emphasis"
7406 ><I
7407 CLASS="EMPHASIS"
7408 >all actions are disabled when matching starts</I
7409 ></SPAN
7410 >,
7411  so we have to explicitly enable the ones we want.</P
7412 ><P
7413 > While the <TT
7414 CLASS="FILENAME"
7415 >match-all.action</TT
7416 > file only contains a
7417  single section, it is probably the most important one. It has only one
7418  pattern, <SPAN
7419 CLASS="QUOTE"
7420 >"<TT
7421 CLASS="LITERAL"
7422 >/</TT
7423 >"</SPAN
7424 >, but this pattern
7425  <A
7426 HREF="actions-file.html#AF-PATTERNS"
7427 >matches all URLs</A
7428 >. Therefore, the set of
7429  actions used in this <SPAN
7430 CLASS="QUOTE"
7431 >"default"</SPAN
7432 > section <SPAN
7433 CLASS="emphasis"
7434 ><I
7435 CLASS="EMPHASIS"
7436 >will
7437  be applied to all requests as a start</I
7438 ></SPAN
7439 >. It can  be partly or
7440  wholly overridden by other actions files like <TT
7441 CLASS="FILENAME"
7442 >default.action</TT
7443 >
7444  and <TT
7445 CLASS="FILENAME"
7446 >user.action</TT
7447 >, but it will still be largely responsible
7448  for your overall browsing experience.</P
7449 ><P
7450 > Again, at the start of matching, all actions are disabled, so there is
7451  no need to disable any actions here. (Remember: a <SPAN
7452 CLASS="QUOTE"
7453 >"+"</SPAN
7454 >
7455  preceding the action name enables the action, a <SPAN
7456 CLASS="QUOTE"
7457 >"-"</SPAN
7458 > disables!).
7459  Also note how this long line has been made more readable by splitting it into
7460  multiple lines with line continuation.</P
7461 ><TABLE
7462 BORDER="0"
7463 BGCOLOR="#E0E0E0"
7464 WIDTH="100%"
7465 ><TR
7466 ><TD
7467 ><PRE
7468 CLASS="SCREEN"
7469 >{ \
7470  +<A
7471 HREF="actions-file.html#CHANGE-X-FORWARDED-FOR"
7472 >change-x-forwarded-for{block}</A
7473 > \
7474  +<A
7475 HREF="actions-file.html#HIDE-FROM-HEADER"
7476 >hide-from-header{block}</A
7477 > \
7478  +<A
7479 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7480 >set-image-blocker{pattern}</A
7481 > \
7482 }
7483 / # Match all URLs</PRE
7484 ></TD
7485 ></TR
7486 ></TABLE
7487 ><P
7488 > The default behavior is now set.</P
7489 ></DIV
7490 ><DIV
7491 CLASS="SECT3"
7492 ><H3
7493 CLASS="SECT3"
7494 ><A
7495 NAME="DEFAULT-ACTION"
7496 >8.7.2. default.action</A
7497 ></H3
7498 ><P
7499 > If you aren't a developer, there's no need for you to edit the
7500  <TT
7501 CLASS="FILENAME"
7502 >default.action</TT
7503 > file. It is maintained by
7504  the <SPAN
7505 CLASS="APPLICATION"
7506 >Privoxy</SPAN
7507 > developers and if you disagree with some of the
7508  sections, you should overrule them in your <TT
7509 CLASS="FILENAME"
7510 >user.action</TT
7511 >.</P
7512 ><P
7513 > Understanding the <TT
7514 CLASS="FILENAME"
7515 >default.action</TT
7516 > file can
7517  help you with your <TT
7518 CLASS="FILENAME"
7519 >user.action</TT
7520 >, though.</P
7521 ><P
7522 > The first section in this file is a special section for internal use
7523  that prevents older <SPAN
7524 CLASS="APPLICATION"
7525 >Privoxy</SPAN
7526 > versions from reading the file:</P
7527 ><TABLE
7528 BORDER="0"
7529 BGCOLOR="#E0E0E0"
7530 WIDTH="100%"
7531 ><TR
7532 ><TD
7533 ><PRE
7534 CLASS="SCREEN"
7535 >##########################################################################
7536 # Settings -- Don't change! For internal Privoxy use ONLY.
7537 ##########################################################################
7538 {{settings}}
7539 for-privoxy-version=3.0.11</PRE
7540 ></TD
7541 ></TR
7542 ></TABLE
7543 ><P
7544 > After that comes the (optional) alias section. We'll use the example
7545  section from the above <A
7546 HREF="actions-file.html#ALIASES"
7547 >chapter on aliases</A
7548 >,
7549  that also explains why and how aliases are used:</P
7550 ><TABLE
7551 BORDER="0"
7552 BGCOLOR="#E0E0E0"
7553 WIDTH="100%"
7554 ><TR
7555 ><TD
7556 ><PRE
7557 CLASS="SCREEN"
7558 >##########################################################################
7559 # Aliases
7560 ##########################################################################
7561 {{alias}}
7562
7563  # These aliases just save typing later:
7564  # (Note that some already use other aliases!)
7565  #
7566  +crunch-all-cookies = +<A
7567 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7568 >crunch-incoming-cookies</A
7569 > +<A
7570 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7571 >crunch-outgoing-cookies</A
7572 >
7573  -crunch-all-cookies = -<A
7574 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7575 >crunch-incoming-cookies</A
7576 > -<A
7577 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7578 >crunch-outgoing-cookies</A
7579 >
7580  +block-as-image      = +block{Blocked image.} +handle-as-image
7581  mercy-for-cookies   = -crunch-all-cookies -<A
7582 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7583 >session-cookies-only</A
7584 > -<A
7585 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
7586 >filter{content-cookies}</A
7587 >
7588
7589  # These aliases define combinations of actions
7590  # that are useful for certain types of sites:
7591  #
7592  fragile     = -<A
7593 HREF="actions-file.html#BLOCK"
7594 >block</A
7595 > -<A
7596 HREF="actions-file.html#FILTER"
7597 >filter</A
7598 > -crunch-all-cookies -<A
7599 HREF="actions-file.html#FAST-REDIRECTS"
7600 >fast-redirects</A
7601 > -<A
7602 HREF="actions-file.html#HIDE-REFERER"
7603 >hide-referrer</A
7604 >
7605  shop        = -crunch-all-cookies -<A
7606 HREF="actions-file.html#FILTER-ALL-POPUPS"
7607 >filter{all-popups}</A
7608 ></PRE
7609 ></TD
7610 ></TR
7611 ></TABLE
7612 ><P
7613 > The first of our specialized sections is concerned with <SPAN
7614 CLASS="QUOTE"
7615 >"fragile"</SPAN
7616 >
7617  sites, i.e. sites that require minimum interference, because they are either
7618  very complex or very keen on tracking you (and have mechanisms in place that
7619  make them unusable for people who avoid being tracked). We will use
7620  our pre-defined <TT
7621 CLASS="LITERAL"
7622 >fragile</TT
7623 > alias instead of stating the list
7624  of actions explicitly:</P
7625 ><TABLE
7626 BORDER="0"
7627 BGCOLOR="#E0E0E0"
7628 WIDTH="100%"
7629 ><TR
7630 ><TD
7631 ><PRE
7632 CLASS="SCREEN"
7633 >##########################################################################
7634 # Exceptions for sites that'll break under the default action set:
7635 ##########################################################################
7636
7637 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7638 #
7639 { fragile }
7640 .office.microsoft.com           # surprise, surprise!
7641 .windowsupdate.microsoft.com
7642 mail.google.com</PRE
7643 ></TD
7644 ></TR
7645 ></TABLE
7646 ><P
7647 > Shopping sites are not as fragile, but they typically
7648  require cookies to log in, and pop-up windows for shopping
7649  carts or item details. Again, we'll use a pre-defined alias:</P
7650 ><TABLE
7651 BORDER="0"
7652 BGCOLOR="#E0E0E0"
7653 WIDTH="100%"
7654 ><TR
7655 ><TD
7656 ><PRE
7657 CLASS="SCREEN"
7658 ># Shopping sites:
7659 #
7660 { shop }
7661 .quietpc.com
7662 .worldpay.com   # for quietpc.com
7663 .jungle.com
7664 .scan.co.uk</PRE
7665 ></TD
7666 ></TR
7667 ></TABLE
7668 ><P
7669 > The <TT
7670 CLASS="LITERAL"
7671 ><A
7672 HREF="actions-file.html#FAST-REDIRECTS"
7673 >fast-redirects</A
7674 ></TT
7675 >
7676  action, which may have been enabled in <TT
7677 CLASS="FILENAME"
7678 >match-all.action</TT
7679 >,
7680  breaks some sites. So disable it for popular sites where we know it misbehaves:</P
7681 ><TABLE
7682 BORDER="0"
7683 BGCOLOR="#E0E0E0"
7684 WIDTH="100%"
7685 ><TR
7686 ><TD
7687 ><PRE
7688 CLASS="SCREEN"
7689 >{ -<A
7690 HREF="actions-file.html#FAST-REDIRECTS"
7691 >fast-redirects</A
7692 > }
7693 login.yahoo.com
7694 edit.*.yahoo.com
7695 .google.com
7696 .altavista.com/.*(like|url|link):http
7697 .altavista.com/trans.*urltext=http
7698 .nytimes.com</PRE
7699 ></TD
7700 ></TR
7701 ></TABLE
7702 ><P
7703 > It is important that <SPAN
7704 CLASS="APPLICATION"
7705 >Privoxy</SPAN
7706 > knows which
7707  URLs belong to images, so that <SPAN
7708 CLASS="emphasis"
7709 ><I
7710 CLASS="EMPHASIS"
7711 >if</I
7712 ></SPAN
7713 > they are to
7714  be blocked, a substitute image can be sent, rather than an HTML page.
7715  Contacting the remote site to find out is not an option, since it
7716  would destroy the loading time advantage of banner blocking, and it
7717  would feed the advertisers information about you. We can mark any
7718  URL as an image with the <TT
7719 CLASS="LITERAL"
7720 ><A
7721 HREF="actions-file.html#HANDLE-AS-IMAGE"
7722 >handle-as-image</A
7723 ></TT
7724 > action,
7725  and marking all URLs that end in a known image file extension is a
7726  good start:</P
7727 ><TABLE
7728 BORDER="0"
7729 BGCOLOR="#E0E0E0"
7730 WIDTH="100%"
7731 ><TR
7732 ><TD
7733 ><PRE
7734 CLASS="SCREEN"
7735 >##########################################################################
7736 # Images:
7737 ##########################################################################
7738
7739 # Define which file types will be treated as images, in case they get
7740 # blocked further down this file:
7741 #
7742 { +<A
7743 HREF="actions-file.html#HANDLE-AS-IMAGE"
7744 >handle-as-image</A
7745 > }
7746 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7747 ></TD
7748 ></TR
7749 ></TABLE
7750 ><P
7751 > And then there are known banner sources. They often use scripts to
7752  generate the banners, so it won't be visible from the URL that the
7753  request is for an image. Hence we block them <SPAN
7754 CLASS="emphasis"
7755 ><I
7756 CLASS="EMPHASIS"
7757 >and</I
7758 ></SPAN
7759 >
7760  mark them as images in one go, with the help of our
7761  <TT
7762 CLASS="LITERAL"
7763 >+block-as-image</TT
7764 > alias defined above. (We could of
7765  course just as well use <TT
7766 CLASS="LITERAL"
7767 >+<A
7768 HREF="actions-file.html#BLOCK"
7769 >block</A
7770 >
7771  +<A
7772 HREF="actions-file.html#HANDLE-AS-IMAGE"
7773 >handle-as-image</A
7774 ></TT
7775 > here.)
7776  Remember that the type of the replacement image is chosen by the
7777  <TT
7778 CLASS="LITERAL"
7779 ><A
7780 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7781 >set-image-blocker</A
7782 ></TT
7783 >
7784  action. Since all URLs have matched the default section with its
7785  <TT
7786 CLASS="LITERAL"
7787 >+<A
7788 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7789 >set-image-blocker</A
7790 >{pattern}</TT
7791 >
7792  action before, it still applies and needn't be repeated:</P
7793 ><TABLE
7794 BORDER="0"
7795 BGCOLOR="#E0E0E0"
7796 WIDTH="100%"
7797 ><TR
7798 ><TD
7799 ><PRE
7800 CLASS="SCREEN"
7801 ># Known ad generators:
7802 #
7803 { +block-as-image }
7804 ar.atwola.com
7805 .ad.doubleclick.net
7806 .ad.*.doubleclick.net
7807 .a.yimg.com/(?:(?!/i/).)*$
7808 .a[0-9].yimg.com/(?:(?!/i/).)*$
7809 bs*.gsanet.com
7810 .qkimg.net</PRE
7811 ></TD
7812 ></TR
7813 ></TABLE
7814 ><P
7815 > One of the most important jobs of <SPAN
7816 CLASS="APPLICATION"
7817 >Privoxy</SPAN
7818 >
7819  is to block banners. Many of these can be <SPAN
7820 CLASS="QUOTE"
7821 >"blocked"</SPAN
7822 >
7823  by the <TT
7824 CLASS="LITERAL"
7825 ><A
7826 HREF="actions-file.html#FILTER"
7827 >filter</A
7828 >{banners-by-size}</TT
7829 >
7830  action, which we enabled above, and which deletes the references to banner
7831  images from the pages while they are loaded, so the browser doesn't request
7832  them anymore, and hence they don't need to be blocked here. But this naturally
7833  doesn't catch all banners, and some people choose not to use filters, so we
7834  need a comprehensive list of patterns for banner URLs here, and apply the
7835  <TT
7836 CLASS="LITERAL"
7837 ><A
7838 HREF="actions-file.html#BLOCK"
7839 >block</A
7840 ></TT
7841 > action to them.</P
7842 ><P
7843 > First comes many generic patterns, which do most of the work, by
7844  matching typical domain and path name components of banners. Then comes
7845  a list of individual patterns for specific sites, which is omitted here
7846  to keep the example short:</P
7847 ><TABLE
7848 BORDER="0"
7849 BGCOLOR="#E0E0E0"
7850 WIDTH="100%"
7851 ><TR
7852 ><TD
7853 ><PRE
7854 CLASS="SCREEN"
7855 >##########################################################################
7856 # Block these fine banners:
7857 ##########################################################################
7858 { <A
7859 HREF="actions-file.html#BLOCK"
7860 >+block{Banner ads.}</A
7861 > }
7862
7863 # Generic patterns:
7864 #
7865 ad*.
7866 .*ads.
7867 banner?.
7868 count*.
7869 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7870 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7871
7872 # Site-specific patterns (abbreviated):
7873 #
7874 .hitbox.com</PRE
7875 ></TD
7876 ></TR
7877 ></TABLE
7878 ><P
7879 > It's quite remarkable how many advertisers actually call their banner
7880  servers ads.<TT
7881 CLASS="REPLACEABLE"
7882 ><I
7883 >company</I
7884 ></TT
7885 >.com, or call the directory
7886  in which the banners are stored literally <SPAN
7887 CLASS="QUOTE"
7888 >"banners"</SPAN
7889 >. So the above
7890  generic patterns are surprisingly effective.</P
7891 ><P
7892 > But being very generic, they necessarily also catch URLs that we don't want
7893  to block. The pattern <TT
7894 CLASS="LITERAL"
7895 >.*ads.</TT
7896 > e.g. catches
7897  <SPAN
7898 CLASS="QUOTE"
7899 >"nasty-<SPAN
7900 CLASS="emphasis"
7901 ><I
7902 CLASS="EMPHASIS"
7903 >ads</I
7904 ></SPAN
7905 >.nasty-corp.com"</SPAN
7906 > as intended,
7907  but also <SPAN
7908 CLASS="QUOTE"
7909 >"downlo<SPAN
7910 CLASS="emphasis"
7911 ><I
7912 CLASS="EMPHASIS"
7913 >ads</I
7914 ></SPAN
7915 >.sourcefroge.net"</SPAN
7916 > or
7917  <SPAN
7918 CLASS="QUOTE"
7919 >"<SPAN
7920 CLASS="emphasis"
7921 ><I
7922 CLASS="EMPHASIS"
7923 >ads</I
7924 ></SPAN
7925 >l.some-provider.net."</SPAN
7926 > So here come some
7927  well-known exceptions to the <TT
7928 CLASS="LITERAL"
7929 >+<A
7930 HREF="actions-file.html#BLOCK"
7931 >block</A
7932 ></TT
7933 >
7934  section above.</P
7935 ><P
7936 > Note that these are exceptions to exceptions from the default! Consider the URL
7937  <SPAN
7938 CLASS="QUOTE"
7939 >"downloads.sourcefroge.net"</SPAN
7940 >: Initially, all actions are deactivated,
7941  so it wouldn't get blocked. Then comes the defaults section, which matches the
7942  URL, but just deactivates the <TT
7943 CLASS="LITERAL"
7944 ><A
7945 HREF="actions-file.html#BLOCK"
7946 >block</A
7947 ></TT
7948 >
7949  action once again. Then it matches <TT
7950 CLASS="LITERAL"
7951 >.*ads.</TT
7952 >, an exception to the
7953  general non-blocking policy, and suddenly
7954  <TT
7955 CLASS="LITERAL"
7956 ><A
7957 HREF="actions-file.html#BLOCK"
7958 >+block</A
7959 ></TT
7960 > applies. And now, it'll match
7961  <TT
7962 CLASS="LITERAL"
7963 >.*loads.</TT
7964 >, where <TT
7965 CLASS="LITERAL"
7966 ><A
7967 HREF="actions-file.html#BLOCK"
7968 >-block</A
7969 ></TT
7970 >
7971  applies, so (unless it matches <SPAN
7972 CLASS="emphasis"
7973 ><I
7974 CLASS="EMPHASIS"
7975 >again</I
7976 ></SPAN
7977 > further down) it ends up
7978  with no <TT
7979 CLASS="LITERAL"
7980 ><A
7981 HREF="actions-file.html#BLOCK"
7982 >block</A
7983 ></TT
7984 > action applying.</P
7985 ><TABLE
7986 BORDER="0"
7987 BGCOLOR="#E0E0E0"
7988 WIDTH="100%"
7989 ><TR
7990 ><TD
7991 ><PRE
7992 CLASS="SCREEN"
7993 >##########################################################################
7994 # Save some innocent victims of the above generic block patterns:
7995 ##########################################################################
7996
7997 # By domain:
7998 #
7999 { -<A
8000 HREF="actions-file.html#BLOCK"
8001 >block</A
8002 > }
8003 adv[io]*.  # (for advogato.org and advice.*)
8004 adsl.      # (has nothing to do with ads)
8005 adobe.     # (has nothing to do with ads either)
8006 ad[ud]*.   # (adult.* and add.*)
8007 .edu       # (universities don't host banners (yet!))
8008 .*loads.   # (downloads, uploads etc)
8009
8010 # By path:
8011 #
8012 /.*loads/
8013
8014 # Site-specific:
8015 #
8016 www.globalintersec.com/adv # (adv = advanced)
8017 www.ugu.com/sui/ugu/adv</PRE
8018 ></TD
8019 ></TR
8020 ></TABLE
8021 ><P
8022 > Filtering source code can have nasty side effects,
8023  so make an exception for our friends at sourceforge.net,
8024  and all paths with <SPAN
8025 CLASS="QUOTE"
8026 >"cvs"</SPAN
8027 > in them. Note that
8028  <TT
8029 CLASS="LITERAL"
8030 >-<A
8031 HREF="actions-file.html#FILTER"
8032 >filter</A
8033 ></TT
8034 >
8035  disables <SPAN
8036 CLASS="emphasis"
8037 ><I
8038 CLASS="EMPHASIS"
8039 >all</I
8040 ></SPAN
8041 > filters in one fell swoop!</P
8042 ><TABLE
8043 BORDER="0"
8044 BGCOLOR="#E0E0E0"
8045 WIDTH="100%"
8046 ><TR
8047 ><TD
8048 ><PRE
8049 CLASS="SCREEN"
8050 ># Don't filter code!
8051 #
8052 { -<A
8053 HREF="actions-file.html#FILTER"
8054 >filter</A
8055 > }
8056 /(.*/)?cvs
8057 bugzilla.
8058 developer.
8059 wiki.
8060 .sourceforge.net</PRE
8061 ></TD
8062 ></TR
8063 ></TABLE
8064 ><P
8065 > The actual <TT
8066 CLASS="FILENAME"
8067 >default.action</TT
8068 > is of course much more
8069  comprehensive, but we hope this example made clear how it works.</P
8070 ></DIV
8071 ><DIV
8072 CLASS="SECT3"
8073 ><H3
8074 CLASS="SECT3"
8075 ><A
8076 NAME="USER-ACTION"
8077 >8.7.3. user.action</A
8078 ></H3
8079 ><P
8080 > So far we are painting with a broad brush by setting general policies,
8081  which would be a reasonable starting point for many people. Now,
8082  you might want to be more specific and have customized rules that
8083  are more suitable to your personal habits and preferences. These would
8084  be for narrowly defined situations like your ISP or your bank, and should
8085  be placed in <TT
8086 CLASS="FILENAME"
8087 >user.action</TT
8088 >, which is parsed after all other
8089  actions files and hence has the last word, over-riding any previously
8090  defined actions. <TT
8091 CLASS="FILENAME"
8092 >user.action</TT
8093 > is also a
8094  <SPAN
8095 CLASS="emphasis"
8096 ><I
8097 CLASS="EMPHASIS"
8098 >safe</I
8099 ></SPAN
8100 > place for your personal settings, since
8101  <TT
8102 CLASS="FILENAME"
8103 >default.action</TT
8104 > is actively maintained by the
8105  <SPAN
8106 CLASS="APPLICATION"
8107 >Privoxy</SPAN
8108 > developers and you'll probably want
8109  to install updated versions from time to time.</P
8110 ><P
8111 > So let's look at a few examples of things that one might typically do in
8112  <TT
8113 CLASS="FILENAME"
8114 >user.action</TT
8115 >:</P
8116 ><TABLE
8117 BORDER="0"
8118 BGCOLOR="#E0E0E0"
8119 WIDTH="100%"
8120 ><TR
8121 ><TD
8122 ><PRE
8123 CLASS="SCREEN"
8124 ># My user.action file. &#60;fred@example.com&#62;</PRE
8125 ></TD
8126 ></TR
8127 ></TABLE
8128 ><P
8129 > As <A
8130 HREF="actions-file.html#ALIASES"
8131 >aliases</A
8132 > are local to the actions
8133  file that they are defined in, you can't use the ones from
8134  <TT
8135 CLASS="FILENAME"
8136 >default.action</TT
8137 >, unless you repeat them here:</P
8138 ><TABLE
8139 BORDER="0"
8140 BGCOLOR="#E0E0E0"
8141 WIDTH="100%"
8142 ><TR
8143 ><TD
8144 ><PRE
8145 CLASS="SCREEN"
8146 ># Aliases are local to the file they are defined in.
8147 # (Re-)define aliases for this file:
8148 #
8149 {{alias}}
8150 #
8151 # These aliases just save typing later, and the alias names should
8152 # be self explanatory.
8153 #
8154 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
8155 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
8156  allow-all-cookies  = -crunch-all-cookies -session-cookies-only
8157  allow-popups       = -filter{all-popups}
8158 +block-as-image     = +block{Blocked as image.} +handle-as-image
8159 -block-as-image     = -block
8160
8161 # These aliases define combinations of actions that are useful for
8162 # certain types of sites:
8163 #
8164 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer
8165 shop        = -crunch-all-cookies allow-popups
8166
8167 # Allow ads for selected useful free sites:
8168 #
8169 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
8170
8171 # Alias for specific file types that are text, but might have conflicting
8172 # MIME types. We want the browser to force these to be text documents.
8173 handle-as-text = -<A
8174 HREF="actions-file.html#FILTER"
8175 >filter</A
8176 > +-<A
8177 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
8178 >content-type-overwrite{text/plain}</A
8179 > +-<A
8180 HREF="actions-file.html#FORCE-TEXT-MODE"
8181 >force-text-mode</A
8182 > -<A
8183 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
8184 >hide-content-disposition</A
8185 ></PRE
8186 ></TD
8187 ></TR
8188 ></TABLE
8189 ><P
8190 > Say you have accounts on some sites that you visit regularly, and
8191  you don't want to have to log in manually each time. So you'd like
8192  to allow persistent cookies for these sites. The
8193  <TT
8194 CLASS="LITERAL"
8195 >allow-all-cookies</TT
8196 > alias defined above does exactly
8197  that, i.e. it disables crunching of cookies in any direction, and the
8198  processing of cookies to make them only temporary.</P
8199 ><TABLE
8200 BORDER="0"
8201 BGCOLOR="#E0E0E0"
8202 WIDTH="100%"
8203 ><TR
8204 ><TD
8205 ><PRE
8206 CLASS="SCREEN"
8207 >{ allow-all-cookies }
8208  sourceforge.net
8209  .yahoo.com
8210  .msdn.microsoft.com
8211  .redhat.com</PRE
8212 ></TD
8213 ></TR
8214 ></TABLE
8215 ><P
8216 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
8217 ><TABLE
8218 BORDER="0"
8219 BGCOLOR="#E0E0E0"
8220 WIDTH="100%"
8221 ><TR
8222 ><TD
8223 ><PRE
8224 CLASS="SCREEN"
8225 >{ -<A
8226 HREF="actions-file.html#FILTER"
8227 >filter</A
8228 > }
8229  .your-home-banking-site.com</PRE
8230 ></TD
8231 ></TR
8232 ></TABLE
8233 ><P
8234 > Some file types you may not want to filter for various reasons:</P
8235 ><TABLE
8236 BORDER="0"
8237 BGCOLOR="#E0E0E0"
8238 WIDTH="100%"
8239 ><TR
8240 ><TD
8241 ><PRE
8242 CLASS="SCREEN"
8243 ># Technical documentation is likely to contain strings that might
8244 # erroneously get altered by the JavaScript-oriented filters:
8245 #
8246 .tldp.org
8247 /(.*/)?selfhtml/
8248
8249 # And this stupid host sends streaming video with a wrong MIME type,
8250 # so that Privoxy thinks it is getting HTML and starts filtering:
8251 #
8252 stupid-server.example.com/</PRE
8253 ></TD
8254 ></TR
8255 ></TABLE
8256 ><P
8257 > Example of a simple <A
8258 HREF="actions-file.html#BLOCK"
8259 >block</A
8260 > action. Say you've
8261  seen an ad on your favourite page on example.com that you want to get rid of.
8262  You have right-clicked the image, selected <SPAN
8263 CLASS="QUOTE"
8264 >"copy image location"</SPAN
8265 >
8266  and pasted the URL below while removing the leading http://, into a
8267  <TT
8268 CLASS="LITERAL"
8269 >{ +block{} }</TT
8270 > section. Note that <TT
8271 CLASS="LITERAL"
8272 >{ +handle-as-image
8273  }</TT
8274 > need not be specified, since all URLs ending in
8275  <TT
8276 CLASS="LITERAL"
8277 >.gif</TT
8278 > will be tagged as images by the general rules as set
8279  in default.action anyway:</P
8280 ><TABLE
8281 BORDER="0"
8282 BGCOLOR="#E0E0E0"
8283 WIDTH="100%"
8284 ><TR
8285 ><TD
8286 ><PRE
8287 CLASS="SCREEN"
8288 >{ +<A
8289 HREF="actions-file.html#BLOCK"
8290 >block</A
8291 >{Nasty ads.} }
8292  www.example.com/nasty-ads/sponsor\.gif
8293  another.example.net/more/junk/here/</PRE
8294 ></TD
8295 ></TR
8296 ></TABLE
8297 ><P
8298 > The URLs of dynamically generated banners, especially from large banner
8299  farms, often don't use the well-known image file name extensions, which
8300  makes it impossible for <SPAN
8301 CLASS="APPLICATION"
8302 >Privoxy</SPAN
8303 > to guess
8304  the file type just by looking at the URL.
8305  You can use the <TT
8306 CLASS="LITERAL"
8307 >+block-as-image</TT
8308 > alias defined above for
8309  these cases.
8310  Note that objects which match this rule but then turn out NOT to be an
8311  image are typically rendered as a <SPAN
8312 CLASS="QUOTE"
8313 >"broken image"</SPAN
8314 > icon by the
8315  browser. Use cautiously.</P
8316 ><TABLE
8317 BORDER="0"
8318 BGCOLOR="#E0E0E0"
8319 WIDTH="100%"
8320 ><TR
8321 ><TD
8322 ><PRE
8323 CLASS="SCREEN"
8324 >{ +block-as-image }
8325  .doubleclick.net
8326  .fastclick.net
8327  /Realmedia/ads/
8328  ar.atwola.com/</PRE
8329 ></TD
8330 ></TR
8331 ></TABLE
8332 ><P
8333 > Now you noticed that the default configuration breaks Forbes Magazine,
8334  but you were too lazy to find out which action is the culprit, and you
8335  were again too lazy to give <A
8336 HREF="contact.html"
8337 >feedback</A
8338 >, so
8339  you just used the <TT
8340 CLASS="LITERAL"
8341 >fragile</TT
8342 > alias on the site, and
8343  -- <SPAN
8344 CLASS="emphasis"
8345 ><I
8346 CLASS="EMPHASIS"
8347 >whoa!</I
8348 ></SPAN
8349 > -- it worked. The <TT
8350 CLASS="LITERAL"
8351 >fragile</TT
8352 >
8353  aliases disables those actions that are most likely to break a site. Also,
8354  good for testing purposes to see if it is <SPAN
8355 CLASS="APPLICATION"
8356 >Privoxy</SPAN
8357 >
8358  that is causing the problem or not. We later find other regular sites
8359  that misbehave, and add those to our personalized list of troublemakers:</P
8360 ><TABLE
8361 BORDER="0"
8362 BGCOLOR="#E0E0E0"
8363 WIDTH="100%"
8364 ><TR
8365 ><TD
8366 ><PRE
8367 CLASS="SCREEN"
8368 >{ fragile }
8369  .forbes.com
8370  webmail.example.com
8371  .mybank.com</PRE
8372 ></TD
8373 ></TR
8374 ></TABLE
8375 ><P
8376 > You like the <SPAN
8377 CLASS="QUOTE"
8378 >"fun"</SPAN
8379 > text replacements in <TT
8380 CLASS="FILENAME"
8381 >default.filter</TT
8382 >,
8383  but it is disabled in the distributed actions file.
8384  So you'd like to turn it on in your private,
8385  update-safe config, once and for all:</P
8386 ><TABLE
8387 BORDER="0"
8388 BGCOLOR="#E0E0E0"
8389 WIDTH="100%"
8390 ><TR
8391 ><TD
8392 ><PRE
8393 CLASS="SCREEN"
8394 >{ +<A
8395 HREF="actions-file.html#FILTER-FUN"
8396 >filter{fun}</A
8397 > }
8398  / # For ALL sites!</PRE
8399 ></TD
8400 ></TR
8401 ></TABLE
8402 ><P
8403 > Note that the above is not really a good idea: There are exceptions
8404  to the filters in <TT
8405 CLASS="FILENAME"
8406 >default.action</TT
8407 > for things that
8408  really shouldn't be filtered, like code on CVS-&#62;Web interfaces. Since
8409  <TT
8410 CLASS="FILENAME"
8411 >user.action</TT
8412 > has the last word, these exceptions
8413  won't be valid for the <SPAN
8414 CLASS="QUOTE"
8415 >"fun"</SPAN
8416 > filtering specified here.</P
8417 ><P
8418 > You might also worry about how your favourite free websites are
8419  funded, and find that they rely on displaying banner advertisements
8420  to survive. So you might want to specifically allow banners for those
8421  sites that you feel provide value to you:</P
8422 ><TABLE
8423 BORDER="0"
8424 BGCOLOR="#E0E0E0"
8425 WIDTH="100%"
8426 ><TR
8427 ><TD
8428 ><PRE
8429 CLASS="SCREEN"
8430 >{ allow-ads }
8431  .sourceforge.net
8432  .slashdot.org
8433  .osdn.net</PRE
8434 ></TD
8435 ></TR
8436 ></TABLE
8437 ><P
8438 > Note that <TT
8439 CLASS="LITERAL"
8440 >allow-ads</TT
8441 > has been aliased to
8442  <TT
8443 CLASS="LITERAL"
8444 >-<A
8445 HREF="actions-file.html#BLOCK"
8446 >block</A
8447 ></TT
8448 >,
8449  <TT
8450 CLASS="LITERAL"
8451 >-<A
8452 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
8453 >filter{banners-by-size}</A
8454 ></TT
8455 >, and
8456  <TT
8457 CLASS="LITERAL"
8458 >-<A
8459 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
8460 >filter{banners-by-link}</A
8461 ></TT
8462 > above.</P
8463 ><P
8464 > Invoke another alias here to force an over-ride of the MIME type <TT
8465 CLASS="LITERAL"
8466 > application/x-sh</TT
8467 > which typically would open a download type
8468  dialog. In my case, I want to look at the shell script, and then I can save
8469  it should I choose to.</P
8470 ><TABLE
8471 BORDER="0"
8472 BGCOLOR="#E0E0E0"
8473 WIDTH="100%"
8474 ><TR
8475 ><TD
8476 ><PRE
8477 CLASS="SCREEN"
8478 >{ handle-as-text }
8479  /.*\.sh$</PRE
8480 ></TD
8481 ></TR
8482 ></TABLE
8483 ><P
8484 > <TT
8485 CLASS="FILENAME"
8486 >user.action</TT
8487 > is generally the best place to define
8488  exceptions and additions to the default policies of
8489  <TT
8490 CLASS="FILENAME"
8491 >default.action</TT
8492 >. Some actions are safe to have their
8493  default policies set here though. So let's set a default policy to have a
8494  <SPAN
8495 CLASS="QUOTE"
8496 >"blank"</SPAN
8497 > image as opposed to the checkerboard pattern for
8498  <SPAN
8499 CLASS="emphasis"
8500 ><I
8501 CLASS="EMPHASIS"
8502 >ALL</I
8503 ></SPAN
8504 > sites. <SPAN
8505 CLASS="QUOTE"
8506 >"/"</SPAN
8507 > of course matches all URL
8508  paths and patterns:</P
8509 ><TABLE
8510 BORDER="0"
8511 BGCOLOR="#E0E0E0"
8512 WIDTH="100%"
8513 ><TR
8514 ><TD
8515 ><PRE
8516 CLASS="SCREEN"
8517 >{ +<A
8518 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8519 >set-image-blocker{blank}</A
8520 > }
8521 / # ALL sites</PRE
8522 ></TD
8523 ></TR
8524 ></TABLE
8525 ></DIV
8526 ></DIV
8527 ></DIV
8528 ><DIV
8529 CLASS="NAVFOOTER"
8530 ><HR
8531 ALIGN="LEFT"
8532 WIDTH="100%"><TABLE
8533 SUMMARY="Footer navigation table"
8534 WIDTH="100%"
8535 BORDER="0"
8536 CELLPADDING="0"
8537 CELLSPACING="0"
8538 ><TR
8539 ><TD
8540 WIDTH="33%"
8541 ALIGN="left"
8542 VALIGN="top"
8543 ><A
8544 HREF="config.html"
8545 ACCESSKEY="P"
8546 >Prev</A
8547 ></TD
8548 ><TD
8549 WIDTH="34%"
8550 ALIGN="center"
8551 VALIGN="top"
8552 ><A
8553 HREF="index.html"
8554 ACCESSKEY="H"
8555 >Home</A
8556 ></TD
8557 ><TD
8558 WIDTH="33%"
8559 ALIGN="right"
8560 VALIGN="top"
8561 ><A
8562 HREF="filter-file.html"
8563 ACCESSKEY="N"
8564 >Next</A
8565 ></TD
8566 ></TR
8567 ><TR
8568 ><TD
8569 WIDTH="33%"
8570 ALIGN="left"
8571 VALIGN="top"
8572 >The Main Configuration File</TD
8573 ><TD
8574 WIDTH="34%"
8575 ALIGN="center"
8576 VALIGN="top"
8577 >&nbsp;</TD
8578 ><TD
8579 WIDTH="33%"
8580 ALIGN="right"
8581 VALIGN="top"
8582 >Filter Files</TD
8583 ></TR
8584 ></TABLE
8585 ></DIV
8586 ></BODY
8587 ></HTML
8588 >