1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10 TITLE="Privoxy 3.0.18 User Manual"
11 HREF="index.html"><LINK
13 TITLE="The Main Configuration File"
14 HREF="config.html"><LINK
17 HREF="filter-file.html"><LINK
20 HREF="../p_doc.css"><META
21 HTTP-EQUIV="Content-Type"
24 <LINK REL="STYLESHEET" TYPE="text/css" HREF="p_doc.css">
36 SUMMARY="Header navigation table"
45 >Privoxy 3.0.18 User Manual</TH
67 HREF="filter-file.html"
85 > The actions files are used to define what <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
105 are three action files included with <SPAN
109 differing purposes:</P
118 >match-all.action</TT
119 > - is used to define which
123 > relating to banner-blocking, images, pop-ups,
124 content modification, cookie handling etc should be applied by default.
125 It should be the first actions file loaded
133 > - defines many exceptions (both
134 positive and negative) from the default set of actions that's configured
137 >match-all.action</TT
138 >. It is a set of rules that should
139 work reasonably well as-is for most users. This file is only supposed to
140 be edited by the developers. It should be the second actions file loaded.
148 > - is intended to be for local site
149 preferences and exceptions. As an example, if your ISP or your bank
150 has specific requirements, and need special handling, this kind of
151 thing should go here. This file will not be upgraded.
161 >Set to Cautious</SPAN
167 >Set to Advanced</SPAN
171 > These have increasing levels of aggressiveness <SPAN
176 influence on your browsing unless you select them explicitly in the
179 >. A default installation should be pre-set to
183 >. New users should try this for a while before
184 adjusting the settings to more aggressive levels. The more aggressive
185 the settings, then the more likelihood there is of problems such as sites
186 not working as they should.
192 > button allows you to turn each
193 action on/off individually for fine-tuning. The <SPAN
197 button changes the actions list to low/safe settings which will activate
198 ad blocking and a minimal set of <SPAN
201 >'s features, and subsequently
202 there will be less of a chance for accidental problems. The
206 > button sets the list to a medium level of
207 other features and a low level set of privacy features. The
211 > button sets the list to a high level of
212 ad blocking and medium level of privacy. See the chart below. The latter
213 three buttons over-ride any changes via with the
217 > button. More fine-tuning can be done in the
218 lower sections of this internal page.
221 > While the actions file editor allows to enable these settings in all
222 actions files, they are only supposed to be enabled in the first one
223 to make sure you don't unintentionally overrule earlier rules.
226 > The default profiles, and their associated actions, as pre-defined in
240 >Table 1. Default Configurations</B
270 >Ad-blocking Aggressiveness</TD
280 >Ad-filtering by size</TD
290 >Ad-filtering by link</TD
310 >Privacy Features</TD
340 >GIF de-animation</TD
370 >JavaScript taming</TD
390 >Image tag reordering</TD
407 > The list of actions files to be used are defined in the main configuration
408 file, and are processed in the order they are defined (e.g.
412 > is typically processed before
416 >). The content of these can all be viewed and
418 HREF="http://config.privoxy.org/show-status"
420 >http://config.privoxy.org/show-status</A
422 The over-riding principle when applying actions, is that the last action that
423 matches a given URL wins. The broadest, most general rules go first
428 followed by any exceptions (typically also in
432 >), which are then followed lastly by any
433 local preferences (typically in <SPAN
449 > An actions file typically has multiple sections. If you want to use
453 > in an actions file, you have to place the (optional)
455 HREF="actions-file.html#ALIASES"
457 > at the top of that file.
458 Then comes the default set of rules which will apply universally to all
459 sites and pages (be <SPAN
469 > or any other actions file after
473 >, because it will override the result
474 from consulting any previous file). And then below that,
475 exceptions to the defined universal policies. You can regard
479 > as an appendix to <TT
483 with the advantage that it is a separate file, which makes preserving your
484 personal settings across <SPAN
487 > upgrades easier.</P
490 Actions can be used to block anything you want, including ads, banners, or
491 just some obnoxious URL whose content you would rather not see. Cookies can be accepted
492 or rejected, or accepted only during the current browser session (i.e. not
493 written to disk), content can be modified, some JavaScripts tamed, user-tracking
494 fooled, and much more. See below for a <A
495 HREF="actions-file.html#ACTIONS"
505 >8.1. Finding the Right Mix</A
509 HREF="actions-file.html#ACTIONS"
511 >, like cookie suppression
512 or script disabling, may render some sites unusable that rely on these
513 techniques to work properly. Finding the right mix of actions is not always easy and
514 certainly a matter of personal taste. And, things can always change, requiring
515 refinements in the configuration. In general, it can be said that the more
519 > your default settings (in the top section of the
520 actions file) are, the more exceptions for <SPAN
524 will have to make later. If, for example, you want to crunch all cookies per
525 default, you'll have to make exceptions from that rule for sites that you
526 regularly use and that require cookies for actually useful purposes, like maybe
527 your bank, favorite shop, or newspaper.</P
529 > We have tried to provide you with reasonable rules to start from in the
530 distribution actions files. But there is no general rule of thumb on these
531 things. There just are too many variables, and sites are constantly changing.
532 Sooner or later you will want to change the rules (and read this chapter again :).</P
543 > The easiest way to edit the actions files is with a browser by
544 using our browser-based editor, which can be reached from <A
545 HREF="http://config.privoxy.org/show-status"
547 >http://config.privoxy.org/show-status</A
549 Note: the config file option <A
550 HREF="config.html#ENABLE-EDIT-ACTIONS"
551 >enable-edit-actions</A
552 > must be enabled for
553 this to work. The editor allows both fine-grained control over every single
554 feature on a per-URL basis, and easy choosing from wholesale sets of defaults
565 >. Warning: the <SPAN
569 aggressive, and will be more likely to cause problems for some sites.
570 Experienced users only!
573 > If you prefer plain text editing to GUIs, you can of course also directly edit the
574 the actions files with your favorite text editor. Look at
578 > which is richly commented with many
587 >8.3. How Actions are Applied to Requests</A
590 > Actions files are divided into sections. There are special sections,
594 HREF="actions-file.html#ALIASES"
597 > sections which will
598 be discussed later. For now let's concentrate on regular sections: They have a
599 heading line (often split up to multiple lines for readability) which consist
600 of a list of actions, separated by whitespace and enclosed in curly braces.
601 Below that, there is a list of URL and tag patterns, each on a separate line.</P
603 > To determine which actions apply to a request, the URL of the request is
604 compared to all URL patterns in each <SPAN
608 Every time it matches, the list of applicable actions for the request is
609 incrementally updated, using the heading of the section in which the
610 pattern is located. The same is done again for tags and tag patterns later on.</P
612 > If multiple applying sections set the same action differently,
613 the last match wins. If not, the effects are aggregated.
614 E.g. a URL might match a regular section with a heading line of <TT
618 HREF="actions-file.html#HANDLE-AS-IMAGE"
622 then later another one with just <TT
626 HREF="actions-file.html#BLOCK"
636 > actions to apply. And there may well be
637 cases where you will want to combine actions together. Such a section then
653 >block{Banner ads.}</TT
655 # Block these as if they were images. Send no block page.
657 media.example.com/.*banners
658 .example.com/images/ads/</PRE
665 > You can trace this process for URL patterns and any given URL by visiting <A
666 HREF="http://config.privoxy.org/show-url-info"
668 >http://config.privoxy.org/show-url-info</A
671 > Examples and more detail on this is provided in the Appendix, <A
672 HREF="appendix.html#ACTIONSANAT"
673 > Troubleshooting: Anatomy of an Action</A
693 to determine what <SPAN
699 > might apply to which sites and
700 pages your browser attempts to access. These <SPAN
710 > matching to achieve a high degree of
711 flexibility. This allows one expression to be expanded and potentially match
712 against many similar patterns.</P
714 > Generally, an URL pattern has the form
717 ><domain><port>/<path></TT
721 ><domain></TT
729 > are optional. (This is why the special
733 > pattern matches all URLs). Note that the protocol
734 portion of the URL pattern (e.g. <TT
744 > be included in the pattern. This is assumed already!</P
746 > The pattern matching syntax is different for the domain and path parts of
747 the URL. The domain part uses a simple globbing type matching technique,
748 while the path part uses more flexible
750 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
759 > The port part of a pattern is a decimal port number preceded by a colon
763 >). If the domain part contains a numerical IPv6 address,
764 it has to be put into angle brackets
780 >www.example.com/</TT
784 > is a domain-only pattern and will match any request to <TT
788 regardless of which document on that server is requested. So ALL pages in
789 this domain would be covered by the scope of this action. Note that a
793 > is different and would NOT match.
803 > means exactly the same. For domain-only patterns, the trailing <TT
813 >www.example.com/index.html</TT
817 > matches all the documents on <TT
821 whose name starts with <TT
830 >www.example.com/index.html$</TT
834 > matches only the single document <TT
851 > matches the document <TT
854 >, regardless of the domain,
861 > web server anywhere.
871 > Matches any URL because there's no requirement for either the
872 domain or the path to match anything.
882 > Matches any URL pointing to TCP port 8000.
888 ><2001:db8::1>/</TT
892 > Matches any URL with the host address <TT
896 (Note that the real URL uses plain brackets, not angle brackets.)
906 > matches nothing, since it would be interpreted as a domain name and
907 there is no top-level domain called <TT
922 >8.4.1. The Domain Pattern</A
925 > The matching of the domain part offers some flexible options: if the
926 domain starts or ends with a dot, it becomes unanchored at that end.
940 > matches any domain with first-level domain <TT
944 and second-level domain <TT
957 >foo.bar.baz.example.com</TT
959 Note that it wouldn't match if the second-level domain was <TT
972 > matches any domain that <SPAN
982 > (It also matches the domain
986 > but most of the time that doesn't matter.)
996 > matches any domain that <SPAN
1006 And, by the way, also included would be any files or documents that exist
1007 within that domain since no path limitations are specified. (Correctly
1008 speaking: It matches any FQDN that contains <TT
1012 a domain.) This might be <TT
1014 >www.example.com</TT
1018 >news.example.de</TT
1022 >www.example.net/cgi/testing.pl</TT
1023 > for instance. All these
1030 > Additionally, there are wild-cards that you can use in the domain names
1031 themselves. These work similarly to shell globbing type wild-cards:
1035 > represents zero or more arbitrary characters (this is
1038 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
1045 > based syntax of <SPAN
1052 > represents any single character (this is equivalent to the
1053 regular expression syntax of a simple <SPAN
1056 >), and you can define
1059 >"character classes"</SPAN
1060 > in square brackets which is similar to
1061 the same regular expression technique. All of this can be freely mixed:</P
1065 CLASS="VARIABLELIST"
1070 >ad*.example.com</TT
1076 >"adserver.example.com"</SPAN
1080 >"ads.example.com"</SPAN
1081 >, etc but not <SPAN
1083 >"sfads.example.com"</SPAN
1090 >*ad*.example.com</TT
1094 > matches all of the above, and then some.
1110 >pictures.epix.com</TT
1113 >a.b.c.d.e.upix.com</TT
1120 >www[1-9a-ez].example.c*</TT
1126 >www1.example.com</TT
1130 >www4.example.cc</TT
1133 >wwwd.example.cy</TT
1137 >wwwz.example.com</TT
1147 >wwww.example.com</TT
1154 > While flexible, this is not the sophistication of full regular expression based syntax.</P
1162 >8.4.2. The Path Pattern</A
1173 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
1180 > for matching the path portion (after the slash),
1181 and is thus more flexible.</P
1184 HREF="appendix.html#REGEX"
1186 > with a brief quick-start into regular
1187 expressions, you also might want to have a look at your operating system's documentation
1188 on regular expressions (try <TT
1193 > Note that the path pattern is automatically left-anchored at the <SPAN
1197 i.e. it matches as if it would start with a <SPAN
1200 > (regular expression speak
1201 for the beginning of a line).</P
1203 > Please also note that matching in the path is <SPAN
1207 >CASE INSENSITIVE</I
1210 by default, but you can switch to case sensitive at any point in the pattern by using the
1216 >www.example.com/(?-i)PaTtErN.*</TT
1218 only documents whose path starts with <TT
1228 > this capitalization.</P
1232 CLASS="VARIABLELIST"
1237 >.example.com/.*</TT
1241 > Is equivalent to just <SPAN
1243 >".example.com"</SPAN
1244 >, since any documents
1245 within that domain are matched with or without the <SPAN
1249 regular expression. This is redundant
1255 >.example.com/.*/index.html$</TT
1259 > Will match any page in the domain of <SPAN
1261 >"example.com"</SPAN
1266 >, and that is part of some path. For
1267 example, it matches <SPAN
1269 >"www.example.com/testing/index.html"</SPAN
1273 >"www.example.com/index.html"</SPAN
1274 > because the regular
1275 expression called for at least two <SPAN
1279 requirement. It also would match
1282 >"www.example.com/testing/index_html"</SPAN
1284 special meta-character <SPAN
1293 >.example.com/(.*/)?index\.html$</TT
1297 > This regular expression is conditional so it will match any page
1301 > regardless of path which in this case can
1302 have one or more <SPAN
1305 >. And this one must contain exactly
1309 > (but does not have to end with that!).
1315 >.example.com/(.*/)(ads|banners?|junk)</TT
1319 > This regular expression will match any path of <SPAN
1321 >"example.com"</SPAN
1323 that contains any of the words <SPAN
1333 > (because of the <SPAN
1340 The path does not have to end in these words, just contain them.
1346 >.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</TT
1350 > This is very much the same as above, except now it must end in either
1364 one is limited to common image formats.
1370 > There are many, many good examples to be found in <TT
1374 and more tutorials below in <A
1375 HREF="appendix.html#REGEX"
1376 >Appendix on regular expressions</A
1385 >8.4.3. The Tag Pattern</A
1388 > Tag patterns are used to change the applying actions based on the
1389 request's tags. Tags can be created with either the
1391 HREF="actions-file.html#CLIENT-HEADER-TAGGER"
1392 >client-header-tagger</A
1395 HREF="actions-file.html#SERVER-HEADER-TAGGER"
1396 >server-header-tagger</A
1399 > Tag patterns have to start with <SPAN
1406 can tell them apart from URL patterns. Everything after the colon
1407 including white space, is interpreted as a regular expression with
1408 path pattern syntax, except that tag patterns aren't left-anchored
1409 automatically (<SPAN
1412 > doesn't silently add a <SPAN
1416 you have to do it yourself if you need it).</P
1418 > To match all requests that are tagged with <SPAN
1422 your pattern line should be <SPAN
1429 > would work as well, but it would also
1430 match requests whose tags contain <SPAN
1437 > wouldn't work as it requires white space.</P
1439 > Sections can contain URL and tag patterns at the same time,
1440 but tag patterns are checked after the URL patterns and thus
1441 always overrule them, even if they are located before the URL patterns.</P
1443 > Once a new tag is added, Privoxy checks right away if it's matched by one
1444 of the tag patterns and updates the action settings accordingly. As a result
1445 tags can be used to activate other tagger actions, as long as these other
1446 taggers look for headers that haven't already be parsed.</P
1448 > For example you could tag client requests which use the
1453 then use this tag to activate another tagger that adds a tag if cookies
1454 are sent, and then use a block action based on the cookie tag. This allows
1455 the outcome of one action, to be input into a subsequent action. However if
1456 you'd reverse the position of the described taggers, and activated the
1457 method tagger based on the cookie tagger, no method tags would be created.
1458 The method tagger would look for the request line, but at the time
1459 the cookie tag is created, the request line has already been parsed.</P
1461 > While this is a limitation you should be aware of, this kind of
1462 indirection is seldom needed anyway and even the example doesn't
1463 make too much sense.</P
1475 > All actions are disabled by default, until they are explicitly enabled
1476 somewhere in an actions file. Actions are turned on if preceded with a
1480 >, and turned off if preceded with a <SPAN
1489 >"do that action"</SPAN
1496 >"please block URLs that match the
1497 following patterns"</SPAN
1504 block URLs that match the following patterns, even if <TT
1508 previously applied."</SPAN
1512 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1513 separated by whitespace, like in
1516 >{+some-action -some-other-action{some-parameter}}</TT
1518 followed by a list of URL patterns, one per line, to which they apply.
1519 Together, the actions line and the following pattern lines make up a section
1520 of the actions file. </P
1523 Actions fall into three categories:</P
1531 Boolean, i.e the action can only be <SPAN
1554 > # enable action <TT
1565 > # disable action <TT
1580 >+handle-as-image</TT
1587 Parameterized, where some value is required in order to enable this type of action.
1609 >} # enable action and set parameter to <TT
1615 # overwriting parameter from previous match if necessary
1621 > # disable action. The parameter can be omitted</PRE
1628 > Note that if the URL matches multiple positive forms of a parameterized action,
1629 the last match wins, i.e. the params from earlier matches are simply ignored.
1635 >+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
1642 Multi-value. These look exactly like parameterized actions,
1643 but they behave differently: If the action applies multiple times to the
1644 same URL, but with different parameters, <SPAN
1657 > matches are remembered. This is used for actions
1658 that can be executed for the same request repeatedly, like adding multiple
1659 headers, or filtering through multiple filters. Syntax:
1680 >} # enable action and add <TT
1685 > to the list of parameters
1696 >} # remove the parameter <TT
1701 > from the list of parameters
1702 # If it was the last one left, disable the action.
1708 > # disable this action completely and remove all parameters from the list</PRE
1718 >+add-header{X-Fun-Header: Some text}</TT
1722 >+filter{html-annoyances}</TT
1729 > If nothing is specified in any actions file, no <SPAN
1733 taken. So in this case <SPAN
1737 normal, non-blocking, non-filtering proxy. You must specifically enable the
1738 privacy and blocking features you need (although the provided default actions
1739 files will give a good starting point).</P
1741 > Later defined action sections always over-ride earlier ones of the same type.
1742 So exceptions to any rules you make, should come in the latter part of the file (or
1743 in a file that is processed later when using multiple actions files such
1747 >). For multi-valued actions, the actions
1748 are applied in the order they are specified. Actions files are processed in
1749 the order they are defined in <TT
1753 installation has three actions files). It also quite possible for any given
1754 URL to match more than one <SPAN
1757 > (because of wildcards and
1758 regular expressions), and thus to trigger more than one set of actions! Last
1761 > The list of valid <SPAN
1771 >8.5.1. add-header</A
1776 CLASS="VARIABLELIST"
1782 >Confuse log analysis, custom applications</P
1788 > Sends a user defined HTTP header to the web server.
1801 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1802 It is recommended that you use the <SPAN
1816 > This action may be specified multiple times, in order to define multiple
1817 headers. This is rarely needed for the typical user. If you don't know what
1820 >"HTTP headers"</SPAN
1821 > are, you definitely don't need to worry about this
1825 > Headers added by this action are not modified by other actions.
1840 >+add-header{X-User-Tracking: sucks}</PRE
1861 CLASS="VARIABLELIST"
1867 >Block ads or other unwanted content</P
1873 > Requests for URLs to which this action applies are blocked, i.e. the
1874 requests are trapped by <SPAN
1877 > and the requested URL is never retrieved,
1878 but is answered locally with a substitute page or image, as determined by
1882 HREF="actions-file.html#HANDLE-AS-IMAGE"
1889 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1890 >set-image-blocker</A
1896 HREF="actions-file.html#HANDLE-AS-EMPTY-DOCUMENT"
1897 >handle-as-empty-document</A
1913 >A block reason that should be given to the user.</P
1922 > sends a special <SPAN
1926 for requests to blocked pages. This page contains the block reason given as
1927 parameter, a link to find out why the block action applies, and a click-through
1928 to the blocked content (the latter only if the force feature is available and
1933 A very important exception occurs if <SPAN
1946 HREF="actions-file.html#HANDLE-AS-IMAGE"
1950 apply to the same request: it will then be replaced by an image. If
1954 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1955 >set-image-blocker</A
1958 (see below) also applies, the type of image will be determined by its parameter,
1959 if not, the standard checkerboard pattern is sent.
1962 > It is important to understand this process, in order
1963 to understand how <SPAN
1967 ads and other unwanted content. Blocking is a core feature, and one
1968 upon which various other features depend.
1974 HREF="actions-file.html#FILTER"
1978 action can perform a very similar task, by <SPAN
1982 banner images and other content through rewriting the relevant URLs in the
1983 document's HTML source, so they don't get requested in the first place.
1984 Note that this is a totally different technique, and it's easy to confuse the two.
1988 >Example usage (section):</DT
1999 >{+block{No nasty stuff for you.}}
2000 # Block and replace with "blocked" page
2001 .nasty-stuff.example.com
2003 {+block{Doubleclick banners.} +handle-as-image}
2004 # Block and replace with image
2008 {+block{Layered ads.} +handle-as-empty-document}
2009 # Block and then ignore
2010 adserver.example.net/.*\.js$</PRE
2025 NAME="CHANGE-X-FORWARDED-FOR"
2026 >8.5.3. change-x-forwarded-for</A
2031 CLASS="VARIABLELIST"
2037 >Improve privacy by not forwarding the source of the request in the HTTP headers.</P
2045 >"X-Forwarded-For:"</SPAN
2046 > HTTP header from the client request,
2067 > to delete the header.</P
2074 > to create the header (or append
2075 the client's IP address to an already existing one).
2084 > It is safe and recommended to use <TT
2090 > Forwarding the source address of the request may make
2091 sense in some multi-user setups but is also a privacy risk.
2106 >+change-x-forwarded-for{block}</PRE
2121 NAME="CLIENT-HEADER-FILTER"
2122 >8.5.4. client-header-filter</A
2127 CLASS="VARIABLELIST"
2133 > Rewrite or remove single client headers.
2140 > All client headers to which this action applies are filtered on-the-fly through
2141 the specified regular expression based substitutions.
2154 > The name of a client-header filter, as defined in one of the
2156 HREF="filter-file.html"
2165 > Client-header filters are applied to each header on its own, not to
2166 all at once. This makes it easier to diagnose problems, but on the downside
2167 you can't write filters that only change header x if header y's value is z.
2168 You can do that by using tags though.
2171 > Client-header filters are executed after the other header actions have finished
2172 and use their output as input.
2175 > If the request URL gets changed, <SPAN
2178 > will detect that and use the new
2179 one. This can be used to rewrite the request destination behind the client's
2180 back, for example to specify a Tor exit relay for certain requests.
2183 > Please refer to the <A
2184 HREF="filter-file.html"
2185 >filter file chapter</A
2187 to learn which client-header filters are available by default, and how to
2192 >Example usage (section):</DT
2203 ># Hide Tor exit notation in Host and Referer Headers
2204 {+client-header-filter{hide-tor-exit-notation}}
2221 NAME="CLIENT-HEADER-TAGGER"
2222 >8.5.5. client-header-tagger</A
2227 CLASS="VARIABLELIST"
2233 > Block requests based on their headers.
2240 > Client headers to which this action applies are filtered on-the-fly through
2241 the specified regular expression based substitutions, the result is used as
2255 > The name of a client-header tagger, as defined in one of the
2257 HREF="filter-file.html"
2266 > Client-header taggers are applied to each header on its own,
2267 and as the header isn't modified, each tagger <SPAN
2274 > Client-header taggers are the first actions that are executed
2275 and their tags can be used to control every other action.
2279 >Example usage (section):</DT
2290 ># Tag every request with the User-Agent header
2291 {+client-header-tagger{user-agent}}
2294 # Tagging itself doesn't change the action
2295 # settings, sections with TAG patterns do:
2297 # If it's a download agent, use a different forwarding proxy,
2298 # show the real User-Agent and make sure resume works.
2299 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
2300 -hide-if-modified-since \
2301 -overwrite-last-modified \
2306 TAG:^User-Agent: NetBSD-ftp/
2307 TAG:^User-Agent: Novell ZYPP Installer
2308 TAG:^User-Agent: RPM APT-HTTP/
2309 TAG:^User-Agent: fetch libfetch/
2310 TAG:^User-Agent: Ubuntu APT-HTTP/
2311 TAG:^User-Agent: MPlayer/
2327 NAME="CONTENT-TYPE-OVERWRITE"
2328 >8.5.6. content-type-overwrite</A
2333 CLASS="VARIABLELIST"
2339 >Stop useless download menus from popping up, or change the browser's rendering mode</P
2345 > Replaces the <SPAN
2347 >"Content-Type:"</SPAN
2348 > HTTP server header.
2370 >"Content-Type:"</SPAN
2371 > HTTP server header is used by the
2372 browser to decide what to do with the document. The value of this
2373 header can cause the browser to open a download menu instead of
2374 displaying the document by itself, even if the document's format is
2375 supported by the browser.
2378 > The declared content type can also affect which rendering mode
2379 the browser chooses. If XHTML is delivered as <SPAN
2383 many browsers treat it as yet another broken HTML document.
2384 If it is send as <SPAN
2386 >"application/xml"</SPAN
2388 XHTML support will only display it, if the syntax is correct.
2391 > If you see a web site that proudly uses XHTML buttons, but sets
2394 >"Content-Type: text/html"</SPAN
2395 >, you can use <SPAN
2399 to overwrite it with <SPAN
2401 >"application/xml"</SPAN
2403 the web master's claim inside your XHTML-supporting browser.
2404 If the syntax is incorrect, the browser will complain loudly.
2407 > You can also go the opposite direction: if your browser prints
2408 error messages instead of rendering a document falsely declared
2409 as XHTML, you can overwrite the content type with
2413 > and have it rendered as broken HTML document.
2418 >content-type-overwrite</TT
2422 >"Content-Type:"</SPAN
2423 > headers that look like some kind of text.
2424 If you want to overwrite it unconditionally, you have to combine it with
2428 HREF="actions-file.html#FORCE-TEXT-MODE"
2432 This limitation exists for a reason, think twice before circumventing it.
2435 > Most of the time it's easier to replace this action with a custom
2439 HREF="actions-file.html#SERVER-HEADER-FILTER"
2440 >server-header filter</A
2443 It allows you to activate it for every document of a certain site and it will still
2444 only replace the content types you aimed at.
2447 > Of course you can apply <TT
2449 >content-type-overwrite</TT
2451 to a whole site and then make URL based exceptions, but it's a lot
2452 more work to get the same precision.
2456 >Example usage (sections):</DT
2467 ># Check if www.example.net/ really uses valid XHTML
2468 { +content-type-overwrite{application/xml} }
2471 # but leave the content type unmodified if the URL looks like a style sheet
2472 {-content-type-overwrite}
2473 www.example.net/.*\.css$
2474 www.example.net/.*style</PRE
2489 NAME="CRUNCH-CLIENT-HEADER"
2490 >8.5.7. crunch-client-header</A
2495 CLASS="VARIABLELIST"
2501 >Remove a client header <SPAN
2504 > has no dedicated action for.</P
2510 > Deletes every header sent by the client that contains the string the user supplied as parameter.
2530 > This action allows you to block client headers for which no dedicated
2538 > will remove every client header that
2539 contains the string you supplied as parameter.
2542 > Regular expressions are <SPAN
2549 use this action to block different headers in the same request, unless
2550 they contain the same string.
2555 >crunch-client-header</TT
2556 > is only meant for quick tests.
2557 If you have to block several different headers, or only want to modify
2558 parts of them, you should use a
2562 HREF="actions-file.html#CLIENT-HEADER-FILTER"
2563 >client-header filter</A
2586 > Don't block any header without understanding the consequences.
2594 >Example usage (section):</DT
2605 ># Block the non-existent "Privacy-Violation:" client header
2606 { +crunch-client-header{Privacy-Violation:} }
2623 NAME="CRUNCH-IF-NONE-MATCH"
2624 >8.5.8. crunch-if-none-match</A
2629 CLASS="VARIABLELIST"
2635 >Prevent yet another way to track the user's steps between sessions.</P
2643 >"If-None-Match:"</SPAN
2644 > HTTP client header.
2664 > Removing the <SPAN
2666 >"If-None-Match:"</SPAN
2667 > HTTP client header
2668 is useful for filter testing, where you want to force a real
2669 reload instead of getting status code <SPAN
2673 would cause the browser to use a cached copy of the page.
2676 > It is also useful to make sure the header isn't used as a cookie
2677 replacement (unlikely but possible).
2680 > Blocking the <SPAN
2682 >"If-None-Match:"</SPAN
2683 > header shouldn't cause any
2684 caching problems, as long as the <SPAN
2686 >"If-Modified-Since:"</SPAN
2688 isn't blocked or missing as well.
2691 > It is recommended to use this action together with
2695 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2696 >hide-if-modified-since</A
2703 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2704 >overwrite-last-modified</A
2710 >Example usage (section):</DT
2721 ># Let the browser revalidate cached documents but don't
2722 # allow the server to use the revalidation headers for user tracking.
2723 {+hide-if-modified-since{-60} \
2724 +overwrite-last-modified{randomize} \
2725 +crunch-if-none-match}
2741 NAME="CRUNCH-INCOMING-COOKIES"
2742 >8.5.9. crunch-incoming-cookies</A
2747 CLASS="VARIABLELIST"
2753 > Prevent the web server from setting HTTP cookies on your system
2762 >"Set-Cookie:"</SPAN
2763 > HTTP headers from server replies.
2783 > This action is only concerned with <SPAN
2800 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2801 >crunch-outgoing-cookies</A
2810 > to disable HTTP cookies completely.
2819 > to use this action in conjunction
2823 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2824 >session-cookies-only</A
2827 since it would prevent the session cookies from being set. See also
2831 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2832 >filter-content-cookies</A
2849 >+crunch-incoming-cookies</PRE
2864 NAME="CRUNCH-SERVER-HEADER"
2865 >8.5.10. crunch-server-header</A
2870 CLASS="VARIABLELIST"
2876 >Remove a server header <SPAN
2879 > has no dedicated action for.</P
2885 > Deletes every header sent by the server that contains the string the user supplied as parameter.
2905 > This action allows you to block server headers for which no dedicated
2909 > action exists. <SPAN
2913 will remove every server header that contains the string you supplied as parameter.
2916 > Regular expressions are <SPAN
2923 use this action to block different headers in the same request, unless
2924 they contain the same string.
2929 >crunch-server-header</TT
2930 > is only meant for quick tests.
2931 If you have to block several different headers, or only want to modify
2932 parts of them, you should use a custom
2936 HREF="actions-file.html#SERVER-HEADER-FILTER"
2937 >server-header filter</A
2960 > Don't block any header without understanding the consequences.
2968 >Example usage (section):</DT
2979 ># Crunch server headers that try to prevent caching
2980 { +crunch-server-header{no-cache} }
2996 NAME="CRUNCH-OUTGOING-COOKIES"
2997 >8.5.11. crunch-outgoing-cookies</A
3002 CLASS="VARIABLELIST"
3008 > Prevent the web server from reading any HTTP cookies from your system
3018 > HTTP headers from client requests.
3038 > This action is only concerned with <SPAN
3055 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3056 >crunch-incoming-cookies</A
3065 > to disable HTTP cookies completely.
3074 > to use this action in conjunction
3078 HREF="actions-file.html#SESSION-COOKIES-ONLY"
3079 >session-cookies-only</A
3082 since it would prevent the session cookies from being read.
3097 >+crunch-outgoing-cookies</PRE
3112 NAME="DEANIMATE-GIFS"
3113 >8.5.12. deanimate-gifs</A
3118 CLASS="VARIABLELIST"
3124 >Stop those annoying, distracting animated GIF images.</P
3130 > De-animate GIF animations, i.e. reduce them to their first or last image.
3156 > This will also shrink the images considerably (in bytes, not pixels!). If
3160 > is given, the first frame of the animation
3161 is used as the replacement. If <SPAN
3164 > is given, the last
3165 frame of the animation is used instead, which probably makes more sense for
3166 most banner animations, but also has the risk of not showing the entire
3167 last frame (if it is only a delta to an earlier frame).
3170 > You can safely use this action with patterns that will also match non-GIF
3171 objects, because no attempt will be made at anything that doesn't look like
3187 >+deanimate-gifs{last}</PRE
3202 NAME="DOWNGRADE-HTTP-VERSION"
3203 >8.5.13. downgrade-http-version</A
3208 CLASS="VARIABLELIST"
3214 >Work around (very rare) problems with HTTP/1.1</P
3220 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3240 > This is a left-over from the time when <SPAN
3244 didn't support important HTTP/1.1 features well. It is left here for the
3245 unlikely case that you experience HTTP/1.1 related problems with some server
3246 out there. Not all HTTP/1.1 features and requirements are supported yet,
3247 so there is a chance you might need this action.
3251 >Example usage (section):</DT
3262 >{+downgrade-http-version}
3263 problem-host.example.com</PRE
3278 NAME="FAST-REDIRECTS"
3279 >8.5.14. fast-redirects</A
3284 CLASS="VARIABLELIST"
3290 >Fool some click-tracking scripts and speed up indirect links.</P
3296 > Detects redirection URLs and redirects the browser without contacting
3297 the redirection server first.
3316 >"simple-check"</SPAN
3317 > to just search for the string <SPAN
3321 to detect redirection URLs.
3328 >"check-decoded-url"</SPAN
3329 > to decode URLs (if necessary) before searching
3330 for redirection URLs.
3340 Many sites, like yahoo.com, don't just link to other sites. Instead, they
3341 will link to some script on their own servers, giving the destination as a
3342 parameter, which will then redirect you to the final target. URLs
3343 resulting from this scheme typically look like:
3346 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
3350 > Sometimes, there are even multiple consecutive redirects encoded in the
3351 URL. These redirections via scripts make your web browsing more traceable,
3352 since the server from which you follow such a link can see where you go
3353 to. Apart from that, valuable bandwidth and time is wasted, while your
3354 browser asks the server for one redirect after the other. Plus, it feeds
3358 > This feature is currently not very smart and is scheduled for improvement.
3359 If it is enabled by default, you will have to create some exceptions to
3360 this action. It can lead to failures in several ways:
3363 > Not every URLs with other URLs as parameters is evil.
3364 Some sites offer a real service that requires this information to work.
3365 For example a validation service needs to know, which document to validate.
3369 > assumes that every URL parameter that
3370 looks like another URL is a redirection target, and will always redirect to
3371 the last one. Most of the time the assumption is correct, but if it isn't,
3372 the user gets redirected anyway.
3375 > Another failure occurs if the URL contains other parameters after the URL parameter.
3379 >"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</SPAN
3381 contains the redirection URL <SPAN
3383 >"http://www.example.net/"</SPAN
3385 followed by another parameter. <TT
3389 and will cause a redirect to <SPAN
3391 >"http://www.example.net/&foo=bar"</SPAN
3393 Depending on the target server configuration, the parameter will be silently ignored
3396 >"page not found"</SPAN
3397 > error. You can prevent this problem by
3401 HREF="actions-file.html#REDIRECT"
3405 to remove the last part of the URL, but it requires a little effort.
3408 > To detect a redirection URL, <TT
3412 looks for the string <SPAN
3415 >, either in plain text
3416 (invalid but often used) or encoded as <SPAN
3420 Some sites use their own URL encoding scheme, encrypt the address
3421 of the target server or replace it with a database id. In theses cases
3425 > is fooled and the request reaches the
3426 redirection server where it probably gets logged.
3441 > { +fast-redirects{simple-check} }
3444 { +fast-redirects{check-decoded-url} }
3445 another.example.com/testing</PRE
3466 CLASS="VARIABLELIST"
3472 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size),
3473 do fun text replacements, add personalized effects, etc.</P
3479 > All instances of text-based type, most notably HTML and JavaScript, to which
3480 this action applies, can be filtered on-the-fly through the specified regular
3481 expression based substitutions. (Note: as of version 3.0.3 plain text documents
3482 are exempted from filtering, because web servers often use the
3486 > MIME type for all files whose type they don't know.)
3499 > The name of a content filter, as defined in the <A
3500 HREF="filter-file.html"
3503 Filters can be defined in one or more files as defined by the
3507 HREF="config.html#FILTERFILE"
3518 > is the collection of filters
3519 supplied by the developers. Locally defined filters should go
3520 in their own file, such as <TT
3526 > When used in its negative form,
3527 and without parameters, <SPAN
3533 > filtering is completely disabled.
3540 > For your convenience, there are a number of pre-defined filters available
3541 in the distribution filter file that you can use. See the examples below for
3545 > Filtering requires buffering the page content, which may appear to
3546 slow down page rendering since nothing is displayed until all content has
3547 passed the filters. (The total time until the page is completely rendered
3548 doesn't change much, but it may be perceived as slower since the page is
3549 not incrementally displayed.)
3550 This effect will be more noticeable on slower connections.
3555 >"Rolling your own"</SPAN
3557 filters requires a knowledge of
3559 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
3568 HREF="http://en.wikipedia.org/wiki/Html"
3575 This is very powerful feature, and potentially very intrusive.
3576 Filters should be used with caution, and where an equivalent
3583 > The amount of data that can be filtered is limited to the
3587 HREF="config.html#BUFFER-LIMIT"
3591 option in the main <A
3595 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
3596 data, and all pending data, is passed through unfiltered.
3599 > Inappropriate MIME types, such as zipped files, are not filtered at all.
3600 (Again, only text-based types except plain text). Encrypted SSL data
3601 (from HTTPS servers) cannot be filtered either, since this would violate
3602 the integrity of the secure transaction. In some situations it might
3603 be necessary to protect certain text, like source code, from filtering
3604 by defining appropriate <TT
3610 > Compressed content can't be filtered either, unless <SPAN
3614 is compiled with zlib support (requires at least <SPAN
3621 > will decompress the content before filtering
3625 > If you use a <SPAN
3628 > version without zlib support, but want filtering to work on
3629 as much documents as possible, even those that would normally be sent compressed,
3630 you must use the <TT
3633 HREF="actions-file.html#PREVENT-COMPRESSION"
3634 >prevent-compression</A
3637 action in conjunction with <TT
3643 > Content filtering can achieve some of the same effects as the
3647 HREF="actions-file.html#BLOCK"
3651 action, i.e. it can be used to block ads and banners. But the mechanism
3652 works quite differently. One effective use, is to block ad banners
3653 based on their size (see below), since many of these seem to be somewhat
3660 > with suggestions for new or
3661 improved filters is particularly welcome!
3664 > The below list has only the names and a one-line description of each
3665 predefined filter. There are <A
3666 HREF="filter-file.html#PREDEFINED-FILTERS"
3668 verbose explanations</A
3669 > of what these filters do in the <A
3670 HREF="filter-file.html"
3671 >filter file chapter</A
3676 >Example usage (with filters from the distribution <TT
3681 HREF="filter-file.html#PREDEFINED-FILTERS"
3682 >the Predefined Filters section</A
3684 more explanation on each:</DT
3688 NAME="FILTER-JS-ANNOYANCES"
3699 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse.</PRE
3707 NAME="FILTER-JS-EVENTS"
3718 >+filter{js-events} # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).</PRE
3726 NAME="FILTER-HTML-ANNOYANCES"
3737 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse.</PRE
3745 NAME="FILTER-CONTENT-COOKIES"
3756 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content.</PRE
3764 NAME="FILTER-REFRESH-TAGS"
3775 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups).</PRE
3783 NAME="FILTER-UNSOLICITED-POPUPS"
3794 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.</PRE
3802 NAME="FILTER-ALL-POPUPS"
3813 >+filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.</PRE
3821 NAME="FILTER-IMG-REORDER"
3832 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective.</PRE
3840 NAME="FILTER-BANNERS-BY-SIZE"
3851 >+filter{banners-by-size} # Kill banners by size.</PRE
3859 NAME="FILTER-BANNERS-BY-LINK"
3870 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers.</PRE
3878 NAME="FILTER-WEBBUGS"
3889 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking).</PRE
3897 NAME="FILTER-TINY-TEXTFORMS"
3908 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap.</PRE
3916 NAME="FILTER-JUMPING-WINDOWS"
3927 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves.</PRE
3935 NAME="FILTER-FRAMESET-BORDERS"
3946 >+filter{frameset-borders} # Give frames a border and make them resizable.</PRE
3954 NAME="FILTER-DEMORONIZER"
3965 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets.</PRE
3973 NAME="FILTER-SHOCKWAVE-FLASH"
3984 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects.</PRE
3992 NAME="FILTER-QUICKTIME-KIOSKMODE"
4003 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable.</PRE
4022 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
4030 NAME="FILTER-CRUDE-PARENTAL"
4041 >+filter{crude-parental} # Crude parental filtering. Note that this filter doesn't work reliably.</PRE
4049 NAME="FILTER-IE-EXPLOITS"
4060 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits.</PRE
4068 NAME="FILTER-SITE-SPECIFICS"
4079 >+filter{site-specifics} # Cure for site-specific problems. Don't apply generally!</PRE
4087 NAME="FILTER-NO-PING"
4098 >+filter{no-ping} # Removes non-standard ping attributes in <a> and <area> tags.</PRE
4106 NAME="FILTER-GOOGLE"
4117 >+filter{google} # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</PRE
4136 >+filter{yahoo} # CSS-based block for Yahoo text ads. Also removes a width limitation.</PRE
4155 >+filter{msn} # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</PRE
4163 NAME="FILTER-BLOGSPOT"
4174 >+filter{blogspot} # Cleans up some Blogspot blogs. Read the fine print before using this.</PRE
4189 NAME="FORCE-TEXT-MODE"
4190 >8.5.16. force-text-mode</A
4195 CLASS="VARIABLELIST"
4204 > to treat a document as if it was in some kind of <SPAN
4216 > Declares a document as text, even if the <SPAN
4218 >"Content-Type:"</SPAN
4219 > isn't detected as such.
4242 HREF="actions-file.html#FILTER"
4249 > tries to only filter files that are
4250 in some kind of text format. The same restrictions apply to
4254 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4255 >content-type-overwrite</A
4260 >force-text-mode</TT
4261 > declares a document as text,
4262 without looking at the <SPAN
4264 >"Content-Type:"</SPAN
4286 > Think twice before activating this action. Filtering binary data
4287 with regular expressions can cause file damage.
4322 NAME="FORWARD-OVERRIDE"
4323 >8.5.17. forward-override</A
4328 CLASS="VARIABLELIST"
4334 >Change the forwarding settings based on User-Agent or request origin</P
4340 > Overrules the forward directives in the configuration file.
4360 > to use a direct connection without any additional proxies.</P
4366 >"forward 127.0.0.1:8123"</SPAN
4367 > to use the HTTP proxy listening at 127.0.0.1 port 8123.
4374 >"forward-socks4a 127.0.0.1:9050 ."</SPAN
4375 > to use the socks4a proxy listening at
4376 127.0.0.1 port 9050. Replace <SPAN
4378 >"forward-socks4a"</SPAN
4381 >"forward-socks4"</SPAN
4383 to use a socks4 connection (with local DNS resolution) instead, use <SPAN
4385 >"forward-socks5"</SPAN
4387 for socks5 connections (with remote DNS resolution).
4394 >"forward-socks4a 127.0.0.1:9050 proxy.example.org:8000"</SPAN
4395 > to use the socks4a proxy
4396 listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000.
4399 >"forward-socks4a"</SPAN
4402 >"forward-socks4"</SPAN
4403 > to use a socks4 connection
4404 (with local DNS resolution) instead, use <SPAN
4406 >"forward-socks5"</SPAN
4408 for socks5 connections (with remote DNS resolution).
4417 > This action takes parameters similar to the
4419 HREF="config.html#FORWARDING"
4421 > directives in the configuration
4422 file, but without the URL pattern. It can be used as replacement, but normally it's only
4423 used in cases where matching based on the request URL isn't sufficient.
4444 > Please read the description for the <A
4445 HREF="config.html#FORWARDING"
4448 using this action. Forwarding to the wrong people will reduce your privacy and increase the
4449 chances of man-in-the-middle attacks.
4452 > If the ports are missing or invalid, default values will be used. This might change
4453 in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy
4458 HREF="http://config.privoxy.org/show-url-info"
4460 >show-url-info CGI page</A
4462 to verify that your forward settings do what you thought the do.
4481 ># Always use direct connections for requests previously tagged as
4484 >"User-Agent: fetch libfetch/2.0"</SPAN
4486 # resuming downloads continues to work.
4487 # This way you can continue to use Tor for your normal browsing,
4488 # without overloading the Tor network with your FreeBSD ports updates
4489 # or downloads of bigger files like ISOs.
4490 # Note that HTTP headers are easy to fake and therefore their
4491 # values are as (un)trustworthy as your clients and users.
4492 {+forward-override{forward .} \
4493 -hide-if-modified-since \
4494 -overwrite-last-modified \
4496 TAG:^User-Agent: fetch libfetch/2\.0$
4512 NAME="HANDLE-AS-EMPTY-DOCUMENT"
4513 >8.5.18. handle-as-empty-document</A
4518 CLASS="VARIABLELIST"
4524 >Mark URLs that should be replaced by empty documents <SPAN
4528 >if they get blocked</I
4536 > This action alone doesn't do anything noticeable. It just marks URLs.
4540 HREF="actions-file.html#BLOCK"
4550 the presence or absence of this mark decides whether an HTML <SPAN
4554 page, or an empty document will be sent to the client as a substitute for the blocked content.
4561 > document isn't literally empty, but actually contains a single space.
4581 > Some browsers complain about syntax errors if JavaScript documents
4582 are blocked with <SPAN
4586 default HTML page; this option can be used to silence them.
4587 And of course this action can also be used to eliminate the <SPAN
4591 BLOCKED message in frames.
4594 > The content type for the empty document can be specified with
4598 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4599 >content-type-overwrite{}</A
4602 but usually this isn't necessary.
4617 ># Block all documents on example.org that end with ".js",
4618 # but send an empty document instead of the usual HTML message.
4619 {+block{Blocked JavaScript} +handle-as-empty-document}
4636 NAME="HANDLE-AS-IMAGE"
4637 >8.5.19. handle-as-image</A
4642 CLASS="VARIABLELIST"
4648 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
4652 >if they do get blocked</I
4654 >, rather than HTML pages)</P
4660 > This action alone doesn't do anything noticeable. It just marks URLs as images.
4664 HREF="actions-file.html#BLOCK"
4674 the presence or absence of this mark decides whether an HTML <SPAN
4678 page, or a replacement image (as determined by the <TT
4681 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4682 >set-image-blocker</A
4684 > action) will be sent to the
4685 client as a substitute for the blocked content.
4705 > The below generic example section is actually part of <TT
4709 It marks all URLs with well-known image file name extensions as images and should
4713 > Users will probably only want to use the handle-as-image action in conjunction with
4717 HREF="actions-file.html#BLOCK"
4720 >, to block sources of banners, whose URLs don't
4721 reflect the file type, like in the second example section.
4724 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
4725 frames require an HTML page to be sent, or they won't display properly.
4728 >handle-as-image</TT
4729 > in this situation will not replace the
4730 ad frame with an image, but lead to error messages.
4734 >Example usage (sections):</DT
4745 ># Generic image extensions:
4748 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4750 # These don't look like images, but they're banners and should be
4751 # blocked as images:
4753 {+block{Nasty banners.} +handle-as-image}
4754 nasty-banner-server.example.com/junk.cgi\?output=trash</PRE
4769 NAME="HIDE-ACCEPT-LANGUAGE"
4770 >8.5.20. hide-accept-language</A
4775 CLASS="VARIABLELIST"
4781 >Pretend to use different language settings.</P
4787 > Deletes or replaces the <SPAN
4789 >"Accept-Language:"</SPAN
4790 > HTTP header in client requests.
4806 >, or any user defined value.
4813 > Faking the browser's language settings can be useful to make a
4814 foreign User-Agent set with
4818 HREF="actions-file.html#HIDE-USER-AGENT"
4825 > However some sites with content in different languages check the
4828 >"Accept-Language:"</SPAN
4829 > to decide which one to take by default.
4830 Sometimes it isn't possible to later switch to another language without
4833 >"Accept-Language:"</SPAN
4837 > Therefore it's a good idea to either only change the
4840 >"Accept-Language:"</SPAN
4841 > header to languages you understand,
4842 or to languages that aren't wide spread.
4845 > Before setting the <SPAN
4847 >"Accept-Language:"</SPAN
4849 to a rare language, you should consider that it helps to
4850 make your requests unique and thus easier to trace.
4851 If you don't plan to change this header frequently,
4852 you should stick to a common language.
4856 >Example usage (section):</DT
4867 ># Pretend to use Canadian language settings.
4868 {+hide-accept-language{en-ca} \
4869 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4886 NAME="HIDE-CONTENT-DISPOSITION"
4887 >8.5.21. hide-content-disposition</A
4892 CLASS="VARIABLELIST"
4898 >Prevent download menus for content you prefer to view inside the browser.</P
4904 > Deletes or replaces the <SPAN
4906 >"Content-Disposition:"</SPAN
4907 > HTTP header set by some servers.
4923 >, or any user defined value.
4930 > Some servers set the <SPAN
4932 >"Content-Disposition:"</SPAN
4934 documents they assume you want to save locally before viewing them.
4937 >"Content-Disposition:"</SPAN
4938 > header contains the file name
4939 the browser is supposed to use by default.
4942 > In most browsers that understand this header, it makes it impossible to
4949 > the document, without downloading it first,
4950 even if it's just a simple text file or an image.
4953 > Removing the <SPAN
4955 >"Content-Disposition:"</SPAN
4957 to prevent this annoyance, but some browsers additionally check the
4960 >"Content-Type:"</SPAN
4961 > header, before they decide if they can
4962 display a document without saving it first. In these cases, you have
4963 to change this header as well, before the browser stops displaying
4967 > It is also possible to change the server's file name suggestion
4968 to another one, but in most cases it isn't worth the time to set
4972 > This action will probably be removed in the future,
4973 use server-header filters instead.
4988 ># Disarm the download link in Sourceforge's patch tracker
4990 +content-type-overwrite{text/plain}\
4991 +hide-content-disposition{block} }
4992 .sourceforge.net/tracker/download\.php</PRE
5007 NAME="HIDE-IF-MODIFIED-SINCE"
5008 >8.5.22. hide-if-modified-since</A
5013 CLASS="VARIABLELIST"
5019 >Prevent yet another way to track the user's steps between sessions.</P
5027 >"If-Modified-Since:"</SPAN
5028 > HTTP client header or modifies its value.
5044 >, or a user defined value that specifies a range of hours.
5051 > Removing this header is useful for filter testing, where you want to force a real
5052 reload instead of getting status code <SPAN
5055 >, which would cause the
5056 browser to use a cached copy of the page.
5059 > Instead of removing the header, <TT
5061 >hide-if-modified-since</TT
5063 also add or subtract a random amount of time to/from the header's value.
5064 You specify a range of minutes where the random factor should be chosen from and
5068 > does the rest. A negative value means
5069 subtracting, a positive value adding.
5072 > Randomizing the value of the <SPAN
5074 >"If-Modified-Since:"</SPAN
5076 it less likely that the server can use the time as a cookie replacement,
5077 but you will run into caching problems if the random range is too high.
5080 > It is a good idea to only use a small negative value and let
5084 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
5085 >overwrite-last-modified</A
5088 handle the greater changes.
5091 > It is also recommended to use this action together with
5095 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5096 >crunch-if-none-match</A
5099 otherwise it's more or less pointless.
5103 >Example usage (section):</DT
5114 ># Let the browser revalidate but make tracking based on the time less likely.
5115 {+hide-if-modified-since{-60} \
5116 +overwrite-last-modified{randomize} \
5117 +crunch-if-none-match}
5133 NAME="HIDE-FROM-HEADER"
5134 >8.5.23. hide-from-header</A
5139 CLASS="VARIABLELIST"
5145 >Keep your (old and ill) browser from telling web servers your email address</P
5151 > Deletes any existing <SPAN
5154 > HTTP header, or replaces it with the
5171 >, or any user defined value.
5181 > will completely remove the header
5182 (not to be confused with the <TT
5185 HREF="actions-file.html#BLOCK"
5192 > Alternately, you can specify any value you prefer to be sent to the web
5193 server. If you do, it is a matter of fairness not to use any address that
5194 is actually used by a real person.
5197 > This action is rarely needed, as modern web browsers don't send
5216 >+hide-from-header{block}</PRE
5229 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
5244 NAME="HIDE-REFERRER"
5245 >8.5.24. hide-referrer</A
5253 CLASS="VARIABLELIST"
5259 >Conceal which link you followed to get to a particular site</P
5268 > (sic) HTTP header from the client request,
5269 or replaces it with a forged one.
5288 >"conditional-block"</SPAN
5289 > to delete the header completely if the host has changed.</P
5295 >"conditional-forge"</SPAN
5296 > to forge the header if the host has changed.</P
5303 > to delete the header unconditionally.</P
5310 > to pretend to be coming from the homepage of the server we are talking to.</P
5314 >Any other string to set a user defined referrer.</P
5324 >conditional-block</TT
5325 > is the only parameter,
5326 that isn't easily detected in the server's log file. If it blocks the
5327 referrer, the request will look like the visitor used a bookmark or
5328 typed in the address directly.
5331 > Leaving the referrer unmodified for requests on the same host
5332 allows the server owner to see the visitor's <SPAN
5336 but in most cases she could also get that information by comparing
5337 other parts of the log file: for example the User-Agent if it isn't
5338 a very common one, or the user's IP address if it doesn't change between
5342 > Always blocking the referrer, or using a custom one, can lead to
5343 failures on servers that check the referrer before they answer any
5344 requests, in an attempt to prevent their content from being
5345 embedded or linked to elsewhere.
5350 >conditional-block</TT
5355 will work with referrer checks, as long as content and valid referring page
5356 are on the same host. Most of the time that's the case.
5363 > is an alternate spelling of
5367 > and the two can be can be freely
5368 substituted with each other. (<SPAN
5372 correct English spelling, however the HTTP specification has a bug - it
5373 requires it to be spelled as <SPAN
5391 >+hide-referrer{forge}</PRE
5404 >+hide-referrer{http://www.yahoo.com/}</PRE
5419 NAME="HIDE-USER-AGENT"
5420 >8.5.25. hide-user-agent</A
5425 CLASS="VARIABLELIST"
5431 >Try to conceal your type of browser and client operating system</P
5437 > Replaces the value of the <SPAN
5439 >"User-Agent:"</SPAN
5441 in client requests with the specified value.
5454 > Any user-defined string.
5479 > This can lead to problems on web sites that depend on looking at this header in
5480 order to customize their content for different browsers (which, by the
5487 > the right thing to do: good web sites
5488 work browser-independently).
5495 > Using this action in multi-user setups or wherever different types of
5496 browsers will access the same <SPAN
5506 >. In single-user, single-browser
5507 setups, you might use it to delete your OS version information from
5508 the headers, because it is an invitation to exploit known bugs for your
5509 OS. It is also occasionally useful to forge this in order to access
5510 sites that won't let you in otherwise (though there may be a good
5511 reason in some cases). Example of this: some MSN sites will not
5515 > enter, yet forging to a
5519 > user-agent works just fine.
5520 (Must be just a silly MS goof, I'm sure :-).
5523 > More information on known user-agent strings can be found at
5525 HREF="http://www.user-agents.org/"
5527 >http://www.user-agents.org/</A
5531 HREF="http://en.wikipedia.org/wiki/User_agent"
5533 >http://en.wikipedia.org/wiki/User_agent</A
5549 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
5564 NAME="LIMIT-CONNECT"
5565 >8.5.26. limit-connect</A
5570 CLASS="VARIABLELIST"
5576 >Prevent abuse of <SPAN
5579 > as a TCP proxy relay or disable SSL for untrusted sites</P
5585 > Specifies to which ports HTTP CONNECT requests are allowable.
5598 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5599 defaulting to 0 and the maximum to 65K).
5606 > By default, i.e. if no <TT
5613 > allows HTTP CONNECT requests to all
5617 > if fine-grained control
5618 is desired for some or all destinations.
5621 > The CONNECT methods exists in HTTP to allow access to secure websites
5625 > URLs) through proxies. It works very simply:
5626 the proxy connects to the server on the specified port, and then
5627 short-circuits its connections to the client and to the remote server.
5628 This means CONNECT-enabled proxies can be used as TCP relays very easily.
5634 > relays HTTPS traffic without seeing
5635 the decoded content. Websites can leverage this limitation to circumvent <SPAN
5639 filters. By specifying an invalid port range you can disable HTTPS entirely.
5643 >Example usages:</DT
5654 >+limit-connect{443} # Port 443 is OK.
5655 +limit-connect{80,443} # Ports 80 and 443 are OK.
5656 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5657 +limit-connect{-} # All ports are OK
5658 +limit-connect{,} # No HTTPS/SSL traffic is allowed</PRE
5673 NAME="PREVENT-COMPRESSION"
5674 >8.5.27. prevent-compression</A
5679 CLASS="VARIABLELIST"
5685 > Ensure that servers send the content uncompressed, so it can be
5689 HREF="actions-file.html#FILTER"
5699 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5719 > More and more websites send their content compressed by default, which
5720 is generally a good idea and saves bandwidth. But the <TT
5723 HREF="actions-file.html#FILTER"
5730 HREF="actions-file.html#DEANIMATE-GIFS"
5734 actions need access to the uncompressed data.
5737 > When compiled with zlib support (available since <SPAN
5740 > 3.0.7), content that should be
5741 filtered is decompressed on-the-fly and you don't have to worry about this action.
5742 If you are using an older <SPAN
5745 > version, or one that hasn't been compiled with zlib
5746 support, this action can be used to convince the server to send the content uncompressed.
5749 > Most text-based instances compress very well, the size is seldom decreased by less than 50%,
5750 for markup-heavy instances like news feeds saving more than 90% of the original size isn't
5754 > Not using compression will therefore slow down the transfer, and you should only
5755 enable this action if you really need it. As of <SPAN
5758 > 3.0.7 it's disabled in all
5759 predefined action settings.
5762 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5763 documents correctly. Broken PHP applications tend to send an empty document body,
5764 some IIS versions only send the beginning of the content. If you enable
5767 >prevent-compression</TT
5768 > per default, you might want to add
5769 exceptions for those sites. See the example for how to do that.
5773 >Example usage (sections):</DT
5784 ># Selectively turn off compression, and enable a filter
5786 { +filter{tiny-textforms} +prevent-compression }
5787 # Match only these sites
5792 # Or instead, we could set a universal default:
5794 { +prevent-compression }
5797 # Then maybe make exceptions for broken sites:
5799 { -prevent-compression }
5815 NAME="OVERWRITE-LAST-MODIFIED"
5816 >8.5.28. overwrite-last-modified</A
5821 CLASS="VARIABLELIST"
5827 >Prevent yet another way to track the user's steps between sessions.</P
5835 >"Last-Modified:"</SPAN
5836 > HTTP server header or modifies its value.
5849 > One of the keywords: <SPAN
5854 >"reset-to-request-time"</SPAN
5866 > Removing the <SPAN
5868 >"Last-Modified:"</SPAN
5869 > header is useful for filter
5870 testing, where you want to force a real reload instead of getting status
5874 >, which would cause the browser to reuse the old
5875 version of the page.
5881 > option overwrites the value of the
5884 >"Last-Modified:"</SPAN
5885 > header with a randomly chosen time
5886 between the original value and the current time. In theory the server
5887 could send each document with a different <SPAN
5889 >"Last-Modified:"</SPAN
5891 header to track visits without using cookies. <SPAN
5895 makes it impossible and the browser can still revalidate cached documents.
5900 >"reset-to-request-time"</SPAN
5901 > overwrites the value of the
5904 >"Last-Modified:"</SPAN
5905 > header with the current time. You could use
5906 this option together with
5910 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5911 >hide-if-modified-since</A
5914 to further customize your random range.
5917 > The preferred parameter here is <SPAN
5921 to use, as long as the time settings are more or less correct.
5922 If the server sets the <SPAN
5924 >"Last-Modified:"</SPAN
5925 > header to the time
5926 of the request, the random range becomes zero and the value stays the same.
5927 Therefore you should later randomize it a second time with
5931 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5932 >hided-if-modified-since</A
5938 > It is also recommended to use this action together with
5942 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5943 >crunch-if-none-match</A
5960 ># Let the browser revalidate without being tracked across sessions
5961 { +hide-if-modified-since{-60} \
5962 +overwrite-last-modified{randomize} \
5963 +crunch-if-none-match}
5980 >8.5.29. redirect</A
5985 CLASS="VARIABLELIST"
5991 > Redirect requests to other sites.
5998 > Convinces the browser that the requested document has been moved
5999 to another location and the browser should get it from there.
6012 > An absolute URL or a single pcrs command.
6019 > Requests to which this action applies are answered with a
6020 HTTP redirect to URLs of your choosing. The new URL is
6021 either provided as parameter, or derived by applying a
6022 single pcrs command to the original URL.
6025 > This action will be ignored if you use it together with
6029 HREF="actions-file.html#BLOCK"
6033 It can be combined with
6037 HREF="actions-file.html#FAST-REDIRECTS"
6038 >fast-redirects{check-decoded-url}</A
6041 to redirect to a decoded version of a rewritten URL.
6044 > Use this action carefully, make sure not to create redirection loops
6045 and be aware that using your own redirects might make it
6046 possible to fingerprint your requests.
6049 > In case of problems with your redirects, or simply to watch
6050 them working, enable <A
6051 HREF="config.html#DEBUG"
6057 >Example usages:</DT
6068 ># Replace example.com's style sheet with another one
6069 { +redirect{http://localhost/css-replacements/example.com.css} }
6070 example.com/stylesheet\.css
6072 # Create a short, easy to remember nickname for a favorite site
6073 # (relies on the browser accept and forward invalid URLs to <SPAN
6077 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
6080 # Always use the expanded view for Undeadly.org articles
6081 # (Note the $ at the end of the URL pattern to make sure
6082 # the request for the rewritten URL isn't redirected as well)
6083 {+redirect{s@$@&mode=expanded@}}
6084 undeadly.org/cgi\?action=article&sid=\d*$
6086 # Redirect Google search requests to MSN
6087 {+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
6090 # Redirect MSN search requests to Yahoo
6091 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
6092 search.msn.com//results\.aspx\?q=
6094 # Redirect remote requests for this manual
6095 # to the local version delivered by Privoxy
6096 {+redirect{s@^http://www@http://config@}}
6097 www.privoxy.org/user-manual/</PRE
6112 NAME="SERVER-HEADER-FILTER"
6113 >8.5.30. server-header-filter</A
6118 CLASS="VARIABLELIST"
6124 > Rewrite or remove single server headers.
6131 > All server headers to which this action applies are filtered on-the-fly
6132 through the specified regular expression based substitutions.
6145 > The name of a server-header filter, as defined in one of the
6147 HREF="filter-file.html"
6156 > Server-header filters are applied to each header on its own, not to
6157 all at once. This makes it easier to diagnose problems, but on the downside
6158 you can't write filters that only change header x if header y's value is z.
6159 You can do that by using tags though.
6162 > Server-header filters are executed after the other header actions have finished
6163 and use their output as input.
6166 > Please refer to the <A
6167 HREF="filter-file.html"
6168 >filter file chapter</A
6170 to learn which server-header filters are available by default, and how to
6175 >Example usage (section):</DT
6186 >{+server-header-filter{html-to-xml}}
6187 example.org/xml-instance-that-is-delivered-as-html
6189 {+server-header-filter{xml-to-html}}
6190 example.org/instance-that-is-delivered-as-xml-but-is-not
6206 NAME="SERVER-HEADER-TAGGER"
6207 >8.5.31. server-header-tagger</A
6212 CLASS="VARIABLELIST"
6218 > Enable or disable filters based on the Content-Type header.
6225 > Server headers to which this action applies are filtered on-the-fly through
6226 the specified regular expression based substitutions, the result is used as
6240 > The name of a server-header tagger, as defined in one of the
6242 HREF="filter-file.html"
6251 > Server-header taggers are applied to each header on its own,
6252 and as the header isn't modified, each tagger <SPAN
6259 > Server-header taggers are executed before all other header actions
6260 that modify server headers. Their tags can be used to control
6261 all of the other server-header actions, the content filters
6262 and the crunch actions (<A
6263 HREF="actions-file.html#REDIRECT"
6267 HREF="actions-file.html#BLOCK"
6272 > Obviously crunching based on tags created by server-header taggers
6273 doesn't prevent the request from showing up in the server's log file.
6277 >Example usage (section):</DT
6288 ># Tag every request with the content type declared by the server
6289 {+server-header-tagger{content-type}}
6306 NAME="SESSION-COOKIES-ONLY"
6307 >8.5.32. session-cookies-only</A
6312 CLASS="VARIABLELIST"
6318 > Allow only temporary <SPAN
6321 > cookies (for the current
6322 browser session <SPAN
6340 >"Set-Cookie:"</SPAN
6342 server headers. Most browsers will not store such cookies permanently and
6343 forget them in between sessions.
6363 > This is less strict than <TT
6366 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6367 >crunch-incoming-cookies</A
6373 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6374 >crunch-outgoing-cookies</A
6376 > and allows you to browse
6377 websites that insist or rely on setting cookies, without compromising your privacy too badly.
6380 > Most browsers will not permanently store cookies that have been processed by
6383 >session-cookies-only</TT
6384 > and will forget about them between sessions.
6385 This makes profiling cookies useless, but won't break sites which require cookies so
6386 that you can log in for transactions. This is generally turned on for all
6387 sites, and is the recommended setting.
6398 >session-cookies-only</TT
6403 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6404 >crunch-incoming-cookies</A
6410 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6411 >crunch-outgoing-cookies</A
6413 >. If you do, cookies
6414 will be plainly killed.
6417 > Note that it is up to the browser how it handles such cookies without an <SPAN
6421 field. If you use an exotic browser, you might want to try it out to be sure.
6424 > This setting also has no effect on cookies that may have been stored
6425 previously by the browser before starting <SPAN
6429 These would have to be removed manually.
6437 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6438 >content-cookies filter</A
6440 to block some types of cookies. Content cookies are not effected by
6443 >session-cookies-only</TT
6459 >+session-cookies-only</PRE
6474 NAME="SET-IMAGE-BLOCKER"
6475 >8.5.33. set-image-blocker</A
6480 CLASS="VARIABLELIST"
6486 >Choose the replacement for blocked images</P
6492 > This action alone doesn't do anything noticeable. If <SPAN
6502 HREF="actions-file.html#BLOCK"
6514 HREF="actions-file.html#HANDLE-AS-IMAGE"
6524 apply, i.e. if the request is to be blocked as an image,
6531 > the parameter of this action decides what will be
6532 sent as a replacement.
6552 > to send a built-in checkerboard pattern image. The image is visually
6553 decent, scales very well, and makes it obvious where banners were busted.
6561 > to send a built-in transparent image. This makes banners disappear
6562 completely, but makes it hard to detect where <SPAN
6566 images on a given page and complicates troubleshooting if <SPAN
6570 has blocked innocent images, like navigation icons.
6584 send a redirect to <TT
6590 to any image anywhere, even in your local filesystem via <SPAN
6594 (But note that not all browsers support redirecting to a local file system).
6597 > A good application of redirects is to use special <SPAN
6601 URLs, which send the built-in images, as <TT
6607 This has the same visual effect as specifying <SPAN
6614 the first place, but enables your browser to cache the replacement image, instead of requesting
6615 it over and over again.
6624 > The URLs for the built-in images are <SPAN
6626 >"http://config.privoxy.org/send-banner?type=<TT
6647 > There is a third (advanced) type, called <SPAN
6659 >set-image-blocker</TT
6660 >, but meant for use from <A
6661 HREF="filter-file.html"
6664 Auto will select the type of image that would have applied to the referring page, had it been an image.
6682 >+set-image-blocker{pattern}</PRE
6689 > Redirect to the BSD daemon:
6700 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6707 > Redirect to the built-in pattern for better caching:
6718 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6737 > Note that many of these actions have the potential to cause a page to
6738 misbehave, possibly even not to display at all. There are many ways
6739 a site designer may choose to design his site, and what HTTP header
6740 content, and other criteria, he may depend on. There is no way to have hard
6741 and fast rules for all sites. See the <A
6742 HREF="appendix.html#ACTIONSANAT"
6744 > for a brief example on troubleshooting
6767 >, can be defined by combining other actions.
6768 These can in turn be invoked just like the built-in actions.
6769 Currently, an alias name can contain any character except space, tab,
6787 > that you only use <SPAN
6807 Alias names are not case sensitive, and are not required to start with a
6814 > sign, since they are merely textually
6817 > Aliases can be used throughout the actions file, but they <SPAN
6822 defined in a special section at the top of the file!</I
6825 And there can only be one such section per actions file. Each actions file may
6826 have its own alias section, and the aliases defined in it are only visible
6827 within that file.</P
6829 > There are two main reasons to use aliases: One is to save typing for frequently
6830 used combinations of actions, the other one is a gain in flexibility: If you
6831 decide once how you want to handle shops by defining an alias called
6835 >, you can later change your policy on shops in
6842 > place, and your changes will take effect everywhere
6843 in the actions file where the <SPAN
6846 > alias is used. Calling aliases
6847 by their purpose also makes your actions files more readable.</P
6849 > Currently, there is one big drawback to using aliases, though:
6853 >'s built-in web-based action file
6854 editor honors aliases when reading the actions files, but it expands
6855 them before writing. So the effects of your aliases are of course preserved,
6856 but the aliases themselves are lost when you edit sections that use aliases
6859 > Now let's define some aliases...</P
6869 > # Useful custom aliases we can use later.
6871 # Note the (required!) section header line and that this section
6872 # must be at the top of the actions file!
6876 # These aliases just save typing later:
6877 # (Note that some already use other aliases!)
6879 +crunch-all-cookies = +<A
6880 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6881 >crunch-incoming-cookies</A
6883 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6884 >crunch-outgoing-cookies</A
6886 -crunch-all-cookies = -<A
6887 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6888 >crunch-incoming-cookies</A
6890 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6891 >crunch-outgoing-cookies</A
6893 +block-as-image = +block{Blocked image.} +handle-as-image
6894 allow-all-cookies = -crunch-all-cookies -<A
6895 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6896 >session-cookies-only</A
6898 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6899 >filter{content-cookies}</A
6902 # These aliases define combinations of actions
6903 # that are useful for certain types of sites:
6906 HREF="actions-file.html#BLOCK"
6909 HREF="actions-file.html#FILTER"
6911 > -crunch-all-cookies -<A
6912 HREF="actions-file.html#FAST-REDIRECTS"
6915 HREF="actions-file.html#HIDE-REFERER"
6918 HREF="actions-file.html#PREVENT-COMPRESSION"
6919 >prevent-compression</A
6922 shop = -crunch-all-cookies -<A
6923 HREF="actions-file.html#FILTER-ALL-POPUPS"
6924 >filter{all-popups}</A
6927 # Short names for other aliases, for really lazy people ;-)
6929 c0 = +crunch-all-cookies
6930 c1 = -crunch-all-cookies</PRE
6936 > ...and put them to use. These sections would appear in the lower part of an
6937 actions file and define exceptions to the default actions (as specified further
6951 > # These sites are either very complex or very keen on
6952 # user data and require minimal interference to work:
6955 .office.microsoft.com
6956 .windowsupdate.microsoft.com
6957 # Gmail is really mail.google.com, not gmail.com
6961 # Allow cookies (for setting and retrieving your customer data)
6965 .worldpay.com # for quietpc.com
6968 # These shops require pop-ups:
6970 {-filter{all-popups} -filter{unsolicited-popups}}
6972 .overclockers.co.uk</PRE
6978 > Aliases like <SPAN
6984 > are typically used for
6988 > sites that require more than one action to be disabled
6989 in order to function properly.</P
6997 >8.7. Actions Files Tutorial</A
7000 > The above chapters have shown <A
7001 HREF="actions-file.html"
7002 >which actions files
7003 there are and how they are organized</A
7004 >, how actions are <A
7005 HREF="actions-file.html#ACTIONS"
7008 HREF="actions-file.html#ACTIONS-APPLY"
7012 HREF="actions-file.html#AF-PATTERNS"
7016 HREF="actions-file.html#ALIASES"
7018 >. Now, let's look at an
7021 >match-all.action</TT
7029 > file and see how all these pieces come together:</P
7036 >8.7.1. match-all.action</A
7043 >all actions are disabled when matching starts</I
7046 so we have to explicitly enable the ones we want.</P
7050 >match-all.action</TT
7051 > file only contains a
7052 single section, it is probably the most important one. It has only one
7061 HREF="actions-file.html#AF-PATTERNS"
7062 >matches all URLs</A
7063 >. Therefore, the set of
7064 actions used in this <SPAN
7072 be applied to all requests as a start</I
7074 >. It can be partly or
7075 wholly overridden by other actions files like <TT
7082 >, but it will still be largely responsible
7083 for your overall browsing experience.</P
7085 > Again, at the start of matching, all actions are disabled, so there is
7086 no need to disable any actions here. (Remember: a <SPAN
7090 preceding the action name enables the action, a <SPAN
7094 Also note how this long line has been made more readable by splitting it into
7095 multiple lines with line continuation.</P
7107 HREF="actions-file.html#CHANGE-X-FORWARDED-FOR"
7108 >change-x-forwarded-for{block}</A
7111 HREF="actions-file.html#HIDE-FROM-HEADER"
7112 >hide-from-header{block}</A
7115 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7116 >set-image-blocker{pattern}</A
7126 > The default behavior is now set.</P
7134 >8.7.2. default.action</A
7137 > If you aren't a developer, there's no need for you to edit the
7141 > file. It is maintained by
7145 > developers and if you disagree with some of the
7146 sections, you should overrule them in your <TT
7151 > Understanding the <TT
7155 help you with your <TT
7160 > The first section in this file is a special section for internal use
7161 that prevents older <SPAN
7164 > versions from reading the file:</P
7174 >##########################################################################
7175 # Settings -- Don't change! For internal Privoxy use ONLY.
7176 ##########################################################################
7178 for-privoxy-version=3.0.11</PRE
7184 > After that comes the (optional) alias section. We'll use the example
7185 section from the above <A
7186 HREF="actions-file.html#ALIASES"
7187 >chapter on aliases</A
7189 that also explains why and how aliases are used:</P
7199 >##########################################################################
7201 ##########################################################################
7204 # These aliases just save typing later:
7205 # (Note that some already use other aliases!)
7207 +crunch-all-cookies = +<A
7208 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7209 >crunch-incoming-cookies</A
7211 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7212 >crunch-outgoing-cookies</A
7214 -crunch-all-cookies = -<A
7215 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7216 >crunch-incoming-cookies</A
7218 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7219 >crunch-outgoing-cookies</A
7221 +block-as-image = +block{Blocked image.} +handle-as-image
7222 mercy-for-cookies = -crunch-all-cookies -<A
7223 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7224 >session-cookies-only</A
7226 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
7227 >filter{content-cookies}</A
7230 # These aliases define combinations of actions
7231 # that are useful for certain types of sites:
7234 HREF="actions-file.html#BLOCK"
7237 HREF="actions-file.html#FILTER"
7239 > -crunch-all-cookies -<A
7240 HREF="actions-file.html#FAST-REDIRECTS"
7243 HREF="actions-file.html#HIDE-REFERER"
7246 shop = -crunch-all-cookies -<A
7247 HREF="actions-file.html#FILTER-ALL-POPUPS"
7248 >filter{all-popups}</A
7255 > The first of our specialized sections is concerned with <SPAN
7259 sites, i.e. sites that require minimum interference, because they are either
7260 very complex or very keen on tracking you (and have mechanisms in place that
7261 make them unusable for people who avoid being tracked). We will simply use
7265 > alias instead of stating the list
7266 of actions explicitly:</P
7276 >##########################################################################
7277 # Exceptions for sites that'll break under the default action set:
7278 ##########################################################################
7280 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7283 .office.microsoft.com # surprise, surprise!
7284 .windowsupdate.microsoft.com
7285 mail.google.com</PRE
7291 > Shopping sites are not as fragile, but they typically
7292 require cookies to log in, and pop-up windows for shopping
7293 carts or item details. Again, we'll use a pre-defined alias:</P
7307 .worldpay.com # for quietpc.com
7318 HREF="actions-file.html#FAST-REDIRECTS"
7322 action, which may have been enabled in <TT
7324 >match-all.action</TT
7326 breaks some sites. So disable it for popular sites where we know it misbehaves:</P
7337 HREF="actions-file.html#FAST-REDIRECTS"
7343 .altavista.com/.*(like|url|link):http
7344 .altavista.com/trans.*urltext=http
7351 > It is important that <SPAN
7355 URLs belong to images, so that <SPAN
7362 be blocked, a substitute image can be sent, rather than an HTML page.
7363 Contacting the remote site to find out is not an option, since it
7364 would destroy the loading time advantage of banner blocking, and it
7365 would feed the advertisers information about you. We can mark any
7366 URL as an image with the <TT
7369 HREF="actions-file.html#HANDLE-AS-IMAGE"
7373 and marking all URLs that end in a known image file extension is a
7384 >##########################################################################
7386 ##########################################################################
7388 # Define which file types will be treated as images, in case they get
7389 # blocked further down this file:
7392 HREF="actions-file.html#HANDLE-AS-IMAGE"
7395 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7401 > And then there are known banner sources. They often use scripts to
7402 generate the banners, so it won't be visible from the URL that the
7403 request is for an image. Hence we block them <SPAN
7410 mark them as images in one go, with the help of our
7413 >+block-as-image</TT
7414 > alias defined above. (We could of
7415 course just as well use <TT
7418 HREF="actions-file.html#BLOCK"
7422 HREF="actions-file.html#HANDLE-AS-IMAGE"
7426 Remember that the type of the replacement image is chosen by the
7430 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7431 >set-image-blocker</A
7434 action. Since all URLs have matched the default section with its
7438 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7439 >set-image-blocker</A
7442 action before, it still applies and needn't be repeated:</P
7452 ># Known ad generators:
7457 .ad.*.doubleclick.net
7458 .a.yimg.com/(?:(?!/i/).)*$
7459 .a[0-9].yimg.com/(?:(?!/i/).)*$
7467 > One of the most important jobs of <SPAN
7471 is to block banners. Many of these can be <SPAN
7478 HREF="actions-file.html#FILTER"
7480 >{banners-by-size}</TT
7482 action, which we enabled above, and which deletes the references to banner
7483 images from the pages while they are loaded, so the browser doesn't request
7484 them anymore, and hence they don't need to be blocked here. But this naturally
7485 doesn't catch all banners, and some people choose not to use filters, so we
7486 need a comprehensive list of patterns for banner URLs here, and apply the
7490 HREF="actions-file.html#BLOCK"
7493 > action to them.</P
7495 > First comes many generic patterns, which do most of the work, by
7496 matching typical domain and path name components of banners. Then comes
7497 a list of individual patterns for specific sites, which is omitted here
7498 to keep the example short:</P
7508 >##########################################################################
7509 # Block these fine banners:
7510 ##########################################################################
7512 HREF="actions-file.html#BLOCK"
7513 >+block{Banner ads.}</A
7522 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7523 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7525 # Site-specific patterns (abbreviated):
7533 > It's quite remarkable how many advertisers actually call their banner
7539 >.com, or call the directory
7540 in which the banners are stored simply <SPAN
7544 generic patterns are surprisingly effective.</P
7546 > But being very generic, they necessarily also catch URLs that we don't want
7547 to block. The pattern <TT
7559 >.nasty-corp.com"</SPAN
7569 >.sourcefroge.net"</SPAN
7579 >l.some-provider.net."</SPAN
7581 well-known exceptions to the <TT
7584 HREF="actions-file.html#BLOCK"
7590 > Note that these are exceptions to exceptions from the default! Consider the URL
7593 >"downloads.sourcefroge.net"</SPAN
7594 >: Initially, all actions are deactivated,
7595 so it wouldn't get blocked. Then comes the defaults section, which matches the
7596 URL, but just deactivates the <TT
7599 HREF="actions-file.html#BLOCK"
7603 action once again. Then it matches <TT
7606 >, an exception to the
7607 general non-blocking policy, and suddenly
7611 HREF="actions-file.html#BLOCK"
7614 > applies. And now, it'll match
7621 HREF="actions-file.html#BLOCK"
7625 applies, so (unless it matches <SPAN
7631 > further down) it ends up
7635 HREF="actions-file.html#BLOCK"
7638 > action applying.</P
7648 >##########################################################################
7649 # Save some innocent victims of the above generic block patterns:
7650 ##########################################################################
7655 HREF="actions-file.html#BLOCK"
7658 adv[io]*. # (for advogato.org and advice.*)
7659 adsl. # (has nothing to do with ads)
7660 adobe. # (has nothing to do with ads either)
7661 ad[ud]*. # (adult.* and add.*)
7662 .edu # (universities don't host banners (yet!))
7663 .*loads. # (downloads, uploads etc)
7671 www.globalintersec.com/adv # (adv = advanced)
7672 www.ugu.com/sui/ugu/adv</PRE
7678 > Filtering source code can have nasty side effects,
7679 so make an exception for our friends at sourceforge.net,
7680 and all paths with <SPAN
7683 > in them. Note that
7687 HREF="actions-file.html#FILTER"
7697 > filters in one fell swoop!</P
7707 ># Don't filter code!
7710 HREF="actions-file.html#FILTER"
7717 .sourceforge.net</PRE
7726 > is of course much more
7727 comprehensive, but we hope this example made clear how it works.</P
7735 >8.7.3. user.action</A
7738 > So far we are painting with a broad brush by setting general policies,
7739 which would be a reasonable starting point for many people. Now,
7740 you might want to be more specific and have customized rules that
7741 are more suitable to your personal habits and preferences. These would
7742 be for narrowly defined situations like your ISP or your bank, and should
7746 >, which is parsed after all other
7747 actions files and hence has the last word, over-riding any previously
7748 defined actions. <TT
7758 > place for your personal settings, since
7762 > is actively maintained by the
7766 > developers and you'll probably want
7767 to install updated versions from time to time.</P
7769 > So let's look at a few examples of things that one might typically do in
7783 ># My user.action file. <fred@example.com></PRE
7790 HREF="actions-file.html#ALIASES"
7792 > are local to the actions
7793 file that they are defined in, you can't use the ones from
7797 >, unless you repeat them here:</P
7807 ># Aliases are local to the file they are defined in.
7808 # (Re-)define aliases for this file:
7812 # These aliases just save typing later, and the alias names should
7813 # be self explanatory.
7815 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7816 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7817 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7818 allow-popups = -filter{all-popups}
7819 +block-as-image = +block{Blocked as image.} +handle-as-image
7820 -block-as-image = -block
7822 # These aliases define combinations of actions that are useful for
7823 # certain types of sites:
7825 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer
7826 shop = -crunch-all-cookies allow-popups
7828 # Allow ads for selected useful free sites:
7830 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
7832 # Alias for specific file types that are text, but might have conflicting
7833 # MIME types. We want the browser to force these to be text documents.
7834 handle-as-text = -<A
7835 HREF="actions-file.html#FILTER"
7838 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
7839 >content-type-overwrite{text/plain}</A
7841 HREF="actions-file.html#FORCE-TEXT-MODE"
7844 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7845 >hide-content-disposition</A
7852 > Say you have accounts on some sites that you visit regularly, and
7853 you don't want to have to log in manually each time. So you'd like
7854 to allow persistent cookies for these sites. The
7857 >allow-all-cookies</TT
7858 > alias defined above does exactly
7859 that, i.e. it disables crunching of cookies in any direction, and the
7860 processing of cookies to make them only temporary.</P
7870 >{ allow-all-cookies }
7880 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7891 HREF="actions-file.html#FILTER"
7894 .your-home-banking-site.com</PRE
7900 > Some file types you may not want to filter for various reasons:</P
7910 ># Technical documentation is likely to contain strings that might
7911 # erroneously get altered by the JavaScript-oriented filters:
7916 # And this stupid host sends streaming video with a wrong MIME type,
7917 # so that Privoxy thinks it is getting HTML and starts filtering:
7919 stupid-server.example.com/</PRE
7925 > Example of a simple <A
7926 HREF="actions-file.html#BLOCK"
7928 > action. Say you've
7929 seen an ad on your favourite page on example.com that you want to get rid of.
7930 You have right-clicked the image, selected <SPAN
7932 >"copy image location"</SPAN
7934 and pasted the URL below while removing the leading http://, into a
7938 > section. Note that <TT
7942 > need not be specified, since all URLs ending in
7946 > will be tagged as images by the general rules as set
7947 in default.action anyway:</P
7958 HREF="actions-file.html#BLOCK"
7961 www.example.com/nasty-ads/sponsor\.gif
7962 another.example.net/more/junk/here/</PRE
7968 > The URLs of dynamically generated banners, especially from large banner
7969 farms, often don't use the well-known image file name extensions, which
7970 makes it impossible for <SPAN
7974 the file type just by looking at the URL.
7977 >+block-as-image</TT
7978 > alias defined above for
7980 Note that objects which match this rule but then turn out NOT to be an
7981 image are typically rendered as a <SPAN
7983 >"broken image"</SPAN
7985 browser. Use cautiously.</P
7995 >{ +block-as-image }
8005 > Now you noticed that the default configuration breaks Forbes Magazine,
8006 but you were too lazy to find out which action is the culprit, and you
8007 were again too lazy to give <A
8011 you just used the <TT
8014 > alias on the site, and
8021 > -- it worked. The <TT
8025 aliases disables those actions that are most likely to break a site. Also,
8026 good for testing purposes to see if it is <SPAN
8030 that is causing the problem or not. We later find other regular sites
8031 that misbehave, and add those to our personalized list of troublemakers:</P
8050 > You like the <SPAN
8053 > text replacements in <TT
8057 but it is disabled in the distributed actions file.
8058 So you'd like to turn it on in your private,
8059 update-safe config, once and for all:</P
8070 HREF="actions-file.html#FILTER-FUN"
8073 / # For ALL sites!</PRE
8079 > Note that the above is not really a good idea: There are exceptions
8080 to the filters in <TT
8084 really shouldn't be filtered, like code on CVS->Web interfaces. Since
8088 > has the last word, these exceptions
8089 won't be valid for the <SPAN
8092 > filtering specified here.</P
8094 > You might also worry about how your favourite free websites are
8095 funded, and find that they rely on displaying banner advertisements
8096 to survive. So you might want to specifically allow banners for those
8097 sites that you feel provide value to you:</P
8119 > has been aliased to
8123 HREF="actions-file.html#BLOCK"
8130 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
8131 >filter{banners-by-size}</A
8137 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
8138 >filter{banners-by-link}</A
8142 > Invoke another alias here to force an over-ride of the MIME type <TT
8144 > application/x-sh</TT
8145 > which typically would open a download type
8146 dialog. In my case, I want to look at the shell script, and then I can save
8147 it should I choose to.</P
8167 > is generally the best place to define
8168 exceptions and additions to the default policies of
8172 >. Some actions are safe to have their
8173 default policies set here though. So let's set a default policy to have a
8177 > image as opposed to the checkerboard pattern for
8187 > of course matches all URL
8188 paths and patterns:</P
8199 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8200 >set-image-blocker{blank}</A
8215 SUMMARY="Footer navigation table"
8244 HREF="filter-file.html"
8254 >The Main Configuration File</TD