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.9 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.9 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
120 > - is the primary action file
121 that sets the initial values for all actions. It is intended to
122 provide a base level of functionality for
126 > array of features. So it is
127 a set of broad rules that should work reasonably well as-is for most users.
128 This is the file that the developers are keeping updated, and <A
129 HREF="installation.html#INSTALLATION-KEEPUPDATED"
130 >making available to users</A
132 The user's preferences as set in <TT
155 > - is intended to be for local site
156 preferences and exceptions. As an example, if your ISP or your bank
157 has specific requirements, and need special handling, this kind of
158 thing should go here. This file will not be upgraded.
166 > - is used only by the web based editor
168 HREF="http://config.privoxy.org/edit-actions-list?f=default"
170 > http://config.privoxy.org/edit-actions-list?f=default</A
172 to set various pre-defined sets of rules for the default actions section
184 >Set to Cautious</SPAN
190 >Set to Advanced</SPAN
194 > These have increasing levels of aggressiveness <SPAN
199 influence on your browsing unless you select them explicitly in the
202 >. A default installation should be pre-set to
206 > (versions prior to 3.0.5 were set to
210 >). New users should try this for a while before
211 adjusting the settings to more aggressive levels. The more aggressive
212 the settings, then the more likelihood there is of problems such as sites
213 not working as they should.
219 > button allows you to turn each
220 action on/off individually for fine-tuning. The <SPAN
224 button changes the actions list to low/safe settings which will activate
225 ad blocking and a minimal set of <SPAN
228 >'s features, and subsequently
229 there will be less of a chance for accidental problems. The
233 > button sets the list to a medium level of
234 other features and a low level set of privacy features. The
238 > button sets the list to a high level of
239 ad blocking and medium level of privacy. See the chart below. The latter
240 three buttons over-ride any changes via with the
244 > button. More fine-tuning can be done in the
245 lower sections of this internal page.
248 > It is not recommend to edit the <TT
255 > The default profiles, and their associated actions, as pre-defined in
269 >Table 1. Default Configurations</B
299 >Ad-blocking Aggressiveness</TD
309 >Ad-filtering by size</TD
319 >Ad-filtering by link</TD
339 >Privacy Features</TD
369 >GIF de-animation</TD
399 >JavaScript taming</TD
419 >Image tag reordering</TD
437 > The list of actions files to be used are defined in the main configuration
438 file, and are processed in the order they are defined (e.g.
442 > is typically processed before
446 >). The content of these can all be viewed and
448 HREF="http://config.privoxy.org/show-status"
450 >http://config.privoxy.org/show-status</A
452 The over-riding principle when applying actions, is that the last action that
453 matches a given URL wins. The broadest, most general rules go first
458 followed by any exceptions (typically also in
462 >), which are then followed lastly by any
463 local preferences (typically in <SPAN
479 > An actions file typically has multiple sections. If you want to use
483 > in an actions file, you have to place the (optional)
485 HREF="actions-file.html#ALIASES"
487 > at the top of that file.
488 Then comes the default set of rules which will apply universally to all
489 sites and pages (be <SPAN
499 > or any other actions file after
503 >, because it will override the result
504 from consulting any previous file). And then below that,
505 exceptions to the defined universal policies. You can regard
509 > as an appendix to <TT
513 with the advantage that it is a separate file, which makes preserving your
514 personal settings across <SPAN
517 > upgrades easier.</P
520 Actions can be used to block anything you want, including ads, banners, or
521 just some obnoxious URL whose content you would rather not see. Cookies can be accepted
522 or rejected, or accepted only during the current browser session (i.e. not
523 written to disk), content can be modified, some JavaScripts tamed, user-tracking
524 fooled, and much more. See below for a <A
525 HREF="actions-file.html#ACTIONS"
535 >8.1. Finding the Right Mix</A
539 HREF="actions-file.html#ACTIONS"
541 >, like cookie suppression
542 or script disabling, may render some sites unusable that rely on these
543 techniques to work properly. Finding the right mix of actions is not always easy and
544 certainly a matter of personal taste. And, things can always change, requiring
545 refinements in the configuration. In general, it can be said that the more
549 > your default settings (in the top section of the
550 actions file) are, the more exceptions for <SPAN
554 will have to make later. If, for example, you want to crunch all cookies per
555 default, you'll have to make exceptions from that rule for sites that you
556 regularly use and that require cookies for actually useful purposes, like maybe
557 your bank, favorite shop, or newspaper.</P
559 > We have tried to provide you with reasonable rules to start from in the
560 distribution actions files. But there is no general rule of thumb on these
561 things. There just are too many variables, and sites are constantly changing.
562 Sooner or later you will want to change the rules (and read this chapter again :).</P
573 > The easiest way to edit the actions files is with a browser by
574 using our browser-based editor, which can be reached from <A
575 HREF="http://config.privoxy.org/show-status"
577 >http://config.privoxy.org/show-status</A
579 Note: the config file option <A
580 HREF="config.html#ENABLE-EDIT-ACTIONS"
581 >enable-edit-actions</A
582 > must be enabled for
583 this to work. The editor allows both fine-grained control over every single
584 feature on a per-URL basis, and easy choosing from wholesale sets of defaults
595 >. Warning: the <SPAN
599 aggressive, and will be more likely to cause problems for some sites.
600 Experienced users only!
603 > If you prefer plain text editing to GUIs, you can of course also directly edit the
604 the actions files with your favorite text editor. Look at
608 > which is richly commented with many
617 >8.3. How Actions are Applied to Requests</A
620 > Actions files are divided into sections. There are special sections,
624 HREF="actions-file.html#ALIASES"
627 > sections which will
628 be discussed later. For now let's concentrate on regular sections: They have a
629 heading line (often split up to multiple lines for readability) which consist
630 of a list of actions, separated by whitespace and enclosed in curly braces.
631 Below that, there is a list of URL and tag patterns, each on a separate line.</P
633 > To determine which actions apply to a request, the URL of the request is
634 compared to all URL patterns in each <SPAN
638 Every time it matches, the list of applicable actions for the request is
639 incrementally updated, using the heading of the section in which the
640 pattern is located. The same is done again for tags and tag patterns later on.</P
642 > If multiple applying sections set the same action differently,
643 the last match wins. If not, the effects are aggregated.
644 E.g. a URL might match a regular section with a heading line of <TT
648 HREF="actions-file.html#HANDLE-AS-IMAGE"
652 then later another one with just <TT
656 HREF="actions-file.html#BLOCK"
666 > actions to apply. And there may well be
667 cases where you will want to combine actions together. Such a section then
683 >block{Banner ads.}</TT
685 # Block these as if they were images. Send no block page.
687 media.example.com/.*banners
688 .example.com/images/ads/</PRE
695 > You can trace this process for URL patterns and any given URL by visiting <A
696 HREF="http://config.privoxy.org/show-url-info"
698 >http://config.privoxy.org/show-url-info</A
701 > Examples and more detail on this is provided in the Appendix, <A
702 HREF="appendix.html#ACTIONSANAT"
703 > Troubleshooting: Anatomy of an Action</A
723 to determine what <SPAN
729 > might apply to which sites and
730 pages your browser attempts to access. These <SPAN
740 > matching to achieve a high degree of
741 flexibility. This allows one expression to be expanded and potentially match
742 against many similar patterns.</P
744 > Generally, an URL pattern has the form
747 ><domain>/<path></TT
751 ><domain></TT
756 optional. (This is why the special <TT
759 > pattern matches all
760 URLs). Note that the protocol portion of the URL pattern (e.g.
771 the pattern. This is assumed already!</P
773 > The pattern matching syntax is different for the domain and path parts of
774 the URL. The domain part uses a simple globbing type matching technique,
775 while the path part uses more flexible
777 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
793 >www.example.com/</TT
797 > is a domain-only pattern and will match any request to <TT
801 regardless of which document on that server is requested. So ALL pages in
802 this domain would be covered by the scope of this action. Note that a
806 > is different and would NOT match.
816 > means exactly the same. For domain-only patterns, the trailing <TT
826 >www.example.com/index.html$</TT
830 > matches all the documents on <TT
834 whose name starts with <TT
843 >www.example.com/index.html$</TT
847 > matches only the single document <TT
864 > matches the document <TT
867 >, regardless of the domain,
874 > web server anywhere.
884 > matches nothing, since it would be interpreted as a domain name and
885 there is no top-level domain called <TT
900 >8.4.1. The Domain Pattern</A
903 > The matching of the domain part offers some flexible options: if the
904 domain starts or ends with a dot, it becomes unanchored at that end.
918 > matches any domain with first-level domain <TT
922 and second-level domain <TT
935 >foo.bar.baz.example.com</TT
937 Note that it wouldn't match if the second-level domain was <TT
950 > matches any domain that <SPAN
960 > (It also matches the domain
964 > but most of the time that doesn't matter.)
974 > matches any domain that <SPAN
984 And, by the way, also included would be any files or documents that exist
985 within that domain since no path limitations are specified. (Correctly
986 speaking: It matches any FQDN that contains <TT
990 a domain.) This might be <TT
1000 >www.example.net/cgi/testing.pl</TT
1001 > for instance. All these
1008 > Additionally, there are wild-cards that you can use in the domain names
1009 themselves. These work similarly to shell globbing type wild-cards:
1013 > represents zero or more arbitrary characters (this is
1016 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
1023 > based syntax of <SPAN
1030 > represents any single character (this is equivalent to the
1031 regular expression syntax of a simple <SPAN
1034 >), and you can define
1037 >"character classes"</SPAN
1038 > in square brackets which is similar to
1039 the same regular expression technique. All of this can be freely mixed:</P
1043 CLASS="VARIABLELIST"
1048 >ad*.example.com</TT
1054 >"adserver.example.com"</SPAN
1058 >"ads.example.com"</SPAN
1059 >, etc but not <SPAN
1061 >"sfads.example.com"</SPAN
1068 >*ad*.example.com</TT
1072 > matches all of the above, and then some.
1088 >pictures.epix.com</TT
1091 >a.b.c.d.e.upix.com</TT
1098 >www[1-9a-ez].example.c*</TT
1104 >www1.example.com</TT
1108 >www4.example.cc</TT
1111 >wwwd.example.cy</TT
1115 >wwwz.example.com</TT
1125 >wwww.example.com</TT
1132 > While flexible, this is not the sophistication of full regular expression based syntax.</P
1140 >8.4.2. The Path Pattern</A
1151 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
1158 > for matching the path portion (after the slash),
1159 and is thus more flexible.</P
1162 HREF="appendix.html#REGEX"
1164 > with a brief quick-start into regular
1165 expressions, you also might want to have a look at your operating system's documentation
1166 on regular expressions (try <TT
1171 > Note that the path pattern is automatically left-anchored at the <SPAN
1175 i.e. it matches as if it would start with a <SPAN
1178 > (regular expression speak
1179 for the beginning of a line).</P
1181 > Please also note that matching in the path is <SPAN
1185 >CASE INSENSITIVE</I
1188 by default, but you can switch to case sensitive at any point in the pattern by using the
1194 >www.example.com/(?-i)PaTtErN.*</TT
1196 only documents whose path starts with <TT
1206 > this capitalization.</P
1210 CLASS="VARIABLELIST"
1215 >.example.com/.*</TT
1219 > Is equivalent to just <SPAN
1221 >".example.com"</SPAN
1222 >, since any documents
1223 within that domain are matched with or without the <SPAN
1227 regular expression. This is redundant
1233 >.example.com/.*/index.html$</TT
1237 > Will match any page in the domain of <SPAN
1239 >"example.com"</SPAN
1244 >, and that is part of some path. For
1245 example, it matches <SPAN
1247 >"www.example.com/testing/index.html"</SPAN
1251 >"www.example.com/index.html"</SPAN
1252 > because the regular
1253 expression called for at least two <SPAN
1257 requirement. It also would match
1260 >"www.example.com/testing/index_html"</SPAN
1262 special meta-character <SPAN
1271 >.example.com/(.*/)?index\.html$</TT
1275 > This regular expression is conditional so it will match any page
1279 > regardless of path which in this case can
1280 have one or more <SPAN
1283 >. And this one must contain exactly
1287 > (but does not have to end with that!).
1293 >.example.com/(.*/)(ads|banners?|junk)</TT
1297 > This regular expression will match any path of <SPAN
1299 >"example.com"</SPAN
1301 that contains any of the words <SPAN
1311 > (because of the <SPAN
1318 The path does not have to end in these words, just contain them.
1324 >.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</TT
1328 > This is very much the same as above, except now it must end in either
1342 one is limited to common image formats.
1348 > There are many, many good examples to be found in <TT
1352 and more tutorials below in <A
1353 HREF="appendix.html#REGEX"
1354 >Appendix on regular expressions</A
1363 >8.4.3. The Tag Pattern</A
1366 > Tag patterns are used to change the applying actions based on the
1367 request's tags. Tags can be created with either the
1369 HREF="actions-file.html#CLIENT-HEADER-TAGGER"
1370 >client-header-tagger</A
1373 HREF="actions-file.html#SERVER-HEADER-TAGGER"
1374 >server-header-tagger</A
1377 > Tag patterns have to start with <SPAN
1384 can tell them apart from URL patterns. Everything after the colon
1385 including white space, is interpreted as a regular expression with
1386 path pattern syntax, except that tag patterns aren't left-anchored
1387 automatically (<SPAN
1390 > doesn't silently add a <SPAN
1394 you have to do it yourself if you need it).</P
1396 > To match all requests that are tagged with <SPAN
1400 your pattern line should be <SPAN
1407 > would work as well, but it would also
1408 match requests whose tags contain <SPAN
1415 > wouldn't work as it requires white space.</P
1417 > Sections can contain URL and tag patterns at the same time,
1418 but tag patterns are checked after the URL patterns and thus
1419 always overrule them, even if they are located before the URL patterns.</P
1421 > Once a new tag is added, Privoxy checks right away if it's matched by one
1422 of the tag patterns and updates the action settings accordingly. As a result
1423 tags can be used to activate other tagger actions, as long as these other
1424 taggers look for headers that haven't already be parsed.</P
1426 > For example you could tag client requests which use the
1431 then use this tag to activate another tagger that adds a tag if cookies
1432 are sent, and then use a block action based on the cookie tag. This allows
1433 the outcome of one action, to be input into a subsequent action. However if
1434 you'd reverse the position of the described taggers, and activated the
1435 method tagger based on the cookie tagger, no method tags would be created.
1436 The method tagger would look for the request line, but at the time
1437 the cookie tag is created, the request line has already been parsed.</P
1439 > While this is a limitation you should be aware of, this kind of
1440 indirection is seldom needed anyway and even the example doesn't
1441 make too much sense.</P
1453 > All actions are disabled by default, until they are explicitly enabled
1454 somewhere in an actions file. Actions are turned on if preceded with a
1458 >, and turned off if preceded with a <SPAN
1467 >"do that action"</SPAN
1474 >"please block URLs that match the
1475 following patterns"</SPAN
1482 block URLs that match the following patterns, even if <TT
1486 previously applied."</SPAN
1490 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1491 separated by whitespace, like in
1494 >{+some-action -some-other-action{some-parameter}}</TT
1496 followed by a list of URL patterns, one per line, to which they apply.
1497 Together, the actions line and the following pattern lines make up a section
1498 of the actions file. </P
1501 Actions fall into three categories:</P
1509 Boolean, i.e the action can only be <SPAN
1532 > # enable action <TT
1543 > # disable action <TT
1558 >+handle-as-image</TT
1565 Parameterized, where some value is required in order to enable this type of action.
1587 >} # enable action and set parameter to <TT
1593 # overwriting parameter from previous match if necessary
1599 > # disable action. The parameter can be omitted</PRE
1606 > Note that if the URL matches multiple positive forms of a parameterized action,
1607 the last match wins, i.e. the params from earlier matches are simply ignored.
1613 >+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4}</TT
1620 Multi-value. These look exactly like parameterized actions,
1621 but they behave differently: If the action applies multiple times to the
1622 same URL, but with different parameters, <SPAN
1635 > matches are remembered. This is used for actions
1636 that can be executed for the same request repeatedly, like adding multiple
1637 headers, or filtering through multiple filters. Syntax:
1658 >} # enable action and add <TT
1663 > to the list of parameters
1674 >} # remove the parameter <TT
1679 > from the list of parameters
1680 # If it was the last one left, disable the action.
1686 > # disable this action completely and remove all parameters from the list</PRE
1696 >+add-header{X-Fun-Header: Some text}</TT
1700 >+filter{html-annoyances}</TT
1707 > If nothing is specified in any actions file, no <SPAN
1711 taken. So in this case <SPAN
1715 normal, non-blocking, non-filtering proxy. You must specifically enable the
1716 privacy and blocking features you need (although the provided default actions
1717 files will give a good starting point).</P
1719 > Later defined action sections always over-ride earlier ones of the same type.
1720 So exceptions to any rules you make, should come in the latter part of the file (or
1721 in a file that is processed later when using multiple actions files such
1725 >). For multi-valued actions, the actions
1726 are applied in the order they are specified. Actions files are processed in
1727 the order they are defined in <TT
1731 installation has three actions files). It also quite possible for any given
1732 URL to match more than one <SPAN
1735 > (because of wildcards and
1736 regular expressions), and thus to trigger more than one set of actions! Last
1739 > The list of valid <SPAN
1749 >8.5.1. add-header</A
1754 CLASS="VARIABLELIST"
1760 >Confuse log analysis, custom applications</P
1766 > Sends a user defined HTTP header to the web server.
1779 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1780 It is recommended that you use the <SPAN
1794 > This action may be specified multiple times, in order to define multiple
1795 headers. This is rarely needed for the typical user. If you don't know what
1798 >"HTTP headers"</SPAN
1799 > are, you definitely don't need to worry about this
1815 >+add-header{X-User-Tracking: sucks}</PRE
1836 CLASS="VARIABLELIST"
1842 >Block ads or other unwanted content</P
1848 > Requests for URLs to which this action applies are blocked, i.e. the
1849 requests are trapped by <SPAN
1852 > and the requested URL is never retrieved,
1853 but is answered locally with a substitute page or image, as determined by
1857 HREF="actions-file.html#HANDLE-AS-IMAGE"
1864 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1865 >set-image-blocker</A
1871 HREF="actions-file.html#HANDLE-AS-EMPTY-DOCUMENT"
1872 >handle-as-empty-document</A
1888 >A block reason that should be given to the user.</P
1897 > sends a special <SPAN
1901 for requests to blocked pages. This page contains the block reason given as
1902 parameter, a link to find out why the block action applies, and a click-through
1903 to the blocked content (the latter only if the force feature is available and
1908 A very important exception occurs if <SPAN
1921 HREF="actions-file.html#HANDLE-AS-IMAGE"
1925 apply to the same request: it will then be replaced by an image. If
1929 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1930 >set-image-blocker</A
1933 (see below) also applies, the type of image will be determined by its parameter,
1934 if not, the standard checkerboard pattern is sent.
1937 > It is important to understand this process, in order
1938 to understand how <SPAN
1942 ads and other unwanted content. Blocking is a core feature, and one
1943 upon which various other features depend.
1949 HREF="actions-file.html#FILTER"
1953 action can perform a very similar task, by <SPAN
1957 banner images and other content through rewriting the relevant URLs in the
1958 document's HTML source, so they don't get requested in the first place.
1959 Note that this is a totally different technique, and it's easy to confuse the two.
1963 >Example usage (section):</DT
1974 >{+block{No nasty stuff for you.}}
1975 # Block and replace with "blocked" page
1976 .nasty-stuff.example.com
1978 {+block{Doubleclick banners.} +handle-as-image}
1979 # Block and replace with image
1983 {+block{Layered ads.} +handle-as-empty-document}
1984 # Block and then ignore
1985 adserver.example.net/.*\.js$</PRE
2000 NAME="CLIENT-HEADER-FILTER"
2001 >8.5.3. client-header-filter</A
2006 CLASS="VARIABLELIST"
2012 > Rewrite or remove single client headers.
2019 > All client headers to which this action applies are filtered on-the-fly through
2020 the specified regular expression based substitutions.
2033 > The name of a client-header filter, as defined in one of the
2035 HREF="filter-file.html"
2044 > Client-header filters are applied to each header on its own, not to
2045 all at once. This makes it easier to diagnose problems, but on the downside
2046 you can't write filters that only change header x if header y's value is z.
2047 You can do that by using tags though.
2050 > Client-header filters are executed after the other header actions have finished
2051 and use their output as input.
2054 > If the request URL gets changed, <SPAN
2057 > will detect that and use the new
2058 one. This can be used to rewrite the request destination behind the client's
2059 back, for example to specify a Tor exit relay for certain requests.
2062 > Please refer to the <A
2063 HREF="filter-file.html"
2064 >filter file chapter</A
2066 to learn which client-header filters are available by default, and how to
2071 >Example usage (section):</DT
2082 ># Hide Tor exit notation in Host and Referer Headers
2083 {+client-header-filter{hide-tor-exit-notation}}
2100 NAME="CLIENT-HEADER-TAGGER"
2101 >8.5.4. client-header-tagger</A
2106 CLASS="VARIABLELIST"
2112 > Block requests based on their headers.
2119 > Client headers to which this action applies are filtered on-the-fly through
2120 the specified regular expression based substitutions, the result is used as
2134 > The name of a client-header tagger, as defined in one of the
2136 HREF="filter-file.html"
2145 > Client-header taggers are applied to each header on its own,
2146 and as the header isn't modified, each tagger <SPAN
2153 > Client-header taggers are the first actions that are executed
2154 and their tags can be used to control every other action.
2158 >Example usage (section):</DT
2169 ># Tag every request with the User-Agent header
2170 {+client-header-tagger{user-agent}}
2173 # Tagging itself doesn't change the action
2174 # settings, sections with TAG patterns do:
2176 # If it's a download agent, use a different forwarding proxy,
2177 # show the real User-Agent and make sure resume works.
2178 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
2179 -hide-if-modified-since \
2180 -overwrite-last-modified \
2185 TAG:^User-Agent: NetBSD-ftp/
2186 TAG:^User-Agent: Novell ZYPP Installer
2187 TAG:^User-Agent: RPM APT-HTTP/
2188 TAG:^User-Agent: fetch libfetch/
2189 TAG:^User-Agent: Ubuntu APT-HTTP/
2190 TAG:^User-Agent: MPlayer/
2206 NAME="CONTENT-TYPE-OVERWRITE"
2207 >8.5.5. content-type-overwrite</A
2212 CLASS="VARIABLELIST"
2218 >Stop useless download menus from popping up, or change the browser's rendering mode</P
2224 > Replaces the <SPAN
2226 >"Content-Type:"</SPAN
2227 > HTTP server header.
2249 >"Content-Type:"</SPAN
2250 > HTTP server header is used by the
2251 browser to decide what to do with the document. The value of this
2252 header can cause the browser to open a download menu instead of
2253 displaying the document by itself, even if the document's format is
2254 supported by the browser.
2257 > The declared content type can also affect which rendering mode
2258 the browser chooses. If XHTML is delivered as <SPAN
2262 many browsers treat it as yet another broken HTML document.
2263 If it is send as <SPAN
2265 >"application/xml"</SPAN
2267 XHTML support will only display it, if the syntax is correct.
2270 > If you see a web site that proudly uses XHTML buttons, but sets
2273 >"Content-Type: text/html"</SPAN
2274 >, you can use <SPAN
2278 to overwrite it with <SPAN
2280 >"application/xml"</SPAN
2282 the web master's claim inside your XHTML-supporting browser.
2283 If the syntax is incorrect, the browser will complain loudly.
2286 > You can also go the opposite direction: if your browser prints
2287 error messages instead of rendering a document falsely declared
2288 as XHTML, you can overwrite the content type with
2292 > and have it rendered as broken HTML document.
2297 >content-type-overwrite</TT
2301 >"Content-Type:"</SPAN
2302 > headers that look like some kind of text.
2303 If you want to overwrite it unconditionally, you have to combine it with
2307 HREF="actions-file.html#FORCE-TEXT-MODE"
2311 This limitation exists for a reason, think twice before circumventing it.
2314 > Most of the time it's easier to replace this action with a custom
2318 HREF="actions-file.html#SERVER-HEADER-FILTER"
2319 >server-header filter</A
2322 It allows you to activate it for every document of a certain site and it will still
2323 only replace the content types you aimed at.
2326 > Of course you can apply <TT
2328 >content-type-overwrite</TT
2330 to a whole site and then make URL based exceptions, but it's a lot
2331 more work to get the same precision.
2335 >Example usage (sections):</DT
2346 ># Check if www.example.net/ really uses valid XHTML
2347 { +content-type-overwrite{application/xml} }
2350 # but leave the content type unmodified if the URL looks like a style sheet
2351 {-content-type-overwrite}
2352 www.example.net/.*\.css$
2353 www.example.net/.*style</PRE
2368 NAME="CRUNCH-CLIENT-HEADER"
2369 >8.5.6. crunch-client-header</A
2374 CLASS="VARIABLELIST"
2380 >Remove a client header <SPAN
2383 > has no dedicated action for.</P
2389 > Deletes every header sent by the client that contains the string the user supplied as parameter.
2409 > This action allows you to block client headers for which no dedicated
2417 > will remove every client header that
2418 contains the string you supplied as parameter.
2421 > Regular expressions are <SPAN
2428 use this action to block different headers in the same request, unless
2429 they contain the same string.
2434 >crunch-client-header</TT
2435 > is only meant for quick tests.
2436 If you have to block several different headers, or only want to modify
2437 parts of them, you should use a
2441 HREF="actions-file.html#CLIENT-HEADER-FILTER"
2442 >client-header filter</A
2465 > Don't block any header without understanding the consequences.
2473 >Example usage (section):</DT
2484 ># Block the non-existent "Privacy-Violation:" client header
2485 { +crunch-client-header{Privacy-Violation:} }
2502 NAME="CRUNCH-IF-NONE-MATCH"
2503 >8.5.7. crunch-if-none-match</A
2508 CLASS="VARIABLELIST"
2514 >Prevent yet another way to track the user's steps between sessions.</P
2522 >"If-None-Match:"</SPAN
2523 > HTTP client header.
2543 > Removing the <SPAN
2545 >"If-None-Match:"</SPAN
2546 > HTTP client header
2547 is useful for filter testing, where you want to force a real
2548 reload instead of getting status code <SPAN
2552 would cause the browser to use a cached copy of the page.
2555 > It is also useful to make sure the header isn't used as a cookie
2556 replacement (unlikely but possible).
2559 > Blocking the <SPAN
2561 >"If-None-Match:"</SPAN
2562 > header shouldn't cause any
2563 caching problems, as long as the <SPAN
2565 >"If-Modified-Since:"</SPAN
2567 isn't blocked or missing as well.
2570 > It is recommended to use this action together with
2574 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2575 >hide-if-modified-since</A
2582 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2583 >overwrite-last-modified</A
2589 >Example usage (section):</DT
2600 ># Let the browser revalidate cached documents but don't
2601 # allow the server to use the revalidation headers for user tracking.
2602 {+hide-if-modified-since{-60} \
2603 +overwrite-last-modified{randomize} \
2604 +crunch-if-none-match}
2620 NAME="CRUNCH-INCOMING-COOKIES"
2621 >8.5.8. crunch-incoming-cookies</A
2626 CLASS="VARIABLELIST"
2632 > Prevent the web server from setting HTTP cookies on your system
2641 >"Set-Cookie:"</SPAN
2642 > HTTP headers from server replies.
2662 > This action is only concerned with <SPAN
2679 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2680 >crunch-outgoing-cookies</A
2689 > to disable HTTP cookies completely.
2698 > to use this action in conjunction
2702 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2703 >session-cookies-only</A
2706 since it would prevent the session cookies from being set. See also
2710 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2711 >filter-content-cookies</A
2728 >+crunch-incoming-cookies</PRE
2743 NAME="CRUNCH-SERVER-HEADER"
2744 >8.5.9. crunch-server-header</A
2749 CLASS="VARIABLELIST"
2755 >Remove a server header <SPAN
2758 > has no dedicated action for.</P
2764 > Deletes every header sent by the server that contains the string the user supplied as parameter.
2784 > This action allows you to block server headers for which no dedicated
2788 > action exists. <SPAN
2792 will remove every server header that contains the string you supplied as parameter.
2795 > Regular expressions are <SPAN
2802 use this action to block different headers in the same request, unless
2803 they contain the same string.
2808 >crunch-server-header</TT
2809 > is only meant for quick tests.
2810 If you have to block several different headers, or only want to modify
2811 parts of them, you should use a custom
2815 HREF="actions-file.html#SERVER-HEADER-FILTER"
2816 >server-header filter</A
2839 > Don't block any header without understanding the consequences.
2847 >Example usage (section):</DT
2858 ># Crunch server headers that try to prevent caching
2859 { +crunch-server-header{no-cache} }
2875 NAME="CRUNCH-OUTGOING-COOKIES"
2876 >8.5.10. crunch-outgoing-cookies</A
2881 CLASS="VARIABLELIST"
2887 > Prevent the web server from reading any HTTP cookies from your system
2897 > HTTP headers from client requests.
2917 > This action is only concerned with <SPAN
2934 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
2935 >crunch-incoming-cookies</A
2944 > to disable HTTP cookies completely.
2953 > to use this action in conjunction
2957 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2958 >session-cookies-only</A
2961 since it would prevent the session cookies from being read.
2976 >+crunch-outgoing-cookies</PRE
2991 NAME="DEANIMATE-GIFS"
2992 >8.5.11. deanimate-gifs</A
2997 CLASS="VARIABLELIST"
3003 >Stop those annoying, distracting animated GIF images.</P
3009 > De-animate GIF animations, i.e. reduce them to their first or last image.
3035 > This will also shrink the images considerably (in bytes, not pixels!). If
3039 > is given, the first frame of the animation
3040 is used as the replacement. If <SPAN
3043 > is given, the last
3044 frame of the animation is used instead, which probably makes more sense for
3045 most banner animations, but also has the risk of not showing the entire
3046 last frame (if it is only a delta to an earlier frame).
3049 > You can safely use this action with patterns that will also match non-GIF
3050 objects, because no attempt will be made at anything that doesn't look like
3066 >+deanimate-gifs{last}</PRE
3081 NAME="DOWNGRADE-HTTP-VERSION"
3082 >8.5.12. downgrade-http-version</A
3087 CLASS="VARIABLELIST"
3093 >Work around (very rare) problems with HTTP/1.1</P
3099 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3119 > This is a left-over from the time when <SPAN
3123 didn't support important HTTP/1.1 features well. It is left here for the
3124 unlikely case that you experience HTTP/1.1 related problems with some server
3125 out there. Not all HTTP/1.1 features and requirements are supported yet,
3126 so there is a chance you might need this action.
3130 >Example usage (section):</DT
3141 >{+downgrade-http-version}
3142 problem-host.example.com</PRE
3157 NAME="FAST-REDIRECTS"
3158 >8.5.13. fast-redirects</A
3163 CLASS="VARIABLELIST"
3169 >Fool some click-tracking scripts and speed up indirect links.</P
3175 > Detects redirection URLs and redirects the browser without contacting
3176 the redirection server first.
3195 >"simple-check"</SPAN
3196 > to just search for the string <SPAN
3200 to detect redirection URLs.
3207 >"check-decoded-url"</SPAN
3208 > to decode URLs (if necessary) before searching
3209 for redirection URLs.
3219 Many sites, like yahoo.com, don't just link to other sites. Instead, they
3220 will link to some script on their own servers, giving the destination as a
3221 parameter, which will then redirect you to the final target. URLs
3222 resulting from this scheme typically look like:
3225 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
3229 > Sometimes, there are even multiple consecutive redirects encoded in the
3230 URL. These redirections via scripts make your web browsing more traceable,
3231 since the server from which you follow such a link can see where you go
3232 to. Apart from that, valuable bandwidth and time is wasted, while your
3233 browser asks the server for one redirect after the other. Plus, it feeds
3237 > This feature is currently not very smart and is scheduled for improvement.
3238 If it is enabled by default, you will have to create some exceptions to
3239 this action. It can lead to failures in several ways:
3242 > Not every URLs with other URLs as parameters is evil.
3243 Some sites offer a real service that requires this information to work.
3244 For example a validation service needs to know, which document to validate.
3248 > assumes that every URL parameter that
3249 looks like another URL is a redirection target, and will always redirect to
3250 the last one. Most of the time the assumption is correct, but if it isn't,
3251 the user gets redirected anyway.
3254 > Another failure occurs if the URL contains other parameters after the URL parameter.
3258 >"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</SPAN
3260 contains the redirection URL <SPAN
3262 >"http://www.example.net/"</SPAN
3264 followed by another parameter. <TT
3268 and will cause a redirect to <SPAN
3270 >"http://www.example.net/&foo=bar"</SPAN
3272 Depending on the target server configuration, the parameter will be silently ignored
3275 >"page not found"</SPAN
3276 > error. You can prevent this problem by
3280 HREF="actions-file.html#REDIRECT"
3284 to remove the last part of the URL, but it requires a little effort.
3287 > To detect a redirection URL, <TT
3291 looks for the string <SPAN
3294 >, either in plain text
3295 (invalid but often used) or encoded as <SPAN
3299 Some sites use their own URL encoding scheme, encrypt the address
3300 of the target server or replace it with a database id. In theses cases
3304 > is fooled and the request reaches the
3305 redirection server where it probably gets logged.
3320 > { +fast-redirects{simple-check} }
3323 { +fast-redirects{check-decoded-url} }
3324 another.example.com/testing</PRE
3345 CLASS="VARIABLELIST"
3351 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size),
3352 do fun text replacements, add personalized effects, etc.</P
3358 > All instances of text-based type, most notably HTML and JavaScript, to which
3359 this action applies, can be filtered on-the-fly through the specified regular
3360 expression based substitutions. (Note: as of version 3.0.3 plain text documents
3361 are exempted from filtering, because web servers often use the
3365 > MIME type for all files whose type they don't know.)
3378 > The name of a content filter, as defined in the <A
3379 HREF="filter-file.html"
3382 Filters can be defined in one or more files as defined by the
3386 HREF="config.html#FILTERFILE"
3397 > is the collection of filters
3398 supplied by the developers. Locally defined filters should go
3399 in their own file, such as <TT
3405 > When used in its negative form,
3406 and without parameters, <SPAN
3412 > filtering is completely disabled.
3419 > For your convenience, there are a number of pre-defined filters available
3420 in the distribution filter file that you can use. See the examples below for
3424 > Filtering requires buffering the page content, which may appear to
3425 slow down page rendering since nothing is displayed until all content has
3426 passed the filters. (It does not really take longer, but seems that way
3427 since the page is not incrementally displayed.) This effect will be more
3428 noticeable on slower connections.
3433 >"Rolling your own"</SPAN
3435 filters requires a knowledge of
3437 HREF="http://en.wikipedia.org/wiki/Regular_expressions"
3446 HREF="http://en.wikipedia.org/wiki/Html"
3453 This is very powerful feature, and potentially very intrusive.
3454 Filters should be used with caution, and where an equivalent
3461 > The amount of data that can be filtered is limited to the
3465 HREF="config.html#BUFFER-LIMIT"
3469 option in the main <A
3473 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
3474 data, and all pending data, is passed through unfiltered.
3477 > Inappropriate MIME types, such as zipped files, are not filtered at all.
3478 (Again, only text-based types except plain text). Encrypted SSL data
3479 (from HTTPS servers) cannot be filtered either, since this would violate
3480 the integrity of the secure transaction. In some situations it might
3481 be necessary to protect certain text, like source code, from filtering
3482 by defining appropriate <TT
3488 > Compressed content can't be filtered either, unless <SPAN
3492 is compiled with zlib support (requires at least <SPAN
3499 > will decompress the content before filtering
3503 > If you use a <SPAN
3506 > version without zlib support, but want filtering to work on
3507 as much documents as possible, even those that would normally be sent compressed,
3508 you must use the <TT
3511 HREF="actions-file.html#PREVENT-COMPRESSION"
3512 >prevent-compression</A
3515 action in conjunction with <TT
3521 > Content filtering can achieve some of the same effects as the
3525 HREF="actions-file.html#BLOCK"
3529 action, i.e. it can be used to block ads and banners. But the mechanism
3530 works quite differently. One effective use, is to block ad banners
3531 based on their size (see below), since many of these seem to be somewhat
3538 > with suggestions for new or
3539 improved filters is particularly welcome!
3542 > The below list has only the names and a one-line description of each
3543 predefined filter. There are <A
3544 HREF="filter-file.html#PREDEFINED-FILTERS"
3546 verbose explanations</A
3547 > of what these filters do in the <A
3548 HREF="filter-file.html"
3549 >filter file chapter</A
3554 >Example usage (with filters from the distribution <TT
3559 HREF="filter-file.html#PREDEFINED-FILTERS"
3560 >the Predefined Filters section</A
3562 more explanation on each:</DT
3566 NAME="FILTER-JS-ANNOYANCES"
3577 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse.</PRE
3585 NAME="FILTER-JS-EVENTS"
3596 >+filter{js-events} # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).</PRE
3604 NAME="FILTER-HTML-ANNOYANCES"
3615 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse.</PRE
3623 NAME="FILTER-CONTENT-COOKIES"
3634 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content.</PRE
3642 NAME="FILTER-REFRESH-TAGS"
3653 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups).</PRE
3661 NAME="FILTER-UNSOLICITED-POPUPS"
3672 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.</PRE
3680 NAME="FILTER-ALL-POPUPS"
3691 >+filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.</PRE
3699 NAME="FILTER-IMG-REORDER"
3710 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective.</PRE
3718 NAME="FILTER-BANNERS-BY-SIZE"
3729 >+filter{banners-by-size} # Kill banners by size.</PRE
3737 NAME="FILTER-BANNERS-BY-LINK"
3748 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers.</PRE
3756 NAME="FILTER-WEBBUGS"
3767 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking).</PRE
3775 NAME="FILTER-TINY-TEXTFORMS"
3786 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap.</PRE
3794 NAME="FILTER-JUMPING-WINDOWS"
3805 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves.</PRE
3813 NAME="FILTER-FRAMESET-BORDERS"
3824 >+filter{frameset-borders} # Give frames a border and make them resizable.</PRE
3832 NAME="FILTER-DEMORONIZER"
3843 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets.</PRE
3851 NAME="FILTER-SHOCKWAVE-FLASH"
3862 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects.</PRE
3870 NAME="FILTER-QUICKTIME-KIOSKMODE"
3881 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable.</PRE
3900 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
3908 NAME="FILTER-CRUDE-PARENTAL"
3919 >+filter{crude-parental} # Crude parental filtering. Note that this filter doesn't work reliably.</PRE
3927 NAME="FILTER-IE-EXPLOITS"
3938 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits.</PRE
3946 NAME="FILTER-SITE-SPECIFICS"
3957 >+filter{site-specifics} # Cure for site-specific problems. Don't apply generally!</PRE
3965 NAME="FILTER-NO-PING"
3976 >+filter{no-ping} # Removes non-standard ping attributes in <a> and <area> tags.</PRE
3984 NAME="FILTER-GOOGLE"
3995 >+filter{google} # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</PRE
4014 >+filter{yahoo} # CSS-based block for Yahoo text ads. Also removes a width limitation.</PRE
4033 >+filter{msn} # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</PRE
4041 NAME="FILTER-BLOGSPOT"
4052 >+filter{blogspot} # Cleans up some Blogspot blogs. Read the fine print before using this.</PRE
4067 NAME="FORCE-TEXT-MODE"
4068 >8.5.15. force-text-mode</A
4073 CLASS="VARIABLELIST"
4082 > to treat a document as if it was in some kind of <SPAN
4094 > Declares a document as text, even if the <SPAN
4096 >"Content-Type:"</SPAN
4097 > isn't detected as such.
4120 HREF="actions-file.html#FILTER"
4127 > tries to only filter files that are
4128 in some kind of text format. The same restrictions apply to
4132 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4133 >content-type-overwrite</A
4138 >force-text-mode</TT
4139 > declares a document as text,
4140 without looking at the <SPAN
4142 >"Content-Type:"</SPAN
4164 > Think twice before activating this action. Filtering binary data
4165 with regular expressions can cause file damage.
4200 NAME="FORWARD-OVERRIDE"
4201 >8.5.16. forward-override</A
4206 CLASS="VARIABLELIST"
4212 >Change the forwarding settings based on User-Agent or request origin</P
4218 > Overrules the forward directives in the configuration file.
4238 > to use a direct connection without any additional proxies.</P
4244 >"forward 127.0.0.1:8123"</SPAN
4245 > to use the HTTP proxy listening at 127.0.0.1 port 8123.
4252 >"forward-socks4a 127.0.0.1:9050 ."</SPAN
4253 > to use the socks4a proxy listening at
4254 127.0.0.1 port 9050. Replace <SPAN
4256 >"forward-socks4a"</SPAN
4259 >"forward-socks4"</SPAN
4261 to use a socks4 connection (with local DNS resolution) instead, use <SPAN
4263 >"forward-socks5"</SPAN
4265 for socks5 connections (with remote DNS resolution).
4272 >"forward-socks4a 127.0.0.1:9050 proxy.example.org:8000"</SPAN
4273 > to use the socks4a proxy
4274 listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000.
4277 >"forward-socks4a"</SPAN
4280 >"forward-socks4"</SPAN
4281 > to use a socks4 connection
4282 (with local DNS resolution) instead, use <SPAN
4284 >"forward-socks5"</SPAN
4286 for socks5 connections (with remote DNS resolution).
4295 > This action takes parameters similar to the
4297 HREF="config.html#FORWARDING"
4299 > directives in the configuration
4300 file, but without the URL pattern. It can be used as replacement, but normally it's only
4301 used in cases where matching based on the request URL isn't sufficient.
4322 > Please read the description for the <A
4323 HREF="config.html#FORWARDING"
4326 using this action. Forwarding to the wrong people will reduce your privacy and increase the
4327 chances of man-in-the-middle attacks.
4330 > If the ports are missing or invalid, default values will be used. This might change
4331 in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy
4336 HREF="http://config.privoxy.org/show-url-info"
4338 >show-url-info CGI page</A
4340 to verify that your forward settings do what you thought the do.
4359 ># Always use direct connections for requests previously tagged as
4362 >"User-Agent: fetch libfetch/2.0"</SPAN
4364 # resuming downloads continues to work.
4365 # This way you can continue to use Tor for your normal browsing,
4366 # without overloading the Tor network with your FreeBSD ports updates
4367 # or downloads of bigger files like ISOs.
4368 # Note that HTTP headers are easy to fake and therefore their
4369 # values are as (un)trustworthy as your clients and users.
4370 {+forward-override{forward .} \
4371 -hide-if-modified-since \
4372 -overwrite-last-modified \
4374 TAG:^User-Agent: fetch libfetch/2\.0$
4390 NAME="HANDLE-AS-EMPTY-DOCUMENT"
4391 >8.5.17. handle-as-empty-document</A
4396 CLASS="VARIABLELIST"
4402 >Mark URLs that should be replaced by empty documents <SPAN
4406 >if they get blocked</I
4414 > This action alone doesn't do anything noticeable. It just marks URLs.
4418 HREF="actions-file.html#BLOCK"
4428 the presence or absence of this mark decides whether an HTML <SPAN
4432 page, or an empty document will be sent to the client as a substitute for the blocked content.
4439 > document isn't literally empty, but actually contains a single space.
4459 > Some browsers complain about syntax errors if JavaScript documents
4460 are blocked with <SPAN
4464 default HTML page; this option can be used to silence them.
4465 And of course this action can also be used to eliminate the <SPAN
4469 BLOCKED message in frames.
4472 > The content type for the empty document can be specified with
4476 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
4477 >content-type-overwrite{}</A
4480 but usually this isn't necessary.
4495 ># Block all documents on example.org that end with ".js",
4496 # but send an empty document instead of the usual HTML message.
4497 {+block{Blocked JavaScript} +handle-as-empty-document}
4514 NAME="HANDLE-AS-IMAGE"
4515 >8.5.18. handle-as-image</A
4520 CLASS="VARIABLELIST"
4526 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
4530 >if they do get blocked</I
4532 >, rather than HTML pages)</P
4538 > This action alone doesn't do anything noticeable. It just marks URLs as images.
4542 HREF="actions-file.html#BLOCK"
4552 the presence or absence of this mark decides whether an HTML <SPAN
4556 page, or a replacement image (as determined by the <TT
4559 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4560 >set-image-blocker</A
4562 > action) will be sent to the
4563 client as a substitute for the blocked content.
4583 > The below generic example section is actually part of <TT
4587 It marks all URLs with well-known image file name extensions as images and should
4591 > Users will probably only want to use the handle-as-image action in conjunction with
4595 HREF="actions-file.html#BLOCK"
4598 >, to block sources of banners, whose URLs don't
4599 reflect the file type, like in the second example section.
4602 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
4603 frames require an HTML page to be sent, or they won't display properly.
4606 >handle-as-image</TT
4607 > in this situation will not replace the
4608 ad frame with an image, but lead to error messages.
4612 >Example usage (sections):</DT
4623 ># Generic image extensions:
4626 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4628 # These don't look like images, but they're banners and should be
4629 # blocked as images:
4631 {+block{Nasty banners.} +handle-as-image}
4632 nasty-banner-server.example.com/junk.cgi\?output=trash</PRE
4647 NAME="HIDE-ACCEPT-LANGUAGE"
4648 >8.5.19. hide-accept-language</A
4653 CLASS="VARIABLELIST"
4659 >Pretend to use different language settings.</P
4665 > Deletes or replaces the <SPAN
4667 >"Accept-Language:"</SPAN
4668 > HTTP header in client requests.
4684 >, or any user defined value.
4691 > Faking the browser's language settings can be useful to make a
4692 foreign User-Agent set with
4696 HREF="actions-file.html#HIDE-USER-AGENT"
4703 > However some sites with content in different languages check the
4706 >"Accept-Language:"</SPAN
4707 > to decide which one to take by default.
4708 Sometimes it isn't possible to later switch to another language without
4711 >"Accept-Language:"</SPAN
4715 > Therefore it's a good idea to either only change the
4718 >"Accept-Language:"</SPAN
4719 > header to languages you understand,
4720 or to languages that aren't wide spread.
4723 > Before setting the <SPAN
4725 >"Accept-Language:"</SPAN
4727 to a rare language, you should consider that it helps to
4728 make your requests unique and thus easier to trace.
4729 If you don't plan to change this header frequently,
4730 you should stick to a common language.
4734 >Example usage (section):</DT
4745 ># Pretend to use Canadian language settings.
4746 {+hide-accept-language{en-ca} \
4747 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4764 NAME="HIDE-CONTENT-DISPOSITION"
4765 >8.5.20. hide-content-disposition</A
4770 CLASS="VARIABLELIST"
4776 >Prevent download menus for content you prefer to view inside the browser.</P
4782 > Deletes or replaces the <SPAN
4784 >"Content-Disposition:"</SPAN
4785 > HTTP header set by some servers.
4801 >, or any user defined value.
4808 > Some servers set the <SPAN
4810 >"Content-Disposition:"</SPAN
4812 documents they assume you want to save locally before viewing them.
4815 >"Content-Disposition:"</SPAN
4816 > header contains the file name
4817 the browser is supposed to use by default.
4820 > In most browsers that understand this header, it makes it impossible to
4827 > the document, without downloading it first,
4828 even if it's just a simple text file or an image.
4831 > Removing the <SPAN
4833 >"Content-Disposition:"</SPAN
4835 to prevent this annoyance, but some browsers additionally check the
4838 >"Content-Type:"</SPAN
4839 > header, before they decide if they can
4840 display a document without saving it first. In these cases, you have
4841 to change this header as well, before the browser stops displaying
4845 > It is also possible to change the server's file name suggestion
4846 to another one, but in most cases it isn't worth the time to set
4850 > This action will probably be removed in the future,
4851 use server-header filters instead.
4866 ># Disarm the download link in Sourceforge's patch tracker
4868 +content-type-overwrite{text/plain}\
4869 +hide-content-disposition{block} }
4870 .sourceforge.net/tracker/download\.php</PRE
4885 NAME="HIDE-IF-MODIFIED-SINCE"
4886 >8.5.21. hide-if-modified-since</A
4891 CLASS="VARIABLELIST"
4897 >Prevent yet another way to track the user's steps between sessions.</P
4905 >"If-Modified-Since:"</SPAN
4906 > HTTP client header or modifies its value.
4922 >, or a user defined value that specifies a range of hours.
4929 > Removing this header is useful for filter testing, where you want to force a real
4930 reload instead of getting status code <SPAN
4933 >, which would cause the
4934 browser to use a cached copy of the page.
4937 > Instead of removing the header, <TT
4939 >hide-if-modified-since</TT
4941 also add or subtract a random amount of time to/from the header's value.
4942 You specify a range of minutes where the random factor should be chosen from and
4946 > does the rest. A negative value means
4947 subtracting, a positive value adding.
4950 > Randomizing the value of the <SPAN
4952 >"If-Modified-Since:"</SPAN
4954 it less likely that the server can use the time as a cookie replacement,
4955 but you will run into caching problems if the random range is too high.
4958 > It is a good idea to only use a small negative value and let
4962 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
4963 >overwrite-last-modified</A
4966 handle the greater changes.
4969 > It is also recommended to use this action together with
4973 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
4974 >crunch-if-none-match</A
4977 otherwise it's more or less pointless.
4981 >Example usage (section):</DT
4992 ># Let the browser revalidate but make tracking based on the time less likely.
4993 {+hide-if-modified-since{-60} \
4994 +overwrite-last-modified{randomize} \
4995 +crunch-if-none-match}
5011 NAME="HIDE-FORWARDED-FOR-HEADERS"
5012 >8.5.22. hide-forwarded-for-headers</A
5017 CLASS="VARIABLELIST"
5023 >Improve privacy by not forwarding the source of the request in the HTTP headers.</P
5029 > Deletes any existing <SPAN
5031 >"X-Forwarded-for:"</SPAN
5032 > HTTP header from client requests.
5052 > It is safe and recommended to leave this on.
5067 >+hide-forwarded-for-headers</PRE
5082 NAME="HIDE-FROM-HEADER"
5083 >8.5.23. hide-from-header</A
5088 CLASS="VARIABLELIST"
5094 >Keep your (old and ill) browser from telling web servers your email address</P
5100 > Deletes any existing <SPAN
5103 > HTTP header, or replaces it with the
5120 >, or any user defined value.
5130 > will completely remove the header
5131 (not to be confused with the <TT
5134 HREF="actions-file.html#BLOCK"
5141 > Alternately, you can specify any value you prefer to be sent to the web
5142 server. If you do, it is a matter of fairness not to use any address that
5143 is actually used by a real person.
5146 > This action is rarely needed, as modern web browsers don't send
5165 >+hide-from-header{block}</PRE
5178 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
5193 NAME="HIDE-REFERRER"
5194 >8.5.24. hide-referrer</A
5202 CLASS="VARIABLELIST"
5208 >Conceal which link you followed to get to a particular site</P
5217 > (sic) HTTP header from the client request,
5218 or replaces it with a forged one.
5237 >"conditional-block"</SPAN
5238 > to delete the header completely if the host has changed.</P
5244 >"conditional-forge"</SPAN
5245 > to forge the header if the host has changed.</P
5252 > to delete the header unconditionally.</P
5259 > to pretend to be coming from the homepage of the server we are talking to.</P
5263 >Any other string to set a user defined referrer.</P
5273 >conditional-block</TT
5274 > is the only parameter,
5275 that isn't easily detected in the server's log file. If it blocks the
5276 referrer, the request will look like the visitor used a bookmark or
5277 typed in the address directly.
5280 > Leaving the referrer unmodified for requests on the same host
5281 allows the server owner to see the visitor's <SPAN
5285 but in most cases she could also get that information by comparing
5286 other parts of the log file: for example the User-Agent if it isn't
5287 a very common one, or the user's IP address if it doesn't change between
5291 > Always blocking the referrer, or using a custom one, can lead to
5292 failures on servers that check the referrer before they answer any
5293 requests, in an attempt to prevent their content from being
5294 embedded or linked to elsewhere.
5299 >conditional-block</TT
5304 will work with referrer checks, as long as content and valid referring page
5305 are on the same host. Most of the time that's the case.
5312 > is an alternate spelling of
5316 > and the two can be can be freely
5317 substituted with each other. (<SPAN
5321 correct English spelling, however the HTTP specification has a bug - it
5322 requires it to be spelled as <SPAN
5340 >+hide-referrer{forge}</PRE
5353 >+hide-referrer{http://www.yahoo.com/}</PRE
5368 NAME="HIDE-USER-AGENT"
5369 >8.5.25. hide-user-agent</A
5374 CLASS="VARIABLELIST"
5380 >Try to conceal your type of browser and client operating system</P
5386 > Replaces the value of the <SPAN
5388 >"User-Agent:"</SPAN
5390 in client requests with the specified value.
5403 > Any user-defined string.
5428 > This can lead to problems on web sites that depend on looking at this header in
5429 order to customize their content for different browsers (which, by the
5436 > the right thing to do: good web sites
5437 work browser-independently).
5444 > Using this action in multi-user setups or wherever different types of
5445 browsers will access the same <SPAN
5455 >. In single-user, single-browser
5456 setups, you might use it to delete your OS version information from
5457 the headers, because it is an invitation to exploit known bugs for your
5458 OS. It is also occasionally useful to forge this in order to access
5459 sites that won't let you in otherwise (though there may be a good
5460 reason in some cases). Example of this: some MSN sites will not
5464 > enter, yet forging to a
5468 > user-agent works just fine.
5469 (Must be just a silly MS goof, I'm sure :-).
5472 > More information on known user-agent strings can be found at
5474 HREF="http://www.user-agents.org/"
5476 >http://www.user-agents.org/</A
5480 HREF="http://en.wikipedia.org/wiki/User_agent"
5482 >http://en.wikipedia.org/wiki/User_agent</A
5498 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
5513 NAME="LIMIT-CONNECT"
5514 >8.5.26. limit-connect</A
5519 CLASS="VARIABLELIST"
5525 >Prevent abuse of <SPAN
5528 > as a TCP proxy relay or disable SSL for untrusted sites</P
5534 > Specifies to which ports HTTP CONNECT requests are allowable.
5547 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5548 defaulting to 0 and the maximum to 65K).
5555 > By default, i.e. if no <TT
5562 > allows HTTP CONNECT requests to all
5566 > if fine-grained control
5567 is desired for some or all destinations.
5570 > The CONNECT methods exists in HTTP to allow access to secure websites
5574 > URLs) through proxies. It works very simply:
5575 the proxy connects to the server on the specified port, and then
5576 short-circuits its connections to the client and to the remote server.
5577 This means CONNECT-enabled proxies can be used as TCP relays very easily.
5583 > relays HTTPS traffic without seeing
5584 the decoded content. Websites can leverage this limitation to circumvent <SPAN
5588 filters. By specifying an invalid port range you can disable HTTPS entirely.
5592 >Example usages:</DT
5603 >+limit-connect{443} # Port 443 is OK.
5604 +limit-connect{80,443} # Ports 80 and 443 are OK.
5605 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5606 +limit-connect{-} # All ports are OK
5607 +limit-connect{,} # No HTTPS/SSL traffic is allowed</PRE
5622 NAME="PREVENT-COMPRESSION"
5623 >8.5.27. prevent-compression</A
5628 CLASS="VARIABLELIST"
5634 > Ensure that servers send the content uncompressed, so it can be
5638 HREF="actions-file.html#FILTER"
5648 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5668 > More and more websites send their content compressed by default, which
5669 is generally a good idea and saves bandwidth. But the <TT
5672 HREF="actions-file.html#FILTER"
5679 HREF="actions-file.html#DEANIMATE-GIFS"
5683 actions need access to the uncompressed data.
5686 > When compiled with zlib support (available since <SPAN
5689 > 3.0.7), content that should be
5690 filtered is decompressed on-the-fly and you don't have to worry about this action.
5691 If you are using an older <SPAN
5694 > version, or one that hasn't been compiled with zlib
5695 support, this action can be used to convince the server to send the content uncompressed.
5698 > Most text-based instances compress very well, the size is seldom decreased by less than 50%,
5699 for markup-heavy instances like news feeds saving more than 90% of the original size isn't
5703 > Not using compression will therefore slow down the transfer, and you should only
5704 enable this action if you really need it. As of <SPAN
5707 > 3.0.7 it's disabled in all
5708 predefined action settings.
5711 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5712 documents correctly. Broken PHP applications tend to send an empty document body,
5713 some IIS versions only send the beginning of the content. If you enable
5716 >prevent-compression</TT
5717 > per default, you might want to add
5718 exceptions for those sites. See the example for how to do that.
5722 >Example usage (sections):</DT
5733 ># Selectively turn off compression, and enable a filter
5735 { +filter{tiny-textforms} +prevent-compression }
5736 # Match only these sites
5741 # Or instead, we could set a universal default:
5743 { +prevent-compression }
5746 # Then maybe make exceptions for broken sites:
5748 { -prevent-compression }
5764 NAME="OVERWRITE-LAST-MODIFIED"
5765 >8.5.28. overwrite-last-modified</A
5770 CLASS="VARIABLELIST"
5776 >Prevent yet another way to track the user's steps between sessions.</P
5784 >"Last-Modified:"</SPAN
5785 > HTTP server header or modifies its value.
5798 > One of the keywords: <SPAN
5803 >"reset-to-request-time"</SPAN
5815 > Removing the <SPAN
5817 >"Last-Modified:"</SPAN
5818 > header is useful for filter
5819 testing, where you want to force a real reload instead of getting status
5823 >, which would cause the browser to reuse the old
5824 version of the page.
5830 > option overwrites the value of the
5833 >"Last-Modified:"</SPAN
5834 > header with a randomly chosen time
5835 between the original value and the current time. In theory the server
5836 could send each document with a different <SPAN
5838 >"Last-Modified:"</SPAN
5840 header to track visits without using cookies. <SPAN
5844 makes it impossible and the browser can still revalidate cached documents.
5849 >"reset-to-request-time"</SPAN
5850 > overwrites the value of the
5853 >"Last-Modified:"</SPAN
5854 > header with the current time. You could use
5855 this option together with
5859 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5860 >hided-if-modified-since</A
5863 to further customize your random range.
5866 > The preferred parameter here is <SPAN
5870 to use, as long as the time settings are more or less correct.
5871 If the server sets the <SPAN
5873 >"Last-Modified:"</SPAN
5874 > header to the time
5875 of the request, the random range becomes zero and the value stays the same.
5876 Therefore you should later randomize it a second time with
5880 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5881 >hided-if-modified-since</A
5887 > It is also recommended to use this action together with
5891 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5892 >crunch-if-none-match</A
5909 ># Let the browser revalidate without being tracked across sessions
5910 { +hide-if-modified-since{-60} \
5911 +overwrite-last-modified{randomize} \
5912 +crunch-if-none-match}
5929 >8.5.29. redirect</A
5934 CLASS="VARIABLELIST"
5940 > Redirect requests to other sites.
5947 > Convinces the browser that the requested document has been moved
5948 to another location and the browser should get it from there.
5961 > An absolute URL or a single pcrs command.
5968 > Requests to which this action applies are answered with a
5969 HTTP redirect to URLs of your choosing. The new URL is
5970 either provided as parameter, or derived by applying a
5971 single pcrs command to the original URL.
5974 > This action will be ignored if you use it together with
5978 HREF="actions-file.html#BLOCK"
5982 It can be combined with
5986 HREF="actions-file.html#FAST-REDIRECTS"
5987 >fast-redirects{check-decoded-url}</A
5990 to redirect to a decoded version of a rewritten URL.
5993 > Use this action carefully, make sure not to create redirection loops
5994 and be aware that using your own redirects might make it
5995 possible to fingerprint your requests.
5998 > In case of problems with your redirects, or simply to watch
5999 them working, enable <A
6000 HREF="config.html#DEBUG"
6006 >Example usages:</DT
6017 ># Replace example.com's style sheet with another one
6018 { +redirect{http://localhost/css-replacements/example.com.css} }
6019 example.com/stylesheet\.css
6021 # Create a short, easy to remember nickname for a favorite site
6022 # (relies on the browser accept and forward invalid URLs to <SPAN
6026 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
6029 # Always use the expanded view for Undeadly.org articles
6030 # (Note the $ at the end of the URL pattern to make sure
6031 # the request for the rewritten URL isn't redirected as well)
6032 {+redirect{s@$@&mode=expanded@}}
6033 undeadly.org/cgi\?action=article&sid=\d*$
6035 # Redirect Google search requests to MSN
6036 {+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
6039 # Redirect MSN search requests to Yahoo
6040 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
6041 search.msn.com//results\.aspx\?q=
6043 # Redirect remote requests for this manual
6044 # to the local version delivered by Privoxy
6045 {+redirect{s@^http://www@http://config@}}
6046 www.privoxy.org/user-manual/</PRE
6061 NAME="SERVER-HEADER-FILTER"
6062 >8.5.30. server-header-filter</A
6067 CLASS="VARIABLELIST"
6073 > Rewrite or remove single server headers.
6080 > All server headers to which this action applies are filtered on-the-fly
6081 through the specified regular expression based substitutions.
6094 > The name of a server-header filter, as defined in one of the
6096 HREF="filter-file.html"
6105 > Server-header filters are applied to each header on its own, not to
6106 all at once. This makes it easier to diagnose problems, but on the downside
6107 you can't write filters that only change header x if header y's value is z.
6108 You can do that by using tags though.
6111 > Server-header filters are executed after the other header actions have finished
6112 and use their output as input.
6115 > Please refer to the <A
6116 HREF="filter-file.html"
6117 >filter file chapter</A
6119 to learn which server-header filters are available by default, and how to
6124 >Example usage (section):</DT
6135 >{+server-header-filter{html-to-xml}}
6136 example.org/xml-instance-that-is-delivered-as-html
6138 {+server-header-filter{xml-to-html}}
6139 example.org/instance-that-is-delivered-as-xml-but-is-not
6155 NAME="SERVER-HEADER-TAGGER"
6156 >8.5.31. server-header-tagger</A
6161 CLASS="VARIABLELIST"
6167 > Enable or disable filters based on the Content-Type header.
6174 > Server headers to which this action applies are filtered on-the-fly through
6175 the specified regular expression based substitutions, the result is used as
6189 > The name of a server-header tagger, as defined in one of the
6191 HREF="filter-file.html"
6200 > Server-header taggers are applied to each header on its own,
6201 and as the header isn't modified, each tagger <SPAN
6208 > Server-header taggers are executed before all other header actions
6209 that modify server headers. Their tags can be used to control
6210 all of the other server-header actions, the content filters
6211 and the crunch actions (<A
6212 HREF="actions-file.html#REDIRECT"
6216 HREF="actions-file.html#BLOCK"
6221 > Obviously crunching based on tags created by server-header taggers
6222 doesn't prevent the request from showing up in the server's log file.
6226 >Example usage (section):</DT
6237 ># Tag every request with the content type declared by the server
6238 {+server-header-tagger{content-type}}
6255 NAME="SESSION-COOKIES-ONLY"
6256 >8.5.32. session-cookies-only</A
6261 CLASS="VARIABLELIST"
6267 > Allow only temporary <SPAN
6270 > cookies (for the current
6271 browser session <SPAN
6289 >"Set-Cookie:"</SPAN
6291 server headers. Most browsers will not store such cookies permanently and
6292 forget them in between sessions.
6312 > This is less strict than <TT
6315 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6316 >crunch-incoming-cookies</A
6322 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6323 >crunch-outgoing-cookies</A
6325 > and allows you to browse
6326 websites that insist or rely on setting cookies, without compromising your privacy too badly.
6329 > Most browsers will not permanently store cookies that have been processed by
6332 >session-cookies-only</TT
6333 > and will forget about them between sessions.
6334 This makes profiling cookies useless, but won't break sites which require cookies so
6335 that you can log in for transactions. This is generally turned on for all
6336 sites, and is the recommended setting.
6347 >session-cookies-only</TT
6352 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6353 >crunch-incoming-cookies</A
6359 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6360 >crunch-outgoing-cookies</A
6362 >. If you do, cookies
6363 will be plainly killed.
6366 > Note that it is up to the browser how it handles such cookies without an <SPAN
6370 field. If you use an exotic browser, you might want to try it out to be sure.
6373 > This setting also has no effect on cookies that may have been stored
6374 previously by the browser before starting <SPAN
6378 These would have to be removed manually.
6386 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6387 >content-cookies filter</A
6389 to block some types of cookies. Content cookies are not effected by
6392 >session-cookies-only</TT
6408 >+session-cookies-only</PRE
6423 NAME="SET-IMAGE-BLOCKER"
6424 >8.5.33. set-image-blocker</A
6429 CLASS="VARIABLELIST"
6435 >Choose the replacement for blocked images</P
6441 > This action alone doesn't do anything noticeable. If <SPAN
6451 HREF="actions-file.html#BLOCK"
6463 HREF="actions-file.html#HANDLE-AS-IMAGE"
6473 apply, i.e. if the request is to be blocked as an image,
6480 > the parameter of this action decides what will be
6481 sent as a replacement.
6501 > to send a built-in checkerboard pattern image. The image is visually
6502 decent, scales very well, and makes it obvious where banners were busted.
6510 > to send a built-in transparent image. This makes banners disappear
6511 completely, but makes it hard to detect where <SPAN
6515 images on a given page and complicates troubleshooting if <SPAN
6519 has blocked innocent images, like navigation icons.
6533 send a redirect to <TT
6539 to any image anywhere, even in your local filesystem via <SPAN
6543 (But note that not all browsers support redirecting to a local file system).
6546 > A good application of redirects is to use special <SPAN
6550 URLs, which send the built-in images, as <TT
6556 This has the same visual effect as specifying <SPAN
6563 the first place, but enables your browser to cache the replacement image, instead of requesting
6564 it over and over again.
6573 > The URLs for the built-in images are <SPAN
6575 >"http://config.privoxy.org/send-banner?type=<TT
6596 > There is a third (advanced) type, called <SPAN
6608 >set-image-blocker</TT
6609 >, but meant for use from <A
6610 HREF="filter-file.html"
6613 Auto will select the type of image that would have applied to the referring page, had it been an image.
6631 >+set-image-blocker{pattern}</PRE
6638 > Redirect to the BSD daemon:
6649 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6656 > Redirect to the built-in pattern for better caching:
6667 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6686 > Note that many of these actions have the potential to cause a page to
6687 misbehave, possibly even not to display at all. There are many ways
6688 a site designer may choose to design his site, and what HTTP header
6689 content, and other criteria, he may depend on. There is no way to have hard
6690 and fast rules for all sites. See the <A
6691 HREF="appendix.html#ACTIONSANAT"
6693 > for a brief example on troubleshooting
6716 >, can be defined by combining other actions.
6717 These can in turn be invoked just like the built-in actions.
6718 Currently, an alias name can contain any character except space, tab,
6736 > that you only use <SPAN
6756 Alias names are not case sensitive, and are not required to start with a
6763 > sign, since they are merely textually
6766 > Aliases can be used throughout the actions file, but they <SPAN
6771 defined in a special section at the top of the file!</I
6774 And there can only be one such section per actions file. Each actions file may
6775 have its own alias section, and the aliases defined in it are only visible
6776 within that file.</P
6778 > There are two main reasons to use aliases: One is to save typing for frequently
6779 used combinations of actions, the other one is a gain in flexibility: If you
6780 decide once how you want to handle shops by defining an alias called
6784 >, you can later change your policy on shops in
6791 > place, and your changes will take effect everywhere
6792 in the actions file where the <SPAN
6795 > alias is used. Calling aliases
6796 by their purpose also makes your actions files more readable.</P
6798 > Currently, there is one big drawback to using aliases, though:
6802 >'s built-in web-based action file
6803 editor honors aliases when reading the actions files, but it expands
6804 them before writing. So the effects of your aliases are of course preserved,
6805 but the aliases themselves are lost when you edit sections that use aliases
6808 > Now let's define some aliases...</P
6818 > # Useful custom aliases we can use later.
6820 # Note the (required!) section header line and that this section
6821 # must be at the top of the actions file!
6825 # These aliases just save typing later:
6826 # (Note that some already use other aliases!)
6828 +crunch-all-cookies = +<A
6829 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6830 >crunch-incoming-cookies</A
6832 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6833 >crunch-outgoing-cookies</A
6835 -crunch-all-cookies = -<A
6836 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6837 >crunch-incoming-cookies</A
6839 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6840 >crunch-outgoing-cookies</A
6842 +block-as-image = +block{Blocked image.} +handle-as-image
6843 allow-all-cookies = -crunch-all-cookies -<A
6844 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6845 >session-cookies-only</A
6847 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6848 >filter{content-cookies}</A
6851 # These aliases define combinations of actions
6852 # that are useful for certain types of sites:
6855 HREF="actions-file.html#BLOCK"
6858 HREF="actions-file.html#FILTER"
6860 > -crunch-all-cookies -<A
6861 HREF="actions-file.html#FAST-REDIRECTS"
6864 HREF="actions-file.html#HIDE-REFERER"
6867 HREF="actions-file.html#PREVENT-COMPRESSION"
6868 >prevent-compression</A
6871 shop = -crunch-all-cookies -<A
6872 HREF="actions-file.html#FILTER-ALL-POPUPS"
6873 >filter{all-popups}</A
6876 # Short names for other aliases, for really lazy people ;-)
6878 c0 = +crunch-all-cookies
6879 c1 = -crunch-all-cookies</PRE
6885 > ...and put them to use. These sections would appear in the lower part of an
6886 actions file and define exceptions to the default actions (as specified further
6900 > # These sites are either very complex or very keen on
6901 # user data and require minimal interference to work:
6904 .office.microsoft.com
6905 .windowsupdate.microsoft.com
6906 # Gmail is really mail.google.com, not gmail.com
6910 # Allow cookies (for setting and retrieving your customer data)
6914 .worldpay.com # for quietpc.com
6917 # These shops require pop-ups:
6919 {-filter{all-popups} -filter{unsolicited-popups}}
6921 .overclockers.co.uk</PRE
6927 > Aliases like <SPAN
6933 > are typically used for
6937 > sites that require more than one action to be disabled
6938 in order to function properly.</P
6946 >8.7. Actions Files Tutorial</A
6949 > The above chapters have shown <A
6950 HREF="actions-file.html"
6951 >which actions files
6952 there are and how they are organized</A
6953 >, how actions are <A
6954 HREF="actions-file.html#ACTIONS"
6957 HREF="actions-file.html#ACTIONS-APPLY"
6961 HREF="actions-file.html#AF-PATTERNS"
6965 HREF="actions-file.html#ALIASES"
6967 >. Now, let's look at an
6975 file and see how all these pieces come together:</P
6982 >8.7.1. default.action</A
6985 >Every config file should start with a short comment stating its purpose:</P
6995 ># Sample default.action file <ijbswa-developers@lists.sourceforge.net></PRE
7001 >Then, since this is the <TT
7005 first section is a special section for internal use that you needn't
7006 change or worry about:</P
7016 >##########################################################################
7017 # Settings -- Don't change! For internal Privoxy use ONLY.
7018 ##########################################################################
7021 for-privoxy-version=3.0</PRE
7027 >After that comes the (optional) alias section. We'll use the example
7028 section from the above <A
7029 HREF="actions-file.html#ALIASES"
7030 >chapter on aliases</A
7032 that also explains why and how aliases are used:</P
7042 >##########################################################################
7044 ##########################################################################
7047 # These aliases just save typing later:
7048 # (Note that some already use other aliases!)
7050 +crunch-all-cookies = +<A
7051 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7052 >crunch-incoming-cookies</A
7054 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7055 >crunch-outgoing-cookies</A
7057 -crunch-all-cookies = -<A
7058 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
7059 >crunch-incoming-cookies</A
7061 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
7062 >crunch-outgoing-cookies</A
7064 +block-as-image = +block{Blocked image.} +handle-as-image
7065 mercy-for-cookies = -crunch-all-cookies -<A
7066 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7067 >session-cookies-only</A
7069 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
7070 >filter{content-cookies}</A
7073 # These aliases define combinations of actions
7074 # that are useful for certain types of sites:
7077 HREF="actions-file.html#BLOCK"
7080 HREF="actions-file.html#FILTER"
7082 > -crunch-all-cookies -<A
7083 HREF="actions-file.html#FAST-REDIRECTS"
7086 HREF="actions-file.html#HIDE-REFERER"
7089 shop = -crunch-all-cookies -<A
7090 HREF="actions-file.html#FILTER-ALL-POPUPS"
7091 >filter{all-popups}</A
7098 > Now come the regular sections, i.e. sets of actions, accompanied
7099 by URL patterns to which they apply. Remember <SPAN
7104 are disabled when matching starts</I
7106 >, so we have to explicitly
7107 enable the ones we want.</P
7109 > The first regular section is probably the most important. It has only
7118 HREF="actions-file.html#AF-PATTERNS"
7119 >matches all URLs</A
7121 set of actions used in this <SPAN
7129 be applied to all requests as a start</I
7131 >. It can be partly or
7132 wholly overridden by later matches further down this file, or in user.action,
7133 but it will still be largely responsible for your overall browsing
7136 > Again, at the start of matching, all actions are disabled, so there is
7137 no need to disable any actions here. (Remember: a <SPAN
7141 preceding the action name enables the action, a <SPAN
7145 Also note how this long line has been made more readable by splitting it into
7146 multiple lines with line continuation.</P
7156 >##########################################################################
7157 # "Defaults" section:
7158 ##########################################################################
7161 HREF="actions-file.html#DEANIMATE-GIFS"
7165 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
7166 >filter{html-annoyances}</A
7169 HREF="actions-file.html#FILTER-REFRESH-TAGS"
7170 >filter{refresh-tags}</A
7173 HREF="actions-file.html#FILTER-WEBBUGS"
7177 HREF="actions-file.html#FILTER-IE-EXPLOITS"
7178 >filter{ie-exploits}</A
7181 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
7182 >hide-forwarded-for-headers</A
7185 HREF="actions-file.html#HIDE-FROM-HEADER"
7186 >hide-from-header{block}</A
7189 HREF="actions-file.html#HIDE-REFERER"
7190 >hide-referrer{forge}</A
7193 HREF="actions-file.html#PREVENT-COMPRESSION"
7194 >prevent-compression</A
7197 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7198 >session-cookies-only</A
7201 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7202 >set-image-blocker{pattern}</A
7205 / # forward slash will match *all* potential URL patterns.</PRE
7211 > The default behavior is now set.
7214 > The first of our specialized sections is concerned with <SPAN
7218 sites, i.e. sites that require minimum interference, because they are either
7219 very complex or very keen on tracking you (and have mechanisms in place that
7220 make them unusable for people who avoid being tracked). We will simply use
7224 > alias instead of stating the list
7225 of actions explicitly:</P
7235 >##########################################################################
7236 # Exceptions for sites that'll break under the default action set:
7237 ##########################################################################
7239 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7242 .office.microsoft.com # surprise, surprise!
7243 .windowsupdate.microsoft.com
7244 mail.google.com</PRE
7250 > Shopping sites are not as fragile, but they typically
7251 require cookies to log in, and pop-up windows for shopping
7252 carts or item details. Again, we'll use a pre-defined alias:</P
7266 .worldpay.com # for quietpc.com
7277 HREF="actions-file.html#FAST-REDIRECTS"
7281 action, which we enabled per default above, breaks some sites. So disable
7282 it for popular sites where we know it misbehaves:</P
7293 HREF="actions-file.html#FAST-REDIRECTS"
7299 .altavista.com/.*(like|url|link):http
7300 .altavista.com/trans.*urltext=http
7307 > It is important that <SPAN
7311 URLs belong to images, so that <SPAN
7318 be blocked, a substitute image can be sent, rather than an HTML page.
7319 Contacting the remote site to find out is not an option, since it
7320 would destroy the loading time advantage of banner blocking, and it
7321 would feed the advertisers (in terms of money <SPAN
7328 information). We can mark any URL as an image with the <TT
7331 HREF="actions-file.html#HANDLE-AS-IMAGE"
7335 and marking all URLs that end in a known image file extension is a
7346 >##########################################################################
7348 ##########################################################################
7350 # Define which file types will be treated as images, in case they get
7351 # blocked further down this file:
7354 HREF="actions-file.html#HANDLE-AS-IMAGE"
7357 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7363 > And then there are known banner sources. They often use scripts to
7364 generate the banners, so it won't be visible from the URL that the
7365 request is for an image. Hence we block them <SPAN
7372 mark them as images in one go, with the help of our
7375 >+block-as-image</TT
7376 > alias defined above. (We could of
7377 course just as well use <TT
7380 HREF="actions-file.html#BLOCK"
7384 HREF="actions-file.html#HANDLE-AS-IMAGE"
7388 Remember that the type of the replacement image is chosen by the
7392 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7393 >set-image-blocker</A
7396 action. Since all URLs have matched the default section with its
7400 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7401 >set-image-blocker</A
7404 action before, it still applies and needn't be repeated:</P
7414 ># Known ad generators:
7419 .ad.*.doubleclick.net
7420 .a.yimg.com/(?:(?!/i/).)*$
7421 .a[0-9].yimg.com/(?:(?!/i/).)*$
7429 > One of the most important jobs of <SPAN
7433 is to block banners. Many of these can be <SPAN
7440 HREF="actions-file.html#FILTER"
7442 >{banners-by-size}</TT
7444 action, which we enabled above, and which deletes the references to banner
7445 images from the pages while they are loaded, so the browser doesn't request
7446 them anymore, and hence they don't need to be blocked here. But this naturally
7447 doesn't catch all banners, and some people choose not to use filters, so we
7448 need a comprehensive list of patterns for banner URLs here, and apply the
7452 HREF="actions-file.html#BLOCK"
7455 > action to them.</P
7457 > First comes many generic patterns, which do most of the work, by
7458 matching typical domain and path name components of banners. Then comes
7459 a list of individual patterns for specific sites, which is omitted here
7460 to keep the example short:</P
7470 >##########################################################################
7471 # Block these fine banners:
7472 ##########################################################################
7474 HREF="actions-file.html#BLOCK"
7475 >+block{Banner ads.}</A
7484 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7485 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7487 # Site-specific patterns (abbreviated):
7495 > It's quite remarkable how many advertisers actually call their banner
7501 >.com, or call the directory
7502 in which the banners are stored simply <SPAN
7506 generic patterns are surprisingly effective.</P
7508 > But being very generic, they necessarily also catch URLs that we don't want
7509 to block. The pattern <TT
7521 >.nasty-corp.com"</SPAN
7531 >.sourcefroge.net"</SPAN
7541 >l.some-provider.net."</SPAN
7543 well-known exceptions to the <TT
7546 HREF="actions-file.html#BLOCK"
7552 > Note that these are exceptions to exceptions from the default! Consider the URL
7555 >"downloads.sourcefroge.net"</SPAN
7556 >: Initially, all actions are deactivated,
7557 so it wouldn't get blocked. Then comes the defaults section, which matches the
7558 URL, but just deactivates the <TT
7561 HREF="actions-file.html#BLOCK"
7565 action once again. Then it matches <TT
7568 >, an exception to the
7569 general non-blocking policy, and suddenly
7573 HREF="actions-file.html#BLOCK"
7576 > applies. And now, it'll match
7583 HREF="actions-file.html#BLOCK"
7587 applies, so (unless it matches <SPAN
7593 > further down) it ends up
7597 HREF="actions-file.html#BLOCK"
7600 > action applying.</P
7610 >##########################################################################
7611 # Save some innocent victims of the above generic block patterns:
7612 ##########################################################################
7617 HREF="actions-file.html#BLOCK"
7620 adv[io]*. # (for advogato.org and advice.*)
7621 adsl. # (has nothing to do with ads)
7622 adobe. # (has nothing to do with ads either)
7623 ad[ud]*. # (adult.* and add.*)
7624 .edu # (universities don't host banners (yet!))
7625 .*loads. # (downloads, uploads etc)
7633 www.globalintersec.com/adv # (adv = advanced)
7634 www.ugu.com/sui/ugu/adv</PRE
7640 > Filtering source code can have nasty side effects,
7641 so make an exception for our friends at sourceforge.net,
7642 and all paths with <SPAN
7645 > in them. Note that
7649 HREF="actions-file.html#FILTER"
7659 > filters in one fell swoop!</P
7669 ># Don't filter code!
7672 HREF="actions-file.html#FILTER"
7679 .sourceforge.net</PRE
7688 > is of course much more
7689 comprehensive, but we hope this example made clear how it works.</P
7697 >8.7.2. user.action</A
7700 > So far we are painting with a broad brush by setting general policies,
7701 which would be a reasonable starting point for many people. Now,
7702 you might want to be more specific and have customized rules that
7703 are more suitable to your personal habits and preferences. These would
7704 be for narrowly defined situations like your ISP or your bank, and should
7708 >, which is parsed after all other
7709 actions files and hence has the last word, over-riding any previously
7710 defined actions. <TT
7720 > place for your personal settings, since
7724 > is actively maintained by the
7728 > developers and you'll probably want
7729 to install updated versions from time to time.</P
7731 > So let's look at a few examples of things that one might typically do in
7745 ># My user.action file. <fred@example.com></PRE
7752 HREF="actions-file.html#ALIASES"
7754 > are local to the actions
7755 file that they are defined in, you can't use the ones from
7759 >, unless you repeat them here:</P
7769 ># Aliases are local to the file they are defined in.
7770 # (Re-)define aliases for this file:
7774 # These aliases just save typing later, and the alias names should
7775 # be self explanatory.
7777 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7778 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7779 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7780 allow-popups = -filter{all-popups}
7781 +block-as-image = +block{Blocked as image.} +handle-as-image
7782 -block-as-image = -block
7784 # These aliases define combinations of actions that are useful for
7785 # certain types of sites:
7787 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer
7788 shop = -crunch-all-cookies allow-popups
7790 # Allow ads for selected useful free sites:
7792 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
7794 # Alias for specific file types that are text, but might have conflicting
7795 # MIME types. We want the browser to force these to be text documents.
7796 handle-as-text = -<A
7797 HREF="actions-file.html#FILTER"
7800 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
7801 >content-type-overwrite{text/plain}</A
7803 HREF="actions-file.html#FORCE-TEXT-MODE"
7806 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7807 >hide-content-disposition</A
7814 > Say you have accounts on some sites that you visit regularly, and
7815 you don't want to have to log in manually each time. So you'd like
7816 to allow persistent cookies for these sites. The
7819 >allow-all-cookies</TT
7820 > alias defined above does exactly
7821 that, i.e. it disables crunching of cookies in any direction, and the
7822 processing of cookies to make them only temporary.</P
7832 >{ allow-all-cookies }
7842 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7853 HREF="actions-file.html#FILTER"
7856 .your-home-banking-site.com</PRE
7862 > Some file types you may not want to filter for various reasons:</P
7872 ># Technical documentation is likely to contain strings that might
7873 # erroneously get altered by the JavaScript-oriented filters:
7878 # And this stupid host sends streaming video with a wrong MIME type,
7879 # so that Privoxy thinks it is getting HTML and starts filtering:
7881 stupid-server.example.com/</PRE
7887 > Example of a simple <A
7888 HREF="actions-file.html#BLOCK"
7890 > action. Say you've
7891 seen an ad on your favourite page on example.com that you want to get rid of.
7892 You have right-clicked the image, selected <SPAN
7894 >"copy image location"</SPAN
7896 and pasted the URL below while removing the leading http://, into a
7900 > section. Note that <TT
7904 > need not be specified, since all URLs ending in
7908 > will be tagged as images by the general rules as set
7909 in default.action anyway:</P
7920 HREF="actions-file.html#BLOCK"
7923 www.example.com/nasty-ads/sponsor\.gif
7924 another.example.net/more/junk/here/</PRE
7930 > The URLs of dynamically generated banners, especially from large banner
7931 farms, often don't use the well-known image file name extensions, which
7932 makes it impossible for <SPAN
7936 the file type just by looking at the URL.
7939 >+block-as-image</TT
7940 > alias defined above for
7942 Note that objects which match this rule but then turn out NOT to be an
7943 image are typically rendered as a <SPAN
7945 >"broken image"</SPAN
7947 browser. Use cautiously.</P
7957 >{ +block-as-image }
7967 > Now you noticed that the default configuration breaks Forbes Magazine,
7968 but you were too lazy to find out which action is the culprit, and you
7969 were again too lazy to give <A
7973 you just used the <TT
7976 > alias on the site, and
7983 > -- it worked. The <TT
7987 aliases disables those actions that are most likely to break a site. Also,
7988 good for testing purposes to see if it is <SPAN
7992 that is causing the problem or not. We later find other regular sites
7993 that misbehave, and add those to our personalized list of troublemakers:</P
8012 > You like the <SPAN
8015 > text replacements in <TT
8019 but it is disabled in the distributed actions file.
8020 So you'd like to turn it on in your private,
8021 update-safe config, once and for all:</P
8032 HREF="actions-file.html#FILTER-FUN"
8035 / # For ALL sites!</PRE
8041 > Note that the above is not really a good idea: There are exceptions
8042 to the filters in <TT
8046 really shouldn't be filtered, like code on CVS->Web interfaces. Since
8050 > has the last word, these exceptions
8051 won't be valid for the <SPAN
8054 > filtering specified here.</P
8056 > You might also worry about how your favourite free websites are
8057 funded, and find that they rely on displaying banner advertisements
8058 to survive. So you might want to specifically allow banners for those
8059 sites that you feel provide value to you:</P
8081 > has been aliased to
8085 HREF="actions-file.html#BLOCK"
8092 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
8093 >filter{banners-by-size}</A
8099 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
8100 >filter{banners-by-link}</A
8104 > Invoke another alias here to force an over-ride of the MIME type <TT
8106 > application/x-sh</TT
8107 > which typically would open a download type
8108 dialog. In my case, I want to look at the shell script, and then I can save
8109 it should I choose to.</P
8129 > is generally the best place to define
8130 exceptions and additions to the default policies of
8134 >. Some actions are safe to have their
8135 default policies set here though. So let's set a default policy to have a
8139 > image as opposed to the checkerboard pattern for
8149 > of course matches all URL
8150 paths and patterns:</P
8161 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8162 >set-image-blocker{blank}</A
8177 SUMMARY="Footer navigation table"
8206 HREF="filter-file.html"
8216 >The Main Configuration File</TD