1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <title>Actions Files</title>
7 <meta name="GENERATOR" content=
8 "Modular DocBook HTML Stylesheet Version 1.79">
9 <link rel="HOME" title="Privoxy 3.0.20 User Manual" href="index.html">
10 <link rel="PREVIOUS" title="The Main Configuration File" href=
12 <link rel="NEXT" title="Filter Files" href="filter-file.html">
13 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
14 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
15 <link rel="STYLESHEET" type="text/css" href="p_doc.css">
18 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
19 "#840084" alink="#0000FF">
20 <div class="NAVHEADER">
21 <table summary="Header navigation table" width="100%" border="0"
22 cellpadding="0" cellspacing="0">
24 <th colspan="3" align="center">Privoxy 3.0.20 User Manual</th>
28 <td width="10%" align="left" valign="bottom"><a href="config.html"
29 accesskey="P">Prev</a></td>
31 <td width="80%" align="center" valign="bottom"></td>
33 <td width="10%" align="right" valign="bottom"><a href=
34 "filter-file.html" accesskey="N">Next</a></td>
37 <hr align="left" width="100%">
41 <h1 class="SECT1"><a name="ACTIONS-FILE" id="ACTIONS-FILE">8. Actions
44 <p>The actions files are used to define what <span class=
45 "emphasis"><i class="EMPHASIS">actions</i></span> <span class=
46 "APPLICATION">Privoxy</span> takes for which URLs, and thus determines
47 how ad images, cookies and various other aspects of HTTP content and
48 transactions are handled, and on which sites (or even parts thereof).
49 There are a number of such actions, with a wide range of functionality.
50 Each action does something a little different. These actions give us a
51 veritable arsenal of tools with which to exert our control, preferences
52 and independence. Actions can be combined so that their effects are
53 aggregated when applied against a given set of URLs.</p>
55 <p>There are three action files included with <span class=
56 "APPLICATION">Privoxy</span> with differing purposes:</p>
60 <p><tt class="FILENAME">match-all.action</tt> - is used to define
61 which <span class="QUOTE">"actions"</span> relating to
62 banner-blocking, images, pop-ups, content modification, cookie
63 handling etc should be applied by default. It should be the first
64 actions file loaded</p>
68 <p><tt class="FILENAME">default.action</tt> - defines many exceptions
69 (both positive and negative) from the default set of actions that's
70 configured in <tt class="FILENAME">match-all.action</tt>. It is a set
71 of rules that should work reasonably well as-is for most users. This
72 file is only supposed to be edited by the developers. It should be
73 the second actions file loaded.</p>
77 <p><tt class="FILENAME">user.action</tt> - is intended to be for
78 local site preferences and exceptions. As an example, if your ISP or
79 your bank has specific requirements, and need special handling, this
80 kind of thing should go here. This file will not be upgraded.</p>
84 <p><span class="GUIBUTTON">Edit</span> <span class="GUIBUTTON">Set to
85 Cautious</span> <span class="GUIBUTTON">Set to Medium</span>
86 <span class="GUIBUTTON">Set to Advanced</span></p>
88 <p>These have increasing levels of aggressiveness <span class=
89 "emphasis"><i class="EMPHASIS">and have no influence on your browsing
90 unless you select them explicitly in the editor</i></span>. A default
91 installation should be pre-set to <tt class="LITERAL">Cautious</tt>.
92 New users should try this for a while before adjusting the settings
93 to more aggressive levels. The more aggressive the settings, then the
94 more likelihood there is of problems such as sites not working as
97 <p>The <span class="GUIBUTTON">Edit</span> button allows you to turn
98 each action on/off individually for fine-tuning. The <span class=
99 "GUIBUTTON">Cautious</span> button changes the actions list to
100 low/safe settings which will activate ad blocking and a minimal set
101 of <span class="APPLICATION">Privoxy</span>'s features, and
102 subsequently there will be less of a chance for accidental problems.
103 The <span class="GUIBUTTON">Medium</span> button sets the list to a
104 medium level of other features and a low level set of privacy
105 features. The <span class="GUIBUTTON">Advanced</span> button sets the
106 list to a high level of ad blocking and medium level of privacy. See
107 the chart below. The latter three buttons over-ride any changes via
108 with the <span class="GUIBUTTON">Edit</span> button. More fine-tuning
109 can be done in the lower sections of this internal page.</p>
111 <p>While the actions file editor allows to enable these settings in
112 all actions files, they are only supposed to be enabled in the first
113 one to make sure you don't unintentionally overrule earlier
116 <p>The default profiles, and their associated actions, as pre-defined
117 in <tt class="FILENAME">default.action</tt> are:</p>
120 <a name="AEN2774" id="AEN2774"></a>
122 <p><b>Table 1. Default Configurations</b></p>
124 <table border="1" frame="border" rules="all" class="CALSTABLE">
125 <col width="1*" title="C1">
126 <col width="1*" title="C2">
127 <col width="1*" title="C3">
128 <col width="1*" title="C4">
144 <td>Ad-blocking Aggressiveness</td>
154 <td>Ad-filtering by size</td>
164 <td>Ad-filtering by link</td>
174 <td>Pop-up killing</td>
184 <td>Privacy Features</td>
194 <td>Cookie handling</td>
198 <td>session-only</td>
204 <td>Referer forging</td>
214 <td>GIF de-animation</td>
224 <td>Fast redirects</td>
244 <td>JavaScript taming</td>
254 <td>Web-bug killing</td>
264 <td>Image tag reordering</td>
278 <p>The list of actions files to be used are defined in the main
279 configuration file, and are processed in the order they are defined (e.g.
280 <tt class="FILENAME">default.action</tt> is typically processed before
281 <tt class="FILENAME">user.action</tt>). The content of these can all be
282 viewed and edited from <a href="http://config.privoxy.org/show-status"
283 target="_top">http://config.privoxy.org/show-status</a>. The over-riding
284 principle when applying actions, is that the last action that matches a
285 given URL wins. The broadest, most general rules go first (defined in
286 <tt class="FILENAME">default.action</tt>), followed by any exceptions
287 (typically also in <tt class="FILENAME">default.action</tt>), which are
288 then followed lastly by any local preferences (typically in <span class=
289 "emphasis"><i class="EMPHASIS">user</i></span><tt class=
290 "FILENAME">.action</tt>). Generally, <tt class=
291 "FILENAME">user.action</tt> has the last word.</p>
293 <p>An actions file typically has multiple sections. If you want to use
294 <span class="QUOTE">"aliases"</span> in an actions file, you have to
295 place the (optional) <a href="actions-file.html#ALIASES">alias
296 section</a> at the top of that file. Then comes the default set of rules
297 which will apply universally to all sites and pages (be <span class=
298 "emphasis"><i class="EMPHASIS">very careful</i></span> with using such a
299 universal set in <tt class="FILENAME">user.action</tt> or any other
300 actions file after <tt class="FILENAME">default.action</tt>, because it
301 will override the result from consulting any previous file). And then
302 below that, exceptions to the defined universal policies. You can regard
303 <tt class="FILENAME">user.action</tt> as an appendix to <tt class=
304 "FILENAME">default.action</tt>, with the advantage that it is a separate
305 file, which makes preserving your personal settings across <span class=
306 "APPLICATION">Privoxy</span> upgrades easier.</p>
308 <p>Actions can be used to block anything you want, including ads,
309 banners, or just some obnoxious URL whose content you would rather not
310 see. Cookies can be accepted or rejected, or accepted only during the
311 current browser session (i.e. not written to disk), content can be
312 modified, some JavaScripts tamed, user-tracking fooled, and much more.
313 See below for a <a href="actions-file.html#ACTIONS">complete list of
317 <h2 class="SECT2"><a name="AEN2873" id="AEN2873">8.1. Finding the Right
320 <p>Note that some <a href="actions-file.html#ACTIONS">actions</a>, like
321 cookie suppression or script disabling, may render some sites unusable
322 that rely on these techniques to work properly. Finding the right mix
323 of actions is not always easy and certainly a matter of personal taste.
324 And, things can always change, requiring refinements in the
325 configuration. In general, it can be said that the more <span class=
326 "QUOTE">"aggressive"</span> your default settings (in the top section
327 of the actions file) are, the more exceptions for <span class=
328 "QUOTE">"trusted"</span> sites you will have to make later. If, for
329 example, you want to crunch all cookies per default, you'll have to
330 make exceptions from that rule for sites that you regularly use and
331 that require cookies for actually useful purposes, like maybe your
332 bank, favorite shop, or newspaper.</p>
334 <p>We have tried to provide you with reasonable rules to start from in
335 the distribution actions files. But there is no general rule of thumb
336 on these things. There just are too many variables, and sites are
337 constantly changing. Sooner or later you will want to change the rules
338 (and read this chapter again :).</p>
342 <h2 class="SECT2"><a name="AEN2880" id="AEN2880">8.2. How to
345 <p>The easiest way to edit the actions files is with a browser by using
346 our browser-based editor, which can be reached from <a href=
347 "http://config.privoxy.org/show-status" target=
348 "_top">http://config.privoxy.org/show-status</a>. Note: the config file
350 "config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions</a> must be
351 enabled for this to work. The editor allows both fine-grained control
352 over every single feature on a per-URL basis, and easy choosing from
353 wholesale sets of defaults like <span class="QUOTE">"Cautious"</span>,
354 <span class="QUOTE">"Medium"</span> or <span class=
355 "QUOTE">"Advanced"</span>. Warning: the <span class=
356 "QUOTE">"Advanced"</span> setting is more aggressive, and will be more
357 likely to cause problems for some sites. Experienced users only!</p>
359 <p>If you prefer plain text editing to GUIs, you can of course also
360 directly edit the the actions files with your favorite text editor.
361 Look at <tt class="FILENAME">default.action</tt> which is richly
362 commented with many good examples.</p>
366 <h2 class="SECT2"><a name="ACTIONS-APPLY" id="ACTIONS-APPLY">8.3. How
367 Actions are Applied to Requests</a></h2>
369 <p>Actions files are divided into sections. There are special sections,
370 like the <span class="QUOTE">"<a href=
371 "actions-file.html#ALIASES">alias</a>"</span> sections which will be
372 discussed later. For now let's concentrate on regular sections: They
373 have a heading line (often split up to multiple lines for readability)
374 which consist of a list of actions, separated by whitespace and
375 enclosed in curly braces. Below that, there is a list of URL and tag
376 patterns, each on a separate line.</p>
378 <p>To determine which actions apply to a request, the URL of the
379 request is compared to all URL patterns in each <span class=
380 "QUOTE">"action file"</span>. Every time it matches, the list of
381 applicable actions for the request is incrementally updated, using the
382 heading of the section in which the pattern is located. The same is
383 done again for tags and tag patterns later on.</p>
385 <p>If multiple applying sections set the same action differently, the
386 last match wins. If not, the effects are aggregated. E.g. a URL might
387 match a regular section with a heading line of <tt class="LITERAL">{
388 +<a href="actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a>
389 }</tt>, then later another one with just <tt class="LITERAL">{
390 +<a href="actions-file.html#BLOCK">block</a> }</tt>, resulting in
391 <span class="emphasis"><i class="EMPHASIS">both</i></span> actions to
392 apply. And there may well be cases where you will want to combine
393 actions together. Such a section then might look like:</p>
395 <table border="0" bgcolor="#E0E0E0" width="100%">
399 { +<tt class="LITERAL">handle-as-image</tt> +<tt class=
400 "LITERAL">block{Banner ads.}</tt> }
401 # Block these as if they were images. Send no block page.
403 media.example.com/.*banners
404 .example.com/images/ads/
410 <p>You can trace this process for URL patterns and any given URL by
411 visiting <a href="http://config.privoxy.org/show-url-info" target=
412 "_top">http://config.privoxy.org/show-url-info</a>.</p>
414 <p>Examples and more detail on this is provided in the Appendix,
415 <a href="appendix.html#ACTIONSANAT">Troubleshooting: Anatomy of an
416 Action</a> section.</p>
420 <h2 class="SECT2"><a name="AF-PATTERNS" id="AF-PATTERNS">8.4.
423 <p>As mentioned, <span class="APPLICATION">Privoxy</span> uses
424 <span class="QUOTE">"patterns"</span> to determine what <span class=
425 "emphasis"><i class="EMPHASIS">actions</i></span> might apply to which
426 sites and pages your browser attempts to access. These <span class=
427 "QUOTE">"patterns"</span> use wild card type <span class=
428 "emphasis"><i class="EMPHASIS">pattern</i></span> matching to achieve a
429 high degree of flexibility. This allows one expression to be expanded
430 and potentially match against many similar patterns.</p>
432 <p>Generally, an URL pattern has the form <tt class=
433 "LITERAL"><domain><port>/<path></tt>, where the
434 <tt class="LITERAL"><domain></tt>, the <tt class=
435 "LITERAL"><port></tt> and the <tt class=
436 "LITERAL"><path></tt> are optional. (This is why the special
437 <tt class="LITERAL">/</tt> pattern matches all URLs). Note that the
438 protocol portion of the URL pattern (e.g. <tt class=
439 "LITERAL">http://</tt>) should <span class="emphasis"><i class=
440 "EMPHASIS">not</i></span> be included in the pattern. This is assumed
443 <p>The pattern matching syntax is different for the domain and path
444 parts of the URL. The domain part uses a simple globbing type matching
445 technique, while the path part uses more flexible <a href=
446 "http://en.wikipedia.org/wiki/Regular_expressions" target=
447 "_top"><span class="QUOTE">"Regular Expressions"</span></a> (POSIX
450 <p>The port part of a pattern is a decimal port number preceded by a
451 colon (<tt class="LITERAL">:</tt>). If the domain part contains a
452 numerical IPv6 address, it has to be put into angle brackets
453 (<tt class="LITERAL"><</tt>, <tt class="LITERAL">></tt>).</p>
455 <div class="VARIABLELIST">
457 <dt><tt class="LITERAL">www.example.com/</tt></dt>
460 <p>is a domain-only pattern and will match any request to
461 <tt class="LITERAL">www.example.com</tt>, regardless of which
462 document on that server is requested. So ALL pages in this domain
463 would be covered by the scope of this action. Note that a simple
464 <tt class="LITERAL">example.com</tt> is different and would NOT
468 <dt><tt class="LITERAL">www.example.com</tt></dt>
471 <p>means exactly the same. For domain-only patterns, the trailing
472 <tt class="LITERAL">/</tt> may be omitted.</p>
475 <dt><tt class="LITERAL">www.example.com/index.html</tt></dt>
478 <p>matches all the documents on <tt class=
479 "LITERAL">www.example.com</tt> whose name starts with <tt class=
480 "LITERAL">/index.html</tt>.</p>
483 <dt><tt class="LITERAL">www.example.com/index.html$</tt></dt>
486 <p>matches only the single document <tt class=
487 "LITERAL">/index.html</tt> on <tt class=
488 "LITERAL">www.example.com</tt>.</p>
491 <dt><tt class="LITERAL">/index.html$</tt></dt>
494 <p>matches the document <tt class="LITERAL">/index.html</tt>,
495 regardless of the domain, i.e. on <span class=
496 "emphasis"><i class="EMPHASIS">any</i></span> web server
500 <dt><tt class="LITERAL">/</tt></dt>
503 <p>Matches any URL because there's no requirement for either the
504 domain or the path to match anything.</p>
507 <dt><tt class="LITERAL">:8000/</tt></dt>
510 <p>Matches any URL pointing to TCP port 8000.</p>
513 <dt><tt class="LITERAL"><2001:db8::1>/</tt></dt>
516 <p>Matches any URL with the host address <tt class=
517 "LITERAL">2001:db8::1</tt>. (Note that the real URL uses plain
518 brackets, not angle brackets.)</p>
521 <dt><tt class="LITERAL">index.html</tt></dt>
524 <p>matches nothing, since it would be interpreted as a domain
525 name and there is no top-level domain called <tt class=
526 "LITERAL">.html</tt>. So its a mistake.</p>
532 <h3 class="SECT3"><a name="AEN2992" id="AEN2992">8.4.1. The Domain
535 <p>The matching of the domain part offers some flexible options: if
536 the domain starts or ends with a dot, it becomes unanchored at that
537 end. For example:</p>
539 <div class="VARIABLELIST">
541 <dt><tt class="LITERAL">.example.com</tt></dt>
544 <p>matches any domain with first-level domain <tt class=
545 "LITERAL">com</tt> and second-level domain <tt class=
546 "LITERAL">example</tt>. For example <tt class=
547 "LITERAL">www.example.com</tt>, <tt class=
548 "LITERAL">example.com</tt> and <tt class=
549 "LITERAL">foo.bar.baz.example.com</tt>. Note that it wouldn't
550 match if the second-level domain was <tt class=
551 "LITERAL">another-example</tt>.</p>
554 <dt><tt class="LITERAL">www.</tt></dt>
557 <p>matches any domain that <span class="emphasis"><i class=
558 "EMPHASIS">STARTS</i></span> with <tt class="LITERAL">www.</tt>
559 (It also matches the domain <tt class="LITERAL">www</tt> but
560 most of the time that doesn't matter.)</p>
563 <dt><tt class="LITERAL">.example.</tt></dt>
566 <p>matches any domain that <span class="emphasis"><i class=
567 "EMPHASIS">CONTAINS</i></span> <tt class=
568 "LITERAL">.example.</tt>. And, by the way, also included would
569 be any files or documents that exist within that domain since
570 no path limitations are specified. (Correctly speaking: It
571 matches any FQDN that contains <tt class="LITERAL">example</tt>
572 as a domain.) This might be <tt class=
573 "LITERAL">www.example.com</tt>, <tt class=
574 "LITERAL">news.example.de</tt>, or <tt class=
575 "LITERAL">www.example.net/cgi/testing.pl</tt> for instance. All
576 these cases are matched.</p>
581 <p>Additionally, there are wild-cards that you can use in the domain
582 names themselves. These work similarly to shell globbing type
583 wild-cards: <span class="QUOTE">"*"</span> represents zero or more
584 arbitrary characters (this is equivalent to the <a href=
585 "http://en.wikipedia.org/wiki/Regular_expressions" target=
586 "_top"><span class="QUOTE">"Regular Expression"</span></a> based
587 syntax of <span class="QUOTE">".*"</span>), <span class=
588 "QUOTE">"?"</span> represents any single character (this is
589 equivalent to the regular expression syntax of a simple <span class=
590 "QUOTE">"."</span>), and you can define <span class=
591 "QUOTE">"character classes"</span> in square brackets which is
592 similar to the same regular expression technique. All of this can be
595 <div class="VARIABLELIST">
597 <dt><tt class="LITERAL">ad*.example.com</tt></dt>
600 <p>matches <span class="QUOTE">"adserver.example.com"</span>,
601 <span class="QUOTE">"ads.example.com"</span>, etc but not
602 <span class="QUOTE">"sfads.example.com"</span></p>
605 <dt><tt class="LITERAL">*ad*.example.com</tt></dt>
608 <p>matches all of the above, and then some.</p>
611 <dt><tt class="LITERAL">.?pix.com</tt></dt>
614 <p>matches <tt class="LITERAL">www.ipix.com</tt>, <tt class=
615 "LITERAL">pictures.epix.com</tt>, <tt class=
616 "LITERAL">a.b.c.d.e.upix.com</tt> etc.</p>
619 <dt><tt class="LITERAL">www[1-9a-ez].example.c*</tt></dt>
622 <p>matches <tt class="LITERAL">www1.example.com</tt>,
623 <tt class="LITERAL">www4.example.cc</tt>, <tt class=
624 "LITERAL">wwwd.example.cy</tt>, <tt class=
625 "LITERAL">wwwz.example.com</tt> etc., but <span class=
626 "emphasis"><i class="EMPHASIS">not</i></span> <tt class=
627 "LITERAL">wwww.example.com</tt>.</p>
632 <p>While flexible, this is not the sophistication of full regular
633 expression based syntax.</p>
637 <h3 class="SECT3"><a name="AEN3068" id="AEN3068">8.4.2. The Path
640 <p><span class="APPLICATION">Privoxy</span> uses <span class=
641 "QUOTE">"modern"</span> POSIX 1003.2 <a href=
642 "http://en.wikipedia.org/wiki/Regular_expressions" target=
643 "_top"><span class="QUOTE">"Regular Expressions"</span></a> for
644 matching the path portion (after the slash), and is thus more
647 <p>There is an <a href="appendix.html#REGEX">Appendix</a> with a
648 brief quick-start into regular expressions, you also might want to
649 have a look at your operating system's documentation on regular
650 expressions (try <tt class="LITERAL">man re_format</tt>).</p>
652 <p>Note that the path pattern is automatically left-anchored at the
653 <span class="QUOTE">"/"</span>, i.e. it matches as if it would start
654 with a <span class="QUOTE">"^"</span> (regular expression speak for
655 the beginning of a line).</p>
657 <p>Please also note that matching in the path is <span class=
658 "emphasis"><i class="EMPHASIS">CASE INSENSITIVE</i></span> by
659 default, but you can switch to case sensitive at any point in the
660 pattern by using the <span class="QUOTE">"(?-i)"</span> switch:
661 <tt class="LITERAL">www.example.com/(?-i)PaTtErN.*</tt> will match
662 only documents whose path starts with <tt class=
663 "LITERAL">PaTtErN</tt> in <span class="emphasis"><i class=
664 "EMPHASIS">exactly</i></span> this capitalization.</p>
666 <div class="VARIABLELIST">
668 <dt><tt class="LITERAL">.example.com/.*</tt></dt>
671 <p>Is equivalent to just <span class=
672 "QUOTE">".example.com"</span>, since any documents within that
673 domain are matched with or without the <span class=
674 "QUOTE">".*"</span> regular expression. This is redundant</p>
677 <dt><tt class="LITERAL">.example.com/.*/index.html$</tt></dt>
680 <p>Will match any page in the domain of <span class=
681 "QUOTE">"example.com"</span> that is named <span class=
682 "QUOTE">"index.html"</span>, and that is part of some path. For
683 example, it matches <span class=
684 "QUOTE">"www.example.com/testing/index.html"</span> but NOT
685 <span class="QUOTE">"www.example.com/index.html"</span> because
686 the regular expression called for at least two <span class=
687 "QUOTE">"/'s"</span>, thus the path requirement. It also would
689 "QUOTE">"www.example.com/testing/index_html"</span>, because of
690 the special meta-character <span class="QUOTE">"."</span>.</p>
693 <dt><tt class="LITERAL">.example.com/(.*/)?index\.html$</tt></dt>
696 <p>This regular expression is conditional so it will match any
697 page named <span class="QUOTE">"index.html"</span> regardless
698 of path which in this case can have one or more <span class=
699 "QUOTE">"/'s"</span>. And this one must contain exactly
700 <span class="QUOTE">".html"</span> (but does not have to end
705 "LITERAL">.example.com/(.*/)(ads|banners?|junk)</tt></dt>
708 <p>This regular expression will match any path of <span class=
709 "QUOTE">"example.com"</span> that contains any of the words
710 <span class="QUOTE">"ads"</span>, <span class=
711 "QUOTE">"banner"</span>, <span class="QUOTE">"banners"</span>
712 (because of the <span class="QUOTE">"?"</span>) or <span class=
713 "QUOTE">"junk"</span>. The path does not have to end in these
714 words, just contain them.</p>
718 "LITERAL">.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</tt></dt>
721 <p>This is very much the same as above, except now it must end
722 in either <span class="QUOTE">".jpg"</span>, <span class=
723 "QUOTE">".jpeg"</span>, <span class="QUOTE">".gif"</span> or
724 <span class="QUOTE">".png"</span>. So this one is limited to
725 common image formats.</p>
730 <p>There are many, many good examples to be found in <tt class=
731 "FILENAME">default.action</tt>, and more tutorials below in <a href=
732 "appendix.html#REGEX">Appendix on regular expressions</a>.</p>
736 <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The
739 <p>Tag patterns are used to change the applying actions based on the
740 request's tags. Tags can be created with either the <a href=
741 "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or
743 "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
746 <p>Tag patterns have to start with <span class="QUOTE">"TAG:"</span>,
747 so <span class="APPLICATION">Privoxy</span> can tell them apart from
748 URL patterns. Everything after the colon including white space, is
749 interpreted as a regular expression with path pattern syntax, except
750 that tag patterns aren't left-anchored automatically (<span class=
751 "APPLICATION">Privoxy</span> doesn't silently add a <span class=
752 "QUOTE">"^"</span>, you have to do it yourself if you need it).</p>
754 <p>To match all requests that are tagged with <span class=
755 "QUOTE">"foo"</span> your pattern line should be <span class=
756 "QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span>
757 would work as well, but it would also match requests whose tags
758 contain <span class="QUOTE">"foo"</span> somewhere. <span class=
759 "QUOTE">"TAG: foo"</span> wouldn't work as it requires white
762 <p>Sections can contain URL and tag patterns at the same time, but
763 tag patterns are checked after the URL patterns and thus always
764 overrule them, even if they are located before the URL patterns.</p>
766 <p>Once a new tag is added, Privoxy checks right away if it's matched
767 by one of the tag patterns and updates the action settings
768 accordingly. As a result tags can be used to activate other tagger
769 actions, as long as these other taggers look for headers that haven't
770 already be parsed.</p>
772 <p>For example you could tag client requests which use the <tt class=
773 "LITERAL">POST</tt> method, then use this tag to activate another
774 tagger that adds a tag if cookies are sent, and then use a block
775 action based on the cookie tag. This allows the outcome of one
776 action, to be input into a subsequent action. However if you'd
777 reverse the position of the described taggers, and activated the
778 method tagger based on the cookie tagger, no method tags would be
779 created. The method tagger would look for the request line, but at
780 the time the cookie tag is created, the request line has already been
783 <p>While this is a limitation you should be aware of, this kind of
784 indirection is seldom needed anyway and even the example doesn't make
790 <h2 class="SECT2"><a name="ACTIONS" id="ACTIONS">8.5. Actions</a></h2>
792 <p>All actions are disabled by default, until they are explicitly
793 enabled somewhere in an actions file. Actions are turned on if preceded
794 with a <span class="QUOTE">"+"</span>, and turned off if preceded with
795 a <span class="QUOTE">"-"</span>. So a <tt class="LITERAL">+action</tt>
796 means <span class="QUOTE">"do that action"</span>, e.g. <tt class=
797 "LITERAL">+block</tt> means <span class="QUOTE">"please block URLs that
798 match the following patterns"</span>, and <tt class=
799 "LITERAL">-block</tt> means <span class="QUOTE">"don't block URLs that
800 match the following patterns, even if <tt class="LITERAL">+block</tt>
801 previously applied."</span></p>
803 <p>Again, actions are invoked by placing them on a line, enclosed in
804 curly braces and separated by whitespace, like in <tt class=
805 "LITERAL">{+some-action -some-other-action{some-parameter}}</tt>,
806 followed by a list of URL patterns, one per line, to which they apply.
807 Together, the actions line and the following pattern lines make up a
808 section of the actions file.</p>
810 <p>Actions fall into three categories:</p>
814 <p>Boolean, i.e the action can only be <span class=
815 "QUOTE">"enabled"</span> or <span class="QUOTE">"disabled"</span>.
818 <table border="0" bgcolor="#E0E0E0" width="90%">
822 +<tt class="REPLACEABLE"><i>name</i></tt> # enable action <tt class=
823 "REPLACEABLE"><i>name</i></tt>
825 "REPLACEABLE"><i>name</i></tt> # disable action <tt class="REPLACEABLE"><i>name</i></tt>
831 <p>Example: <tt class="LITERAL">+handle-as-image</tt></p>
835 <p>Parameterized, where some value is required in order to enable
836 this type of action. Syntax:</p>
838 <table border="0" bgcolor="#E0E0E0" width="90%">
842 +<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
843 "REPLACEABLE"><i>param</i></tt>} # enable action and set parameter to <tt class="REPLACEABLE"><i>param</i></tt>,
844 # overwriting parameter from previous match if necessary
846 "REPLACEABLE"><i>name</i></tt> # disable action. The parameter can be omitted
852 <p>Note that if the URL matches multiple positive forms of a
853 parameterized action, the last match wins, i.e. the params from
854 earlier matches are simply ignored.</p>
856 <p>Example: <tt class="LITERAL">+hide-user-agent{Mozilla/5.0 (X11;
857 U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602
858 Firefox/2.0.0.4}</tt></p>
862 <p>Multi-value. These look exactly like parameterized actions, but
863 they behave differently: If the action applies multiple times to
864 the same URL, but with different parameters, <span class=
865 "emphasis"><i class="EMPHASIS">all</i></span> the parameters from
866 <span class="emphasis"><i class="EMPHASIS">all</i></span> matches
867 are remembered. This is used for actions that can be executed for
868 the same request repeatedly, like adding multiple headers, or
869 filtering through multiple filters. Syntax:</p>
871 <table border="0" bgcolor="#E0E0E0" width="90%">
875 +<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
876 "REPLACEABLE"><i>param</i></tt>} # enable action and add <tt class=
877 "REPLACEABLE"><i>param</i></tt> to the list of parameters
878 -<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
879 "REPLACEABLE"><i>param</i></tt>} # remove the parameter <tt class=
880 "REPLACEABLE"><i>param</i></tt> from the list of parameters
881 # If it was the last one left, disable the action.
883 "REPLACEABLE"><i>-name</i></tt> # disable this action completely and remove all parameters from the list
889 <p>Examples: <tt class="LITERAL">+add-header{X-Fun-Header: Some
890 text}</tt> and <tt class=
891 "LITERAL">+filter{html-annoyances}</tt></p>
895 <p>If nothing is specified in any actions file, no <span class=
896 "QUOTE">"actions"</span> are taken. So in this case <span class=
897 "APPLICATION">Privoxy</span> would just be a normal, non-blocking,
898 non-filtering proxy. You must specifically enable the privacy and
899 blocking features you need (although the provided default actions files
900 will give a good starting point).</p>
902 <p>Later defined action sections always over-ride earlier ones of the
903 same type. So exceptions to any rules you make, should come in the
904 latter part of the file (or in a file that is processed later when
905 using multiple actions files such as <tt class=
906 "FILENAME">user.action</tt>). For multi-valued actions, the actions are
907 applied in the order they are specified. Actions files are processed in
908 the order they are defined in <tt class="FILENAME">config</tt> (the
909 default installation has three actions files). It also quite possible
910 for any given URL to match more than one <span class=
911 "QUOTE">"pattern"</span> (because of wildcards and regular
912 expressions), and thus to trigger more than one set of actions! Last
915 <p>The list of valid <span class="APPLICATION">Privoxy</span> actions
919 <h4 class="SECT3"><a name="ADD-HEADER" id="ADD-HEADER">8.5.1.
922 <div class="VARIABLELIST">
924 <dt>Typical use:</dt>
927 <p>Confuse log analysis, custom applications</p>
933 <p>Sends a user defined HTTP header to the web server.</p>
945 <p>Any string value is possible. Validity of the defined HTTP
946 headers is not checked. It is recommended that you use the
947 <span class="QUOTE">"<tt class="LITERAL">X-</tt>"</span> prefix
948 for custom headers.</p>
954 <p>This action may be specified multiple times, in order to
955 define multiple headers. This is rarely needed for the typical
956 user. If you don't know what <span class="QUOTE">"HTTP
957 headers"</span> are, you definitely don't need to worry about
960 <p>Headers added by this action are not modified by other
964 <dt>Example usage:</dt>
967 <table border="0" bgcolor="#E0E0E0" width="90%">
971 +add-header{X-User-Tracking: sucks}
982 <h4 class="SECT3"><a name="BLOCK" id="BLOCK">8.5.2. block</a></h4>
984 <div class="VARIABLELIST">
986 <dt>Typical use:</dt>
989 <p>Block ads or other unwanted content</p>
995 <p>Requests for URLs to which this action applies are blocked,
996 i.e. the requests are trapped by <span class=
997 "APPLICATION">Privoxy</span> and the requested URL is never
998 retrieved, but is answered locally with a substitute page or
999 image, as determined by the <tt class="LITERAL"><a href=
1000 "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
1001 <tt class="LITERAL"><a href=
1002 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>,
1003 and <tt class="LITERAL"><a href=
1004 "actions-file.html#HANDLE-AS-EMPTY-DOCUMENT">handle-as-empty-document</a></tt>
1011 <p>Parameterized.</p>
1017 <p>A block reason that should be given to the user.</p>
1023 <p><span class="APPLICATION">Privoxy</span> sends a special
1024 <span class="QUOTE">"BLOCKED"</span> page for requests to
1025 blocked pages. This page contains the block reason given as
1026 parameter, a link to find out why the block action applies, and
1027 a click-through to the blocked content (the latter only if the
1028 force feature is available and enabled).</p>
1030 <p>A very important exception occurs if <span class=
1031 "emphasis"><i class="EMPHASIS">both</i></span> <tt class=
1032 "LITERAL">block</tt> and <tt class="LITERAL"><a href=
1033 "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
1034 apply to the same request: it will then be replaced by an
1035 image. If <tt class="LITERAL"><a href=
1036 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
1037 (see below) also applies, the type of image will be determined
1038 by its parameter, if not, the standard checkerboard pattern is
1041 <p>It is important to understand this process, in order to
1042 understand how <span class="APPLICATION">Privoxy</span> deals
1043 with ads and other unwanted content. Blocking is a core
1044 feature, and one upon which various other features depend.</p>
1046 <p>The <tt class="LITERAL"><a href=
1047 "actions-file.html#FILTER">filter</a></tt> action can perform a
1048 very similar task, by <span class="QUOTE">"blocking"</span>
1049 banner images and other content through rewriting the relevant
1050 URLs in the document's HTML source, so they don't get requested
1051 in the first place. Note that this is a totally different
1052 technique, and it's easy to confuse the two.</p>
1055 <dt>Example usage (section):</dt>
1058 <table border="0" bgcolor="#E0E0E0" width="90%">
1061 <pre class="SCREEN">
1062 {+block{No nasty stuff for you.}}
1063 # Block and replace with "blocked" page
1064 .nasty-stuff.example.com
1066 {+block{Doubleclick banners.} +handle-as-image}
1067 # Block and replace with image
1071 {+block{Layered ads.} +handle-as-empty-document}
1072 # Block and then ignore
1073 adserver.example.net/.*\.js$
1084 <h4 class="SECT3"><a name="CHANGE-X-FORWARDED-FOR" id=
1085 "CHANGE-X-FORWARDED-FOR">8.5.3. change-x-forwarded-for</a></h4>
1087 <div class="VARIABLELIST">
1089 <dt>Typical use:</dt>
1092 <p>Improve privacy by not forwarding the source of the request
1093 in the HTTP headers.</p>
1099 <p>Deletes the <span class="QUOTE">"X-Forwarded-For:"</span>
1100 HTTP header from the client request, or adds a new one.</p>
1106 <p>Parameterized.</p>
1114 <p><span class="QUOTE">"block"</span> to delete the
1119 <p><span class="QUOTE">"add"</span> to create the header
1120 (or append the client's IP address to an already existing
1129 <p>It is safe and recommended to use <tt class=
1130 "LITERAL">block</tt>.</p>
1132 <p>Forwarding the source address of the request may make sense
1133 in some multi-user setups but is also a privacy risk.</p>
1136 <dt>Example usage:</dt>
1139 <table border="0" bgcolor="#E0E0E0" width="90%">
1142 <pre class="SCREEN">
1143 +change-x-forwarded-for{block}
1154 <h4 class="SECT3"><a name="CLIENT-HEADER-FILTER" id=
1155 "CLIENT-HEADER-FILTER">8.5.4. client-header-filter</a></h4>
1157 <div class="VARIABLELIST">
1159 <dt>Typical use:</dt>
1162 <p>Rewrite or remove single client headers.</p>
1168 <p>All client headers to which this action applies are filtered
1169 on-the-fly through the specified regular expression based
1176 <p>Parameterized.</p>
1182 <p>The name of a client-header filter, as defined in one of the
1183 <a href="filter-file.html">filter files</a>.</p>
1189 <p>Client-header filters are applied to each header on its own,
1190 not to all at once. This makes it easier to diagnose problems,
1191 but on the downside you can't write filters that only change
1192 header x if header y's value is z. You can do that by using
1195 <p>Client-header filters are executed after the other header
1196 actions have finished and use their output as input.</p>
1198 <p>If the request URI gets changed, <span class=
1199 "APPLICATION">Privoxy</span> will detect that and use the new
1200 one. This can be used to rewrite the request destination behind
1201 the client's back, for example to specify a Tor exit relay for
1202 certain requests.</p>
1204 <p>Please refer to the <a href="filter-file.html">filter file
1205 chapter</a> to learn which client-header filters are available
1206 by default, and how to create your own.</p>
1209 <dt>Example usage (section):</dt>
1212 <table border="0" bgcolor="#E0E0E0" width="90%">
1215 <pre class="SCREEN">
1216 # Hide Tor exit notation in Host and Referer Headers
1217 {+client-header-filter{hide-tor-exit-notation}}
1230 <h4 class="SECT3"><a name="CLIENT-HEADER-TAGGER" id=
1231 "CLIENT-HEADER-TAGGER">8.5.5. client-header-tagger</a></h4>
1233 <div class="VARIABLELIST">
1235 <dt>Typical use:</dt>
1238 <p>Block requests based on their headers.</p>
1244 <p>Client headers to which this action applies are filtered
1245 on-the-fly through the specified regular expression based
1246 substitutions, the result is used as tag.</p>
1252 <p>Parameterized.</p>
1258 <p>The name of a client-header tagger, as defined in one of the
1259 <a href="filter-file.html">filter files</a>.</p>
1265 <p>Client-header taggers are applied to each header on its own,
1266 and as the header isn't modified, each tagger <span class=
1267 "QUOTE">"sees"</span> the original.</p>
1269 <p>Client-header taggers are the first actions that are
1270 executed and their tags can be used to control every other
1274 <dt>Example usage (section):</dt>
1277 <table border="0" bgcolor="#E0E0E0" width="90%">
1280 <pre class="SCREEN">
1281 # Tag every request with the User-Agent header
1282 {+client-header-tagger{user-agent}}
1285 # Tagging itself doesn't change the action
1286 # settings, sections with TAG patterns do:
1288 # If it's a download agent, use a different forwarding proxy,
1289 # show the real User-Agent and make sure resume works.
1290 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
1291 -hide-if-modified-since \
1292 -overwrite-last-modified \
1297 TAG:^User-Agent: NetBSD-ftp/
1298 TAG:^User-Agent: Novell ZYPP Installer
1299 TAG:^User-Agent: RPM APT-HTTP/
1300 TAG:^User-Agent: fetch libfetch/
1301 TAG:^User-Agent: Ubuntu APT-HTTP/
1302 TAG:^User-Agent: MPlayer/
1309 <table border="0" bgcolor="#E0E0E0" width="90%">
1312 <pre class="SCREEN">
1313 # Tag all requests with the Range header set
1314 {+client-header-tagger{range-requests}}
1317 # Disable filtering for the tagged requests.
1319 # With filtering enabled Privoxy would remove the Range headers
1320 # to be able to filter the whole response. The downside is that
1321 # it prevents clients from resuming downloads or skipping over
1322 # parts of multimedia files.
1323 {-filter -deanimate-gifs}
1336 <h4 class="SECT3"><a name="CONTENT-TYPE-OVERWRITE" id=
1337 "CONTENT-TYPE-OVERWRITE">8.5.6. content-type-overwrite</a></h4>
1339 <div class="VARIABLELIST">
1341 <dt>Typical use:</dt>
1344 <p>Stop useless download menus from popping up, or change the
1345 browser's rendering mode</p>
1351 <p>Replaces the <span class="QUOTE">"Content-Type:"</span> HTTP
1358 <p>Parameterized.</p>
1370 <p>The <span class="QUOTE">"Content-Type:"</span> HTTP server
1371 header is used by the browser to decide what to do with the
1372 document. The value of this header can cause the browser to
1373 open a download menu instead of displaying the document by
1374 itself, even if the document's format is supported by the
1377 <p>The declared content type can also affect which rendering
1378 mode the browser chooses. If XHTML is delivered as <span class=
1379 "QUOTE">"text/html"</span>, many browsers treat it as yet
1380 another broken HTML document. If it is send as <span class=
1381 "QUOTE">"application/xml"</span>, browsers with XHTML support
1382 will only display it, if the syntax is correct.</p>
1384 <p>If you see a web site that proudly uses XHTML buttons, but
1385 sets <span class="QUOTE">"Content-Type: text/html"</span>, you
1386 can use <span class="APPLICATION">Privoxy</span> to overwrite
1387 it with <span class="QUOTE">"application/xml"</span> and
1388 validate the web master's claim inside your XHTML-supporting
1389 browser. If the syntax is incorrect, the browser will complain
1392 <p>You can also go the opposite direction: if your browser
1393 prints error messages instead of rendering a document falsely
1394 declared as XHTML, you can overwrite the content type with
1395 <span class="QUOTE">"text/html"</span> and have it rendered as
1396 broken HTML document.</p>
1398 <p>By default <tt class="LITERAL">content-type-overwrite</tt>
1399 only replaces <span class="QUOTE">"Content-Type:"</span>
1400 headers that look like some kind of text. If you want to
1401 overwrite it unconditionally, you have to combine it with
1402 <tt class="LITERAL"><a href=
1403 "actions-file.html#FORCE-TEXT-MODE">force-text-mode</a></tt>.
1404 This limitation exists for a reason, think twice before
1405 circumventing it.</p>
1407 <p>Most of the time it's easier to replace this action with a
1408 custom <tt class="LITERAL"><a href=
1409 "actions-file.html#SERVER-HEADER-FILTER">server-header
1410 filter</a></tt>. It allows you to activate it for every
1411 document of a certain site and it will still only replace the
1412 content types you aimed at.</p>
1414 <p>Of course you can apply <tt class=
1415 "LITERAL">content-type-overwrite</tt> to a whole site and then
1416 make URL based exceptions, but it's a lot more work to get the
1420 <dt>Example usage (sections):</dt>
1423 <table border="0" bgcolor="#E0E0E0" width="90%">
1426 <pre class="SCREEN">
1427 # Check if www.example.net/ really uses valid XHTML
1428 { +content-type-overwrite{application/xml} }
1431 # but leave the content type unmodified if the URL looks like a style sheet
1432 {-content-type-overwrite}
1433 www.example.net/.*\.css$
1434 www.example.net/.*style
1445 <h4 class="SECT3"><a name="CRUNCH-CLIENT-HEADER" id=
1446 "CRUNCH-CLIENT-HEADER">8.5.7. crunch-client-header</a></h4>
1448 <div class="VARIABLELIST">
1450 <dt>Typical use:</dt>
1453 <p>Remove a client header <span class=
1454 "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1460 <p>Deletes every header sent by the client that contains the
1461 string the user supplied as parameter.</p>
1467 <p>Parameterized.</p>
1479 <p>This action allows you to block client headers for which no
1480 dedicated <span class="APPLICATION">Privoxy</span> action
1481 exists. <span class="APPLICATION">Privoxy</span> will remove
1482 every client header that contains the string you supplied as
1485 <p>Regular expressions are <span class="emphasis"><i class=
1486 "EMPHASIS">not supported</i></span> and you can't use this
1487 action to block different headers in the same request, unless
1488 they contain the same string.</p>
1490 <p><tt class="LITERAL">crunch-client-header</tt> is only meant
1491 for quick tests. If you have to block several different
1492 headers, or only want to modify parts of them, you should use a
1493 <tt class="LITERAL"><a href=
1494 "actions-file.html#CLIENT-HEADER-FILTER">client-header
1495 filter</a></tt>.</p>
1497 <div class="WARNING">
1498 <table class="WARNING" border="1" width="90%">
1500 <td align="center"><b>Warning</b></td>
1505 <p>Don't block any header without understanding the
1513 <dt>Example usage (section):</dt>
1516 <table border="0" bgcolor="#E0E0E0" width="90%">
1519 <pre class="SCREEN">
1520 # Block the non-existent "Privacy-Violation:" client header
1521 { +crunch-client-header{Privacy-Violation:} }
1534 <h4 class="SECT3"><a name="CRUNCH-IF-NONE-MATCH" id=
1535 "CRUNCH-IF-NONE-MATCH">8.5.8. crunch-if-none-match</a></h4>
1537 <div class="VARIABLELIST">
1539 <dt>Typical use:</dt>
1542 <p>Prevent yet another way to track the user's steps between
1549 <p>Deletes the <span class="QUOTE">"If-None-Match:"</span> HTTP
1568 <p>Removing the <span class="QUOTE">"If-None-Match:"</span>
1569 HTTP client header is useful for filter testing, where you want
1570 to force a real reload instead of getting status code
1571 <span class="QUOTE">"304"</span> which would cause the browser
1572 to use a cached copy of the page.</p>
1574 <p>It is also useful to make sure the header isn't used as a
1575 cookie replacement (unlikely but possible).</p>
1577 <p>Blocking the <span class="QUOTE">"If-None-Match:"</span>
1578 header shouldn't cause any caching problems, as long as the
1579 <span class="QUOTE">"If-Modified-Since:"</span> header isn't
1580 blocked or missing as well.</p>
1582 <p>It is recommended to use this action together with
1583 <tt class="LITERAL"><a href=
1584 "actions-file.html#HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</a></tt>
1585 and <tt class="LITERAL"><a href=
1586 "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>.</p>
1589 <dt>Example usage (section):</dt>
1592 <table border="0" bgcolor="#E0E0E0" width="90%">
1595 <pre class="SCREEN">
1596 # Let the browser revalidate cached documents but don't
1597 # allow the server to use the revalidation headers for user tracking.
1598 {+hide-if-modified-since{-60} \
1599 +overwrite-last-modified{randomize} \
1600 +crunch-if-none-match}
1612 <h4 class="SECT3"><a name="CRUNCH-INCOMING-COOKIES" id=
1613 "CRUNCH-INCOMING-COOKIES">8.5.9. crunch-incoming-cookies</a></h4>
1615 <div class="VARIABLELIST">
1617 <dt>Typical use:</dt>
1620 <p>Prevent the web server from setting HTTP cookies on your
1627 <p>Deletes any <span class="QUOTE">"Set-Cookie:"</span> HTTP
1628 headers from server replies.</p>
1646 <p>This action is only concerned with <span class=
1647 "emphasis"><i class="EMPHASIS">incoming</i></span> HTTP
1648 cookies. For <span class="emphasis"><i class=
1649 "EMPHASIS">outgoing</i></span> HTTP cookies, use <tt class=
1651 "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>.
1652 Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1653 to disable HTTP cookies completely.</p>
1655 <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1656 at all</i></span> to use this action in conjunction with the
1657 <tt class="LITERAL"><a href=
1658 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1659 action, since it would prevent the session cookies from being
1660 set. See also <tt class="LITERAL"><a href=
1661 "actions-file.html#FILTER-CONTENT-COOKIES">filter-content-cookies</a></tt>.</p>
1664 <dt>Example usage:</dt>
1667 <table border="0" bgcolor="#E0E0E0" width="90%">
1670 <pre class="SCREEN">
1671 +crunch-incoming-cookies
1682 <h4 class="SECT3"><a name="CRUNCH-SERVER-HEADER" id=
1683 "CRUNCH-SERVER-HEADER">8.5.10. crunch-server-header</a></h4>
1685 <div class="VARIABLELIST">
1687 <dt>Typical use:</dt>
1690 <p>Remove a server header <span class=
1691 "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1697 <p>Deletes every header sent by the server that contains the
1698 string the user supplied as parameter.</p>
1704 <p>Parameterized.</p>
1716 <p>This action allows you to block server headers for which no
1717 dedicated <span class="APPLICATION">Privoxy</span> action
1718 exists. <span class="APPLICATION">Privoxy</span> will remove
1719 every server header that contains the string you supplied as
1722 <p>Regular expressions are <span class="emphasis"><i class=
1723 "EMPHASIS">not supported</i></span> and you can't use this
1724 action to block different headers in the same request, unless
1725 they contain the same string.</p>
1727 <p><tt class="LITERAL">crunch-server-header</tt> is only meant
1728 for quick tests. If you have to block several different
1729 headers, or only want to modify parts of them, you should use a
1730 custom <tt class="LITERAL"><a href=
1731 "actions-file.html#SERVER-HEADER-FILTER">server-header
1732 filter</a></tt>.</p>
1734 <div class="WARNING">
1735 <table class="WARNING" border="1" width="90%">
1737 <td align="center"><b>Warning</b></td>
1742 <p>Don't block any header without understanding the
1750 <dt>Example usage (section):</dt>
1753 <table border="0" bgcolor="#E0E0E0" width="90%">
1756 <pre class="SCREEN">
1757 # Crunch server headers that try to prevent caching
1758 { +crunch-server-header{no-cache} }
1770 <h4 class="SECT3"><a name="CRUNCH-OUTGOING-COOKIES" id=
1771 "CRUNCH-OUTGOING-COOKIES">8.5.11. crunch-outgoing-cookies</a></h4>
1773 <div class="VARIABLELIST">
1775 <dt>Typical use:</dt>
1778 <p>Prevent the web server from reading any HTTP cookies from
1785 <p>Deletes any <span class="QUOTE">"Cookie:"</span> HTTP
1786 headers from client requests.</p>
1804 <p>This action is only concerned with <span class=
1805 "emphasis"><i class="EMPHASIS">outgoing</i></span> HTTP
1806 cookies. For <span class="emphasis"><i class=
1807 "EMPHASIS">incoming</i></span> HTTP cookies, use <tt class=
1809 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>.
1810 Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1811 to disable HTTP cookies completely.</p>
1813 <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1814 at all</i></span> to use this action in conjunction with the
1815 <tt class="LITERAL"><a href=
1816 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1817 action, since it would prevent the session cookies from being
1821 <dt>Example usage:</dt>
1824 <table border="0" bgcolor="#E0E0E0" width="90%">
1827 <pre class="SCREEN">
1828 +crunch-outgoing-cookies
1839 <h4 class="SECT3"><a name="DEANIMATE-GIFS" id=
1840 "DEANIMATE-GIFS">8.5.12. deanimate-gifs</a></h4>
1842 <div class="VARIABLELIST">
1844 <dt>Typical use:</dt>
1847 <p>Stop those annoying, distracting animated GIF images.</p>
1853 <p>De-animate GIF animations, i.e. reduce them to their first
1860 <p>Parameterized.</p>
1866 <p><span class="QUOTE">"last"</span> or <span class=
1867 "QUOTE">"first"</span></p>
1873 <p>This will also shrink the images considerably (in bytes, not
1874 pixels!). If the option <span class="QUOTE">"first"</span> is
1875 given, the first frame of the animation is used as the
1876 replacement. If <span class="QUOTE">"last"</span> is given, the
1877 last frame of the animation is used instead, which probably
1878 makes more sense for most banner animations, but also has the
1879 risk of not showing the entire last frame (if it is only a
1880 delta to an earlier frame).</p>
1882 <p>You can safely use this action with patterns that will also
1883 match non-GIF objects, because no attempt will be made at
1884 anything that doesn't look like a GIF.</p>
1887 <dt>Example usage:</dt>
1890 <table border="0" bgcolor="#E0E0E0" width="90%">
1893 <pre class="SCREEN">
1894 +deanimate-gifs{last}
1905 <h4 class="SECT3"><a name="DOWNGRADE-HTTP-VERSION" id=
1906 "DOWNGRADE-HTTP-VERSION">8.5.13. downgrade-http-version</a></h4>
1908 <div class="VARIABLELIST">
1910 <dt>Typical use:</dt>
1913 <p>Work around (very rare) problems with HTTP/1.1</p>
1919 <p>Downgrades HTTP/1.1 client requests and server replies to
1938 <p>This is a left-over from the time when <span class=
1939 "APPLICATION">Privoxy</span> didn't support important HTTP/1.1
1940 features well. It is left here for the unlikely case that you
1941 experience HTTP/1.1-related problems with some server out
1944 <p>Note that enabling this action is only a workaround. It
1945 should not be enabled for sites that work without it. While it
1946 shouldn't break any pages, it has an (usually negative)
1947 performance impact.</p>
1949 <p>If you come across a site where enabling this action helps,
1950 please report it, so the cause of the problem can be analyzed.
1951 If the problem turns out to be caused by a bug in <span class=
1952 "APPLICATION">Privoxy</span> it should be fixed so the
1953 following release works without the work around.</p>
1956 <dt>Example usage (section):</dt>
1959 <table border="0" bgcolor="#E0E0E0" width="90%">
1962 <pre class="SCREEN">
1963 {+downgrade-http-version}
1964 problem-host.example.com
1975 <h4 class="SECT3"><a name="FAST-REDIRECTS" id=
1976 "FAST-REDIRECTS">8.5.14. fast-redirects</a></h4>
1978 <div class="VARIABLELIST">
1980 <dt>Typical use:</dt>
1983 <p>Fool some click-tracking scripts and speed up indirect
1990 <p>Detects redirection URLs and redirects the browser without
1991 contacting the redirection server first.</p>
1997 <p>Parameterized.</p>
2005 <p><span class="QUOTE">"simple-check"</span> to just search
2006 for the string <span class="QUOTE">"http://"</span> to
2007 detect redirection URLs.</p>
2011 <p><span class="QUOTE">"check-decoded-url"</span> to decode
2012 URLs (if necessary) before searching for redirection
2021 <p>Many sites, like yahoo.com, don't just link to other sites.
2022 Instead, they will link to some script on their own servers,
2023 giving the destination as a parameter, which will then redirect
2024 you to the final target. URLs resulting from this scheme
2025 typically look like: <span class=
2026 "QUOTE">"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</span>.</p>
2028 <p>Sometimes, there are even multiple consecutive redirects
2029 encoded in the URL. These redirections via scripts make your
2030 web browsing more traceable, since the server from which you
2031 follow such a link can see where you go to. Apart from that,
2032 valuable bandwidth and time is wasted, while your browser asks
2033 the server for one redirect after the other. Plus, it feeds the
2036 <p>This feature is currently not very smart and is scheduled
2037 for improvement. If it is enabled by default, you will have to
2038 create some exceptions to this action. It can lead to failures
2039 in several ways:</p>
2041 <p>Not every URLs with other URLs as parameters is evil. Some
2042 sites offer a real service that requires this information to
2043 work. For example a validation service needs to know, which
2044 document to validate. <tt class="LITERAL">fast-redirects</tt>
2045 assumes that every URL parameter that looks like another URL is
2046 a redirection target, and will always redirect to the last one.
2047 Most of the time the assumption is correct, but if it isn't,
2048 the user gets redirected anyway.</p>
2050 <p>Another failure occurs if the URL contains other parameters
2051 after the URL parameter. The URL: <span class=
2052 "QUOTE">"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</span>.
2053 contains the redirection URL <span class=
2054 "QUOTE">"http://www.example.net/"</span>, followed by another
2055 parameter. <tt class="LITERAL">fast-redirects</tt> doesn't know
2056 that and will cause a redirect to <span class=
2057 "QUOTE">"http://www.example.net/&foo=bar"</span>. Depending
2058 on the target server configuration, the parameter will be
2059 silently ignored or lead to a <span class="QUOTE">"page not
2060 found"</span> error. You can prevent this problem by first
2061 using the <tt class="LITERAL"><a href=
2062 "actions-file.html#REDIRECT">redirect</a></tt> action to remove
2063 the last part of the URL, but it requires a little effort.</p>
2065 <p>To detect a redirection URL, <tt class=
2066 "LITERAL">fast-redirects</tt> only looks for the string
2067 <span class="QUOTE">"http://"</span>, either in plain text
2068 (invalid but often used) or encoded as <span class=
2069 "QUOTE">"http%3a//"</span>. Some sites use their own URL
2070 encoding scheme, encrypt the address of the target server or
2071 replace it with a database id. In theses cases <tt class=
2072 "LITERAL">fast-redirects</tt> is fooled and the request reaches
2073 the redirection server where it probably gets logged.</p>
2076 <dt>Example usage:</dt>
2079 <table border="0" bgcolor="#E0E0E0" width="90%">
2082 <pre class="SCREEN">
2083 { +fast-redirects{simple-check} }
2086 { +fast-redirects{check-decoded-url} }
2087 another.example.com/testing
2098 <h4 class="SECT3"><a name="FILTER" id="FILTER">8.5.15.
2101 <div class="VARIABLELIST">
2103 <dt>Typical use:</dt>
2106 <p>Get rid of HTML and JavaScript annoyances, banner
2107 advertisements (by size), do fun text replacements, add
2108 personalized effects, etc.</p>
2114 <p>All instances of text-based type, most notably HTML and
2115 JavaScript, to which this action applies, can be filtered
2116 on-the-fly through the specified regular expression based
2117 substitutions. (Note: as of version 3.0.3 plain text documents
2118 are exempted from filtering, because web servers often use the
2119 <tt class="LITERAL">text/plain</tt> MIME type for all files
2120 whose type they don't know.)</p>
2126 <p>Parameterized.</p>
2132 <p>The name of a content filter, as defined in the <a href=
2133 "filter-file.html">filter file</a>. Filters can be defined in
2134 one or more files as defined by the <tt class=
2135 "LITERAL"><a href="config.html#FILTERFILE">filterfile</a></tt>
2136 option in the <a href="config.html">config file</a>. <tt class=
2137 "FILENAME">default.filter</tt> is the collection of filters
2138 supplied by the developers. Locally defined filters should go
2139 in their own file, such as <tt class=
2140 "FILENAME">user.filter</tt>.</p>
2142 <p>When used in its negative form, and without parameters,
2143 <span class="emphasis"><i class="EMPHASIS">all</i></span>
2144 filtering is completely disabled.</p>
2150 <p>For your convenience, there are a number of pre-defined
2151 filters available in the distribution filter file that you can
2152 use. See the examples below for a list.</p>
2154 <p>Filtering requires buffering the page content, which may
2155 appear to slow down page rendering since nothing is displayed
2156 until all content has passed the filters. (The total time until
2157 the page is completely rendered doesn't change much, but it may
2158 be perceived as slower since the page is not incrementally
2159 displayed.) This effect will be more noticeable on slower
2162 <p><span class="QUOTE">"Rolling your own"</span> filters
2163 requires a knowledge of <a href=
2164 "http://en.wikipedia.org/wiki/Regular_expressions" target=
2165 "_top"><span class="QUOTE">"Regular Expressions"</span></a> and
2166 <a href="http://en.wikipedia.org/wiki/Html" target=
2167 "_top"><span class="QUOTE">"HTML"</span></a>. This is very
2168 powerful feature, and potentially very intrusive. Filters
2169 should be used with caution, and where an equivalent
2170 <span class="QUOTE">"action"</span> is not available.</p>
2172 <p>The amount of data that can be filtered is limited to the
2173 <tt class="LITERAL"><a href=
2174 "config.html#BUFFER-LIMIT">buffer-limit</a></tt> option in the
2175 main <a href="config.html">config file</a>. The default is 4096
2176 KB (4 Megs). Once this limit is exceeded, the buffered data,
2177 and all pending data, is passed through unfiltered.</p>
2179 <p>Inappropriate MIME types, such as zipped files, are not
2180 filtered at all. (Again, only text-based types except plain
2181 text). Encrypted SSL data (from HTTPS servers) cannot be
2182 filtered either, since this would violate the integrity of the
2183 secure transaction. In some situations it might be necessary to
2184 protect certain text, like source code, from filtering by
2185 defining appropriate <tt class="LITERAL">-filter</tt>
2188 <p>Compressed content can't be filtered either, but if
2189 <span class="APPLICATION">Privoxy</span> is compiled with zlib
2190 support and a supported compression algorithm is used (gzip or
2191 deflate), <span class="APPLICATION">Privoxy</span> can first
2192 decompress the content and then filter it.</p>
2194 <p>If you use a <span class="APPLICATION">Privoxy</span>
2195 version without zlib support, but want filtering to work on as
2196 much documents as possible, even those that would normally be
2197 sent compressed, you must use the <tt class="LITERAL"><a href=
2198 "actions-file.html#PREVENT-COMPRESSION">prevent-compression</a></tt>
2199 action in conjunction with <tt class="LITERAL">filter</tt>.</p>
2201 <p>Content filtering can achieve some of the same effects as
2202 the <tt class="LITERAL"><a href=
2203 "actions-file.html#BLOCK">block</a></tt> action, i.e. it can be
2204 used to block ads and banners. But the mechanism works quite
2205 differently. One effective use, is to block ad banners based on
2206 their size (see below), since many of these seem to be somewhat
2209 <p><a href="contact.html">Feedback</a> with suggestions for new
2210 or improved filters is particularly welcome!</p>
2212 <p>The below list has only the names and a one-line description
2213 of each predefined filter. There are <a href=
2214 "filter-file.html#PREDEFINED-FILTERS">more verbose
2215 explanations</a> of what these filters do in the <a href=
2216 "filter-file.html">filter file chapter</a>.</p>
2219 <dt>Example usage (with filters from the distribution <tt class=
2220 "FILENAME">default.filter</tt> file). See <a href=
2221 "filter-file.html#PREDEFINED-FILTERS">the Predefined Filters
2222 section</a> for more explanation on each:</dt>
2225 <p><a name="FILTER-JS-ANNOYANCES" id=
2226 "FILTER-JS-ANNOYANCES"></a></p>
2228 <table border="0" bgcolor="#E0E0E0" width="90%">
2231 <pre class="SCREEN">
2232 +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse.
2238 <p><a name="FILTER-JS-EVENTS" id="FILTER-JS-EVENTS"></a></p>
2240 <table border="0" bgcolor="#E0E0E0" width="90%">
2243 <pre class="SCREEN">
2244 +filter{js-events} # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
2250 <p><a name="FILTER-HTML-ANNOYANCES" id=
2251 "FILTER-HTML-ANNOYANCES"></a></p>
2253 <table border="0" bgcolor="#E0E0E0" width="90%">
2256 <pre class="SCREEN">
2257 +filter{html-annoyances} # Get rid of particularly annoying HTML abuse.
2263 <p><a name="FILTER-CONTENT-COOKIES" id=
2264 "FILTER-CONTENT-COOKIES"></a></p>
2266 <table border="0" bgcolor="#E0E0E0" width="90%">
2269 <pre class="SCREEN">
2270 +filter{content-cookies} # Kill cookies that come in the HTML or JS content.
2276 <p><a name="FILTER-REFRESH-TAGS" id=
2277 "FILTER-REFRESH-TAGS"></a></p>
2279 <table border="0" bgcolor="#E0E0E0" width="90%">
2282 <pre class="SCREEN">
2283 +filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups).
2289 <p><a name="FILTER-UNSOLICITED-POPUPS" id=
2290 "FILTER-UNSOLICITED-POPUPS"></a></p>
2292 <table border="0" bgcolor="#E0E0E0" width="90%">
2295 <pre class="SCREEN">
2296 +filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
2302 <p><a name="FILTER-ALL-POPUPS" id="FILTER-ALL-POPUPS"></a></p>
2304 <table border="0" bgcolor="#E0E0E0" width="90%">
2307 <pre class="SCREEN">
2308 +filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
2314 <p><a name="FILTER-IMG-REORDER" id=
2315 "FILTER-IMG-REORDER"></a></p>
2317 <table border="0" bgcolor="#E0E0E0" width="90%">
2320 <pre class="SCREEN">
2321 +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective.
2327 <p><a name="FILTER-BANNERS-BY-SIZE" id=
2328 "FILTER-BANNERS-BY-SIZE"></a></p>
2330 <table border="0" bgcolor="#E0E0E0" width="90%">
2333 <pre class="SCREEN">
2334 +filter{banners-by-size} # Kill banners by size.
2340 <p><a name="FILTER-BANNERS-BY-LINK" id=
2341 "FILTER-BANNERS-BY-LINK"></a></p>
2343 <table border="0" bgcolor="#E0E0E0" width="90%">
2346 <pre class="SCREEN">
2347 +filter{banners-by-link} # Kill banners by their links to known clicktrackers.
2353 <p><a name="FILTER-WEBBUGS" id="FILTER-WEBBUGS"></a></p>
2355 <table border="0" bgcolor="#E0E0E0" width="90%">
2358 <pre class="SCREEN">
2359 +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking).
2365 <p><a name="FILTER-TINY-TEXTFORMS" id=
2366 "FILTER-TINY-TEXTFORMS"></a></p>
2368 <table border="0" bgcolor="#E0E0E0" width="90%">
2371 <pre class="SCREEN">
2372 +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap.
2378 <p><a name="FILTER-JUMPING-WINDOWS" id=
2379 "FILTER-JUMPING-WINDOWS"></a></p>
2381 <table border="0" bgcolor="#E0E0E0" width="90%">
2384 <pre class="SCREEN">
2385 +filter{jumping-windows} # Prevent windows from resizing and moving themselves.
2391 <p><a name="FILTER-FRAMESET-BORDERS" id=
2392 "FILTER-FRAMESET-BORDERS"></a></p>
2394 <table border="0" bgcolor="#E0E0E0" width="90%">
2397 <pre class="SCREEN">
2398 +filter{frameset-borders} # Give frames a border and make them resizable.
2404 <p><a name="FILTER-DEMORONIZER" id=
2405 "FILTER-DEMORONIZER"></a></p>
2407 <table border="0" bgcolor="#E0E0E0" width="90%">
2410 <pre class="SCREEN">
2411 +filter{demoronizer} # Fix MS's non-standard use of standard charsets.
2417 <p><a name="FILTER-SHOCKWAVE-FLASH" id=
2418 "FILTER-SHOCKWAVE-FLASH"></a></p>
2420 <table border="0" bgcolor="#E0E0E0" width="90%">
2423 <pre class="SCREEN">
2424 +filter{shockwave-flash} # Kill embedded Shockwave Flash objects.
2430 <p><a name="FILTER-QUICKTIME-KIOSKMODE" id=
2431 "FILTER-QUICKTIME-KIOSKMODE"></a></p>
2433 <table border="0" bgcolor="#E0E0E0" width="90%">
2436 <pre class="SCREEN">
2437 +filter{quicktime-kioskmode} # Make Quicktime movies saveable.
2443 <p><a name="FILTER-FUN" id="FILTER-FUN"></a></p>
2445 <table border="0" bgcolor="#E0E0E0" width="90%">
2448 <pre class="SCREEN">
2449 +filter{fun} # Text replacements for subversive browsing fun!
2455 <p><a name="FILTER-CRUDE-PARENTAL" id=
2456 "FILTER-CRUDE-PARENTAL"></a></p>
2458 <table border="0" bgcolor="#E0E0E0" width="90%">
2461 <pre class="SCREEN">
2462 +filter{crude-parental} # Crude parental filtering. Note that this filter doesn't work reliably.
2468 <p><a name="FILTER-IE-EXPLOITS" id=
2469 "FILTER-IE-EXPLOITS"></a></p>
2471 <table border="0" bgcolor="#E0E0E0" width="90%">
2474 <pre class="SCREEN">
2475 +filter{ie-exploits} # Disable some known Internet Explorer bug exploits.
2481 <p><a name="FILTER-SITE-SPECIFICS" id=
2482 "FILTER-SITE-SPECIFICS"></a></p>
2484 <table border="0" bgcolor="#E0E0E0" width="90%">
2487 <pre class="SCREEN">
2488 +filter{site-specifics} # Cure for site-specific problems. Don't apply generally!
2494 <p><a name="FILTER-NO-PING" id="FILTER-NO-PING"></a></p>
2496 <table border="0" bgcolor="#E0E0E0" width="90%">
2499 <pre class="SCREEN">
2500 +filter{no-ping} # Removes non-standard ping attributes in <a> and <area> tags.
2506 <p><a name="FILTER-GOOGLE" id="FILTER-GOOGLE"></a></p>
2508 <table border="0" bgcolor="#E0E0E0" width="90%">
2511 <pre class="SCREEN">
2512 +filter{google} # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
2518 <p><a name="FILTER-YAHOO" id="FILTER-YAHOO"></a></p>
2520 <table border="0" bgcolor="#E0E0E0" width="90%">
2523 <pre class="SCREEN">
2524 +filter{yahoo} # CSS-based block for Yahoo text ads. Also removes a width limitation.
2530 <p><a name="FILTER-MSN" id="FILTER-MSN"></a></p>
2532 <table border="0" bgcolor="#E0E0E0" width="90%">
2535 <pre class="SCREEN">
2536 +filter{msn} # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
2542 <p><a name="FILTER-BLOGSPOT" id="FILTER-BLOGSPOT"></a></p>
2544 <table border="0" bgcolor="#E0E0E0" width="90%">
2547 <pre class="SCREEN">
2548 +filter{blogspot} # Cleans up some Blogspot blogs. Read the fine print before using this.
2559 <h4 class="SECT3"><a name="FORCE-TEXT-MODE" id=
2560 "FORCE-TEXT-MODE">8.5.16. force-text-mode</a></h4>
2562 <div class="VARIABLELIST">
2564 <dt>Typical use:</dt>
2567 <p>Force <span class="APPLICATION">Privoxy</span> to treat a
2568 document as if it was in some kind of <span class=
2569 "emphasis"><i class="EMPHASIS">text</i></span> format.</p>
2575 <p>Declares a document as text, even if the <span class=
2576 "QUOTE">"Content-Type:"</span> isn't detected as such.</p>
2594 <p>As explained <tt class="LITERAL"><a href=
2595 "actions-file.html#FILTER">above</a></tt>, <span class=
2596 "APPLICATION">Privoxy</span> tries to only filter files that
2597 are in some kind of text format. The same restrictions apply to
2598 <tt class="LITERAL"><a href=
2599 "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite</a></tt>.
2600 <tt class="LITERAL">force-text-mode</tt> declares a document as
2601 text, without looking at the <span class=
2602 "QUOTE">"Content-Type:"</span> first.</p>
2604 <div class="WARNING">
2605 <table class="WARNING" border="1" width="90%">
2607 <td align="center"><b>Warning</b></td>
2612 <p>Think twice before activating this action. Filtering
2613 binary data with regular expressions can cause file
2621 <dt>Example usage:</dt>
2624 <table border="0" bgcolor="#E0E0E0" width="90%">
2627 <pre class="SCREEN">
2640 <h4 class="SECT3"><a name="FORWARD-OVERRIDE" id=
2641 "FORWARD-OVERRIDE">8.5.17. forward-override</a></h4>
2643 <div class="VARIABLELIST">
2645 <dt>Typical use:</dt>
2648 <p>Change the forwarding settings based on User-Agent or
2655 <p>Overrules the forward directives in the configuration
2670 <p><span class="QUOTE">"forward ."</span> to use a direct
2671 connection without any additional proxies.</p>
2675 <p><span class="QUOTE">"forward 127.0.0.1:8123"</span> to
2676 use the HTTP proxy listening at 127.0.0.1 port 8123.</p>
2680 <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2681 ."</span> to use the socks4a proxy listening at 127.0.0.1
2682 port 9050. Replace <span class=
2683 "QUOTE">"forward-socks4a"</span> with <span class=
2684 "QUOTE">"forward-socks4"</span> to use a socks4 connection
2685 (with local DNS resolution) instead, use <span class=
2686 "QUOTE">"forward-socks5"</span> for socks5 connections
2687 (with remote DNS resolution).</p>
2691 <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2692 proxy.example.org:8000"</span> to use the socks4a proxy
2693 listening at 127.0.0.1 port 9050 to reach the HTTP proxy
2694 listening at proxy.example.org port 8000. Replace
2695 <span class="QUOTE">"forward-socks4a"</span> with
2696 <span class="QUOTE">"forward-socks4"</span> to use a socks4
2697 connection (with local DNS resolution) instead, use
2698 <span class="QUOTE">"forward-socks5"</span> for socks5
2699 connections (with remote DNS resolution).</p>
2707 <p>This action takes parameters similar to the <a href=
2708 "config.html#FORWARDING">forward</a> directives in the
2709 configuration file, but without the URL pattern. It can be used
2710 as replacement, but normally it's only used in cases where
2711 matching based on the request URL isn't sufficient.</p>
2713 <div class="WARNING">
2714 <table class="WARNING" border="1" width="90%">
2716 <td align="center"><b>Warning</b></td>
2721 <p>Please read the description for the <a href=
2722 "config.html#FORWARDING">forward</a> directives before
2723 using this action. Forwarding to the wrong people will
2724 reduce your privacy and increase the chances of
2725 man-in-the-middle attacks.</p>
2727 <p>If the ports are missing or invalid, default values
2728 will be used. This might change in the future and you
2729 shouldn't rely on it. Otherwise incorrect syntax causes
2730 Privoxy to exit.</p>
2733 "http://config.privoxy.org/show-url-info" target=
2734 "_top">show-url-info CGI page</a> to verify that your
2735 forward settings do what you thought the do.</p>
2742 <dt>Example usage:</dt>
2745 <table border="0" bgcolor="#E0E0E0" width="90%">
2748 <pre class="SCREEN">
2749 # Always use direct connections for requests previously tagged as
2750 # <span class="QUOTE">"User-Agent: fetch libfetch/2.0"</span> and make sure
2751 # resuming downloads continues to work.
2752 # This way you can continue to use Tor for your normal browsing,
2753 # without overloading the Tor network with your FreeBSD ports updates
2754 # or downloads of bigger files like ISOs.
2755 # Note that HTTP headers are easy to fake and therefore their
2756 # values are as (un)trustworthy as your clients and users.
2757 {+forward-override{forward .} \
2758 -hide-if-modified-since \
2759 -overwrite-last-modified \
2761 TAG:^User-Agent: fetch libfetch/2\.0$
2773 <h4 class="SECT3"><a name="HANDLE-AS-EMPTY-DOCUMENT" id=
2774 "HANDLE-AS-EMPTY-DOCUMENT">8.5.18. handle-as-empty-document</a></h4>
2776 <div class="VARIABLELIST">
2778 <dt>Typical use:</dt>
2781 <p>Mark URLs that should be replaced by empty documents
2782 <span class="emphasis"><i class="EMPHASIS">if they get
2783 blocked</i></span></p>
2789 <p>This action alone doesn't do anything noticeable. It just
2790 marks URLs. If the <tt class="LITERAL"><a href=
2791 "actions-file.html#BLOCK">block</a></tt> action <span class=
2792 "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2793 presence or absence of this mark decides whether an HTML
2794 <span class="QUOTE">"BLOCKED"</span> page, or an empty document
2795 will be sent to the client as a substitute for the blocked
2796 content. The <span class="emphasis"><i class=
2797 "EMPHASIS">empty</i></span> document isn't literally empty, but
2798 actually contains a single space.</p>
2816 <p>Some browsers complain about syntax errors if JavaScript
2817 documents are blocked with <span class=
2818 "APPLICATION">Privoxy's</span> default HTML page; this option
2819 can be used to silence them. And of course this action can also
2820 be used to eliminate the <span class=
2821 "APPLICATION">Privoxy</span> BLOCKED message in frames.</p>
2823 <p>The content type for the empty document can be specified
2824 with <tt class="LITERAL"><a href=
2825 "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite{}</a></tt>,
2826 but usually this isn't necessary.</p>
2829 <dt>Example usage:</dt>
2832 <table border="0" bgcolor="#E0E0E0" width="90%">
2835 <pre class="SCREEN">
2836 # Block all documents on example.org that end with ".js",
2837 # but send an empty document instead of the usual HTML message.
2838 {+block{Blocked JavaScript} +handle-as-empty-document}
2851 <h4 class="SECT3"><a name="HANDLE-AS-IMAGE" id=
2852 "HANDLE-AS-IMAGE">8.5.19. handle-as-image</a></h4>
2854 <div class="VARIABLELIST">
2856 <dt>Typical use:</dt>
2859 <p>Mark URLs as belonging to images (so they'll be replaced by
2860 images <span class="emphasis"><i class="EMPHASIS">if they do
2861 get blocked</i></span>, rather than HTML pages)</p>
2867 <p>This action alone doesn't do anything noticeable. It just
2868 marks URLs as images. If the <tt class="LITERAL"><a href=
2869 "actions-file.html#BLOCK">block</a></tt> action <span class=
2870 "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2871 presence or absence of this mark decides whether an HTML
2872 <span class="QUOTE">"blocked"</span> page, or a replacement
2873 image (as determined by the <tt class="LITERAL"><a href=
2874 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
2875 action) will be sent to the client as a substitute for the
2876 blocked content.</p>
2894 <p>The below generic example section is actually part of
2895 <tt class="FILENAME">default.action</tt>. It marks all URLs
2896 with well-known image file name extensions as images and should
2899 <p>Users will probably only want to use the handle-as-image
2900 action in conjunction with <tt class="LITERAL"><a href=
2901 "actions-file.html#BLOCK">block</a></tt>, to block sources of
2902 banners, whose URLs don't reflect the file type, like in the
2903 second example section.</p>
2905 <p>Note that you cannot treat HTML pages as images in most
2906 cases. For instance, (in-line) ad frames require an HTML page
2907 to be sent, or they won't display properly. Forcing <tt class=
2908 "LITERAL">handle-as-image</tt> in this situation will not
2909 replace the ad frame with an image, but lead to error
2913 <dt>Example usage (sections):</dt>
2916 <table border="0" bgcolor="#E0E0E0" width="90%">
2919 <pre class="SCREEN">
2920 # Generic image extensions:
2923 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2925 # These don't look like images, but they're banners and should be
2926 # blocked as images:
2928 {+block{Nasty banners.} +handle-as-image}
2929 nasty-banner-server.example.com/junk.cgi\?output=trash
2940 <h4 class="SECT3"><a name="HIDE-ACCEPT-LANGUAGE" id=
2941 "HIDE-ACCEPT-LANGUAGE">8.5.20. hide-accept-language</a></h4>
2943 <div class="VARIABLELIST">
2945 <dt>Typical use:</dt>
2948 <p>Pretend to use different language settings.</p>
2954 <p>Deletes or replaces the <span class=
2955 "QUOTE">"Accept-Language:"</span> HTTP header in client
2962 <p>Parameterized.</p>
2968 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2975 <p>Faking the browser's language settings can be useful to make
2976 a foreign User-Agent set with <tt class="LITERAL"><a href=
2977 "actions-file.html#HIDE-USER-AGENT">hide-user-agent</a></tt>
2978 more believable.</p>
2980 <p>However some sites with content in different languages check
2981 the <span class="QUOTE">"Accept-Language:"</span> to decide
2982 which one to take by default. Sometimes it isn't possible to
2983 later switch to another language without changing the
2984 <span class="QUOTE">"Accept-Language:"</span> header first.</p>
2986 <p>Therefore it's a good idea to either only change the
2987 <span class="QUOTE">"Accept-Language:"</span> header to
2988 languages you understand, or to languages that aren't wide
2991 <p>Before setting the <span class=
2992 "QUOTE">"Accept-Language:"</span> header to a rare language,
2993 you should consider that it helps to make your requests unique
2994 and thus easier to trace. If you don't plan to change this
2995 header frequently, you should stick to a common language.</p>
2998 <dt>Example usage (section):</dt>
3001 <table border="0" bgcolor="#E0E0E0" width="90%">
3004 <pre class="SCREEN">
3005 # Pretend to use Canadian language settings.
3006 {+hide-accept-language{en-ca} \
3007 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
3020 <h4 class="SECT3"><a name="HIDE-CONTENT-DISPOSITION" id=
3021 "HIDE-CONTENT-DISPOSITION">8.5.21. hide-content-disposition</a></h4>
3023 <div class="VARIABLELIST">
3025 <dt>Typical use:</dt>
3028 <p>Prevent download menus for content you prefer to view inside
3035 <p>Deletes or replaces the <span class=
3036 "QUOTE">"Content-Disposition:"</span> HTTP header set by some
3043 <p>Parameterized.</p>
3049 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
3056 <p>Some servers set the <span class=
3057 "QUOTE">"Content-Disposition:"</span> HTTP header for documents
3058 they assume you want to save locally before viewing them. The
3059 <span class="QUOTE">"Content-Disposition:"</span> header
3060 contains the file name the browser is supposed to use by
3063 <p>In most browsers that understand this header, it makes it
3064 impossible to <span class="emphasis"><i class="EMPHASIS">just
3065 view</i></span> the document, without downloading it first,
3066 even if it's just a simple text file or an image.</p>
3068 <p>Removing the <span class=
3069 "QUOTE">"Content-Disposition:"</span> header helps to prevent
3070 this annoyance, but some browsers additionally check the
3071 <span class="QUOTE">"Content-Type:"</span> header, before they
3072 decide if they can display a document without saving it first.
3073 In these cases, you have to change this header as well, before
3074 the browser stops displaying download menus.</p>
3076 <p>It is also possible to change the server's file name
3077 suggestion to another one, but in most cases it isn't worth the
3078 time to set it up.</p>
3080 <p>This action will probably be removed in the future, use
3081 server-header filters instead.</p>
3084 <dt>Example usage:</dt>
3087 <table border="0" bgcolor="#E0E0E0" width="90%">
3090 <pre class="SCREEN">
3091 # Disarm the download link in Sourceforge's patch tracker
3093 +content-type-overwrite{text/plain}\
3094 +hide-content-disposition{block} }
3095 .sourceforge.net/tracker/download\.php
3106 <h4 class="SECT3"><a name="HIDE-IF-MODIFIED-SINCE" id=
3107 "HIDE-IF-MODIFIED-SINCE">8.5.22. hide-if-modified-since</a></h4>
3109 <div class="VARIABLELIST">
3111 <dt>Typical use:</dt>
3114 <p>Prevent yet another way to track the user's steps between
3121 <p>Deletes the <span class="QUOTE">"If-Modified-Since:"</span>
3122 HTTP client header or modifies its value.</p>
3128 <p>Parameterized.</p>
3134 <p>Keyword: <span class="QUOTE">"block"</span>, or a user
3135 defined value that specifies a range of hours.</p>
3141 <p>Removing this header is useful for filter testing, where you
3142 want to force a real reload instead of getting status code
3143 <span class="QUOTE">"304"</span>, which would cause the browser
3144 to use a cached copy of the page.</p>
3146 <p>Instead of removing the header, <tt class=
3147 "LITERAL">hide-if-modified-since</tt> can also add or subtract
3148 a random amount of time to/from the header's value. You specify
3149 a range of minutes where the random factor should be chosen
3150 from and <span class="APPLICATION">Privoxy</span> does the
3151 rest. A negative value means subtracting, a positive value
3154 <p>Randomizing the value of the <span class=
3155 "QUOTE">"If-Modified-Since:"</span> makes it less likely that
3156 the server can use the time as a cookie replacement, but you
3157 will run into caching problems if the random range is too
3160 <p>It is a good idea to only use a small negative value and let
3161 <tt class="LITERAL"><a href=
3162 "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>
3163 handle the greater changes.</p>
3165 <p>It is also recommended to use this action together with
3166 <tt class="LITERAL"><a href=
3167 "actions-file.html#CRUNCH-IF-NONE-MATCH">crunch-if-none-match</a></tt>,
3168 otherwise it's more or less pointless.</p>
3171 <dt>Example usage (section):</dt>
3174 <table border="0" bgcolor="#E0E0E0" width="90%">
3177 <pre class="SCREEN">
3178 # Let the browser revalidate but make tracking based on the time less likely.
3179 {+hide-if-modified-since{-60} \
3180 +overwrite-last-modified{randomize} \
3181 +crunch-if-none-match}
3193 <h4 class="SECT3"><a name="HIDE-FROM-HEADER" id=
3194 "HIDE-FROM-HEADER">8.5.23. hide-from-header</a></h4>
3196 <div class="VARIABLELIST">
3198 <dt>Typical use:</dt>
3201 <p>Keep your (old and ill) browser from telling web servers
3202 your email address</p>
3208 <p>Deletes any existing <span class="QUOTE">"From:"</span> HTTP
3209 header, or replaces it with the specified string.</p>
3215 <p>Parameterized.</p>
3221 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
3228 <p>The keyword <span class="QUOTE">"block"</span> will
3229 completely remove the header (not to be confused with the
3230 <tt class="LITERAL"><a href=
3231 "actions-file.html#BLOCK">block</a></tt> action).</p>
3233 <p>Alternately, you can specify any value you prefer to be sent
3234 to the web server. If you do, it is a matter of fairness not to
3235 use any address that is actually used by a real person.</p>
3237 <p>This action is rarely needed, as modern web browsers don't
3238 send <span class="QUOTE">"From:"</span> headers anymore.</p>
3241 <dt>Example usage:</dt>
3244 <table border="0" bgcolor="#E0E0E0" width="90%">
3247 <pre class="SCREEN">
3248 +hide-from-header{block}
3254 <table border="0" bgcolor="#E0E0E0" width="90%">
3257 <pre class="SCREEN">
3258 +hide-from-header{spam-me-senseless@sittingduck.example.com}
3269 <h4 class="SECT3"><a name="HIDE-REFERRER" id="HIDE-REFERRER">8.5.24.
3270 hide-referrer</a></h4><a name="HIDE-REFERER" id="HIDE-REFERER"></a>
3272 <div class="VARIABLELIST">
3274 <dt>Typical use:</dt>
3277 <p>Conceal which link you followed to get to a particular
3284 <p>Deletes the <span class="QUOTE">"Referer:"</span> (sic) HTTP
3285 header from the client request, or replaces it with a forged
3292 <p>Parameterized.</p>
3300 <p><span class="QUOTE">"conditional-block"</span> to delete
3301 the header completely if the host has changed.</p>
3305 <p><span class="QUOTE">"conditional-forge"</span> to forge
3306 the header if the host has changed.</p>
3310 <p><span class="QUOTE">"block"</span> to delete the header
3311 unconditionally.</p>
3315 <p><span class="QUOTE">"forge"</span> to pretend to be
3316 coming from the homepage of the server we are talking
3321 <p>Any other string to set a user defined referrer.</p>
3329 <p><tt class="LITERAL">conditional-block</tt> is the only
3330 parameter, that isn't easily detected in the server's log file.
3331 If it blocks the referrer, the request will look like the
3332 visitor used a bookmark or typed in the address directly.</p>
3334 <p>Leaving the referrer unmodified for requests on the same
3335 host allows the server owner to see the visitor's <span class=
3336 "QUOTE">"click path"</span>, but in most cases she could also
3337 get that information by comparing other parts of the log file:
3338 for example the User-Agent if it isn't a very common one, or
3339 the user's IP address if it doesn't change between different
3342 <p>Always blocking the referrer, or using a custom one, can
3343 lead to failures on servers that check the referrer before they
3344 answer any requests, in an attempt to prevent their content
3345 from being embedded or linked to elsewhere.</p>
3347 <p>Both <tt class="LITERAL">conditional-block</tt> and
3348 <tt class="LITERAL">forge</tt> will work with referrer checks,
3349 as long as content and valid referring page are on the same
3350 host. Most of the time that's the case.</p>
3352 <p><tt class="LITERAL">hide-referer</tt> is an alternate
3353 spelling of <tt class="LITERAL">hide-referrer</tt> and the two
3354 can be can be freely substituted with each other. (<span class=
3355 "QUOTE">"referrer"</span> is the correct English spelling,
3356 however the HTTP specification has a bug - it requires it to be
3357 spelled as <span class="QUOTE">"referer"</span>.)</p>
3360 <dt>Example usage:</dt>
3363 <table border="0" bgcolor="#E0E0E0" width="90%">
3366 <pre class="SCREEN">
3367 +hide-referrer{forge}
3373 <table border="0" bgcolor="#E0E0E0" width="90%">
3376 <pre class="SCREEN">
3377 +hide-referrer{http://www.yahoo.com/}
3388 <h4 class="SECT3"><a name="HIDE-USER-AGENT" id=
3389 "HIDE-USER-AGENT">8.5.25. hide-user-agent</a></h4>
3391 <div class="VARIABLELIST">
3393 <dt>Typical use:</dt>
3396 <p>Try to conceal your type of browser and client operating
3403 <p>Replaces the value of the <span class=
3404 "QUOTE">"User-Agent:"</span> HTTP header in client requests
3405 with the specified value.</p>
3411 <p>Parameterized.</p>
3417 <p>Any user-defined string.</p>
3423 <div class="WARNING">
3424 <table class="WARNING" border="1" width="90%">
3426 <td align="center"><b>Warning</b></td>
3431 <p>This can lead to problems on web sites that depend
3432 on looking at this header in order to customize their
3433 content for different browsers (which, by the way, is
3434 <span class="emphasis"><i class=
3435 "EMPHASIS">NOT</i></span> the right thing to do: good
3436 web sites work browser-independently).</p>
3442 <p>Using this action in multi-user setups or wherever different
3443 types of browsers will access the same <span class=
3444 "APPLICATION">Privoxy</span> is <span class=
3445 "emphasis"><i class="EMPHASIS">not recommended</i></span>. In
3446 single-user, single-browser setups, you might use it to delete
3447 your OS version information from the headers, because it is an
3448 invitation to exploit known bugs for your OS. It is also
3449 occasionally useful to forge this in order to access sites that
3450 won't let you in otherwise (though there may be a good reason
3453 <p>More information on known user-agent strings can be found at
3454 <a href="http://www.user-agents.org/" target=
3455 "_top">http://www.user-agents.org/</a> and <a href=
3456 "http://en.wikipedia.org/wiki/User_agent" target=
3457 "_top">http://en.wikipedia.org/wiki/User_agent</a>.</p>
3460 <dt>Example usage:</dt>
3463 <table border="0" bgcolor="#E0E0E0" width="90%">
3466 <pre class="SCREEN">
3467 +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
3478 <h4 class="SECT3"><a name="LIMIT-CONNECT" id="LIMIT-CONNECT">8.5.26.
3479 limit-connect</a></h4>
3481 <div class="VARIABLELIST">
3483 <dt>Typical use:</dt>
3486 <p>Prevent abuse of <span class="APPLICATION">Privoxy</span> as
3487 a TCP proxy relay or disable SSL for untrusted sites</p>
3493 <p>Specifies to which ports HTTP CONNECT requests are
3500 <p>Parameterized.</p>
3506 <p>A comma-separated list of ports or port ranges (the latter
3507 using dashes, with the minimum defaulting to 0 and the maximum
3514 <p>By default, i.e. if no <tt class=
3515 "LITERAL">limit-connect</tt> action applies, <span class=
3516 "APPLICATION">Privoxy</span> allows HTTP CONNECT requests to