7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="Privoxy 3.0.4 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"></HEAD
31 SUMMARY="Header navigation table"
40 >Privoxy 3.0.4 User Manual</TH
62 HREF="filter-file.html"
80 > The actions files are used to define what <SPAN
90 > takes for which URLs, and thus determines
91 how ad images, cookies and various other aspects of HTTP content and
92 transactions are handled, and on which sites (or even parts thereof).
93 There are a number of such actions, with a wide range of functionality.
94 Each action does something a little different.
95 These actions give us a veritable arsenal of tools with which to exert
96 our control, preferences and independence.</P
99 are three action files included with <SPAN
114 > - is the primary action file
115 that sets the initial values for all actions. It is intended to
116 provide a base level of functionality for
120 > array of features. So it is
121 a set of broad rules that should work reasonably well for users everywhere.
122 This is the file that the developers are keeping updated, and <A
123 HREF="installation.html#INSTALLATION-KEEPUPDATED"
124 >making available to users</A
133 > - is intended to be for local site
134 preferences and exceptions. As an example, if your ISP or your bank
135 has specific requirements, and need special handling, this kind of
136 thing should go here. This file will not be upgraded.
144 > - is used by the web based editor,
145 to set various pre-defined sets of rules for the default actions section
149 >. These have increasing levels of
154 >and have no influence on your browsing unless
155 you select them explicitly in the editor</I
157 >. It is not recommend
161 > The default profiles, and their associated actions, as pre-defined in
175 >Table 1. Default Configurations</B
210 >Ad-blocking by URL</TD
232 >Ad-filtering by size</TD
254 >GIF de-animation</TD
386 >JavaScript taming</TD
430 >Fun text replacements</TD
452 >Image tag reordering</TD
474 >Ad-filtering by link</TD
523 > The list of actions files to be used are defined in the main configuration
524 file, and are processed in the order they are defined (e.g.
528 > is typically process before
532 >). The content of these can all be viewed and
534 HREF="http://config.privoxy.org/show-status"
536 >http://config.privoxy.org/show-status</A
539 > An actions file typically has multiple sections. If you want to use
543 > in an actions file, you have to place the (optional)
545 HREF="actions-file.html#ALIASES"
547 > at the top of that file.
548 Then comes the default set of rules which will apply universally to all
549 sites and pages (be <SPAN
559 > or any other actions file after
563 >, because it will override the result
564 from consulting any previous file). And then below that,
565 exceptions to the defined universal policies. You can regard
569 > as an appendix to <TT
573 with the advantage that is a separate file, which makes preserving your
574 personal settings across <SPAN
577 > upgrades easier.</P
580 Actions can be used to block anything you want, including ads, banners, or
581 just some obnoxious URL that you would rather not see. Cookies can be accepted
582 or rejected, or accepted only during the current browser session (i.e. not
583 written to disk), content can be modified, JavaScripts tamed, user-tracking
584 fooled, and much more. See below for a <A
585 HREF="actions-file.html#ACTIONS"
596 >8.1. Finding the Right Mix</H2
599 HREF="actions-file.html#ACTIONS"
601 >, like cookie suppression
602 or script disabling, may render some sites unusable that rely on these
603 techniques to work properly. Finding the right mix of actions is not always easy and
604 certainly a matter of personal taste. In general, it can be said that the more
608 > your default settings (in the top section of the
609 actions file) are, the more exceptions for <SPAN
613 will have to make later. If, for example, you want to crunch all cookies per
614 default, you'll have to make exceptions from that rule for sites that you
615 regularly use and that require cookies for actually useful puposes, like maybe
616 your bank, favorite shop, or newspaper. </P
618 > We have tried to provide you with reasonable rules to start from in the
619 distribution actions files. But there is no general rule of thumb on these
620 things. There just are too many variables, and sites are constantly changing.
621 Sooner or later you will want to change the rules (and read this chapter again :).</P
630 >8.2. How to Edit</H2
632 > The easiest way to edit the actions files is with a browser by
633 using our browser-based editor, which can be reached from <A
634 HREF="http://config.privoxy.org/show-status"
636 >http://config.privoxy.org/show-status</A
638 The editor allows both fine-grained control over every single feature on a
639 per-URL basis, and easy choosing from wholesale sets of defaults like
648 >"Adventuresome"</SPAN
652 >"Adventuresome"</SPAN
653 > setting is not only more aggressive,
654 but includes settings that are fun and subversive, and which some may find of
657 > If you prefer plain text editing to GUIs, you can of course also directly edit the
658 the actions files. Look at <TT
671 >8.3. How Actions are Applied to URLs</H2
673 > Actions files are divided into sections. There are special sections,
677 HREF="actions-file.html#ALIASES"
680 > sections which will
681 be discussed later. For now let's concentrate on regular sections: They have a
682 heading line (often split up to multiple lines for readability) which consist
683 of a list of actions, separated by whitespace and enclosed in curly braces.
684 Below that, there is a list of URL patterns, each on a separate line.</P
686 > To determine which actions apply to a request, the URL of the request is
687 compared to all patterns in each <SPAN
690 > file. Every time it matches, the list of
691 applicable actions for the URL is incrementally updated, using the heading
692 of the section in which the pattern is located. If multiple matches for
693 the same URL set the same action differently, the last match wins. If not,
694 the effects are aggregated. E.g. a URL might match a regular section with
695 a heading line of <TT
699 HREF="actions-file.html#HANDLE-AS-IMAGE"
703 then later another one with just <TT
707 HREF="actions-file.html#BLOCK"
717 > actions to apply.</P
719 > You can trace this process for any given URL by visiting <A
720 HREF="http://config.privoxy.org/show-url-info"
722 >http://config.privoxy.org/show-url-info</A
725 > More detail on this is provided in the Appendix, <A
726 HREF="appendix.html#ACTIONSANAT"
727 > Anatomy of an Action</A
747 to determine what actions might apply to which sites and pages your browser
748 attempts to access. These <SPAN
758 > matching to achieve a high degree of
759 flexibility. This allows one expression to be expanded and potentially match
760 against many similar patterns.</P
765 > pattern has the form
768 ><domain>/<path></TT
772 ><domain></TT
777 optional. (This is why the special <TT
780 > pattern matches all
781 URLs). Note that the protocol portion of the URL pattern (e.g.
792 the pattern. This is assumed already!</P
801 >www.example.com/</TT
805 > is a domain-only pattern and will match any request to <TT
809 regardless of which document on that server is requested.
819 > means exactly the same. For domain-only patterns, the trailing <TT
829 >www.example.com/index.html</TT
833 > matches only the single document <TT
850 > matches the document <TT
853 >, regardless of the domain,
870 > matches nothing, since it would be interpreted as a domain name and
871 there is no top-level domain called <TT
886 >8.4.1. The Domain Pattern</H3
888 > The matching of the domain part offers some flexible options: if the
889 domain starts or ends with a dot, it becomes unanchored at that end.
903 > matches any domain that <SPAN
923 > matches any domain that <SPAN
943 > matches any domain that <SPAN
953 (Correctly speaking: It matches any FQDN that contains <TT
962 > Additionally, there are wild-cards that you can use in the domain names
963 themselves. They work pretty similar to shell wild-cards: <SPAN
967 stands for zero or more arbitrary characters, <SPAN
971 any single character, you can define character classes in square
972 brackets and all of that can be freely mixed:</P
987 >"adserver.example.com"</SPAN
991 >"ads.example.com"</SPAN
994 >"sfads.example.com"</SPAN
1001 >*ad*.example.com</TT
1005 > matches all of the above, and then some.
1021 >pictures.epix.com</TT
1024 >a.b.c.d.e.upix.com</TT
1031 >www[1-9a-ez].example.c*</TT
1037 >www1.example.com</TT
1041 >www4.example.cc</TT
1044 >wwwd.example.cy</TT
1048 >wwwz.example.com</TT
1058 >wwww.example.com</TT
1072 >8.4.2. The Path Pattern</H3
1077 > uses Perl compatible regular expressions
1079 HREF="http://www.pcre.org/"
1083 matching the path.</P
1086 HREF="appendix.html#REGEX"
1088 > with a brief quick-start into regular
1089 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
1091 HREF="http://www.pcre.org/man.txt"
1093 >http://www.pcre.org/man.txt</A
1095 You might also find the Perl man page on regular expressions (<TT
1099 useful, which is available on-line at <A
1100 HREF="http://www.perldoc.com/perl5.6/pod/perlre.html"
1102 >http://www.perldoc.com/perl5.6/pod/perlre.html</A
1105 > Note that the path pattern is automatically left-anchored at the <SPAN
1109 i.e. it matches as if it would start with a <SPAN
1112 > (regular expression speak
1113 for the beginning of a line).</P
1115 > Please also note that matching in the path is <SPAN
1119 >CASE INSENSITIVE</I
1122 by default, but you can switch to case sensitive at any point in the pattern by using the
1128 >www.example.com/(?-i)PaTtErN.*</TT
1130 only documents whose path starts with <TT
1140 > this capitalization.</P
1152 > All actions are disabled by default, until they are explicitly enabled
1153 somewhere in an actions file. Actions are turned on if preceded with a
1157 >, and turned off if preceded with a <SPAN
1166 >"do that action"</SPAN
1173 >"please block URLs that match the
1174 following patterns"</SPAN
1181 block URLs that match the following patterns, even if <TT
1185 previously applied."</SPAN
1189 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1190 separated by whitespace, like in
1193 >{+some-action -some-other-action{some-parameter}}</TT
1195 followed by a list of URL patterns, one per line, to which they apply.
1196 Together, the actions line and the following pattern lines make up a section
1197 of the actions file. </P
1200 There are three classes of actions:</P
1208 Boolean, i.e the action can only be <SPAN
1231 > # enable action <TT
1242 > # disable action <TT
1264 Parameterized, where some value is required in order to enable this type of action.
1286 >} # enable action and set parameter to <TT
1292 # overwriting parameter from previous match if necessary
1298 > # disable action. The parameter can be omitted</PRE
1305 > Note that if the URL matches multiple positive forms of a parameterized action,
1306 the last match wins, i.e. the params from earlier matches are simply ignored.
1312 >+hide-user-agent{ Mozilla 1.0 }</TT
1319 Multi-value. These look exactly like parameterized actions,
1320 but they behave differently: If the action applies multiple times to the
1321 same URL, but with different parameters, <SPAN
1334 > matches are remembered. This is used for actions
1335 that can be executed for the same request repeatedly, like adding multiple
1336 headers, or filtering through multiple filters. Syntax:
1357 >} # enable action and add <TT
1362 > to the list of parameters
1373 >} # remove the parameter <TT
1378 > from the list of parameters
1379 # If it was the last one left, disable the action.
1385 > # disable this action completely and remove all parameters from the list</PRE
1395 >+add-header{X-Fun-Header: Some text}</TT
1399 >+filter{html-annoyances}</TT
1406 > If nothing is specified in any actions file, no <SPAN
1410 taken. So in this case <SPAN
1414 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
1415 privacy and blocking features you need (although the provided default actions
1416 files will give a good starting point).</P
1418 > Later defined actions always over-ride earlier ones. So exceptions
1419 to any rules you make, should come in the latter part of the file (or
1420 in a file that is processed later when using multiple actions files). For
1421 multi-valued actions, the actions are applied in the order they are specified.
1422 Actions files are processed in the order they are defined in
1426 > (the default installation has three actions
1427 files). It also quite possible for any given URL pattern to match more than
1428 one pattern and thus more than one set of actions!</P
1430 > The list of valid <SPAN
1441 >8.5.1. add-header</H4
1445 CLASS="VARIABLELIST"
1451 >Confuse log analysis, custom applications</P
1457 > Sends a user defined HTTP header to the web server.
1470 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1471 It is recommended that you use the <SPAN
1485 > This action may be specified multiple times, in order to define multiple
1486 headers. This is rarely needed for the typical user. If you don't know what
1489 >"HTTP headers"</SPAN
1490 > are, you definitely don't need to worry about this
1506 >+add-header{X-User-Tracking: sucks}</PRE
1527 CLASS="VARIABLELIST"
1533 >Block ads or other obnoxious content</P
1539 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1540 forwarded to the remote server, but answered locally with a substitute page or image,
1541 as determined by the <TT
1544 HREF="actions-file.html#HANDLE-AS-IMAGE"
1551 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1552 >set-image-blocker</A
1576 > sends a special <SPAN
1580 for requests to blocked pages. This page contains links to find out why the request
1581 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1582 force feature enabled). The <SPAN
1585 > page adapts to the available
1586 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1587 if loaded into a small frame or window. If you are using <SPAN
1591 right now, you can take a look at the
1593 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1604 A very important exception occurs if <SPAN
1617 HREF="actions-file.html#HANDLE-AS-IMAGE"
1621 apply to the same request: it will then be replaced by an image. If
1625 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1626 >set-image-blocker</A
1629 (see below) also applies, the type of image will be determined by its parameter,
1630 if not, the standard checkerboard pattern is sent.
1633 > It is important to understand this process, in order
1634 to understand how <SPAN
1638 ads and other unwanted content.
1644 HREF="actions-file.html#FILTER"
1648 action can perform a very similar task, by <SPAN
1652 banner images and other content through rewriting the relevant URLs in the
1653 document's HTML source, so they don't get requested in the first place.
1654 Note that this is a totally different technique, and it's easy to confuse the two.
1658 >Example usage (section):</DT
1669 >{+block} # Block and replace with "blocked" page
1670 .nasty-stuff.example.com
1672 {+block +handle-as-image} # Block and replace with image
1689 NAME="CONTENT-TYPE-OVERWRITE"
1691 >8.5.3. content-type-overwrite</H4
1695 CLASS="VARIABLELIST"
1701 >Stop useless download menus from popping up, or change the browser's rendering mode</P
1707 > Replaces the <SPAN
1709 >"Content-Type:"</SPAN
1710 > HTTP server header.
1732 >"Content-Type:"</SPAN
1733 > HTTP server header is used by the
1734 browser to decide what to do with the document. The value of this
1735 header can cause the browser to open a download menu instead of
1736 displaying the document by itself, even if the document's format is
1737 supported by the browser.
1740 > The declared content type can also affect which rendering mode
1741 the browser chooses. If XHTML is delivered as <SPAN
1745 many browsers treat it as yet another broken HTML document.
1746 If it is send as <SPAN
1748 >"application/xml"</SPAN
1750 XHTML support will only display it, if the syntax is correct.
1753 > If you see a web site that proudly uses XHTML buttons, but sets
1756 >"Content-Type: text/html"</SPAN
1757 >, you can use Privoxy
1758 to overwrite it with <SPAN
1760 >"application/xml"</SPAN
1762 the web master's claim inside your XHTML-supporting browser.
1763 If the syntax is incorrect, the browser will complain loudly.
1766 > You can also go the opposite direction: if your browser prints
1767 error messages instead of rendering a document falsely declared
1768 as XHTML, you can overwrite the content type with
1772 > and have it rendered as broken HTML document.
1777 >content-type-overwrite</TT
1781 >"Content-Type:"</SPAN
1782 > headers that look like some kind of text.
1783 If you want to overwrite it unconditionally, you have to combine it with
1787 HREF="actions-file.html#FORCE-TEXT-MODE"
1791 This limitation exists for a reason, think twice before circumventing it.
1794 > Most of the time it's easier to enable
1798 HREF="actions-file.html#FILTER-SERVER-HEADERS"
1799 >filter-server-headers</A
1802 and replace this action with a custom regular expression. It allows you
1803 to activate it for every document of a certain site and it will still
1804 only replace the content types you aimed at.
1807 > Of course you can apply <TT
1809 >content-type-overwrite</TT
1811 to a whole site and then make URL based exceptions, but it's a lot
1812 more work to get the same precision.
1816 >Example usage (sections):</DT
1827 ># Check if www.example.net/ really uses valid XHTML
1828 {+content-type-overwrite {application/xml}}
1830 # but leave the content type unmodified if the URL looks like a style sheet
1831 {-content-type-overwrite}
1832 www.example.net/*.\.css$
1833 www.example.net/*.style</PRE
1848 NAME="CRUNCH-CLIENT-HEADER"
1850 >8.5.4. crunch-client-header</H4
1854 CLASS="VARIABLELIST"
1860 >Remove a client header <SPAN
1863 > has no dedicated action for.</P
1869 > Deletes every header sent by the client that contains the string the user supplied as parameter.
1889 > This action allows you to block client headers for which no dedicated
1897 > will remove every client header that
1898 contains the string you supplied as parameter.
1901 > Regular expressions are <SPAN
1908 use this action to block different headers in the same request, unless
1909 they contain the same string.
1914 >crunch-client-header</TT
1915 > is only meant for quick tests.
1916 If you have to block several different headers, or only want to modify
1917 parts of them, you should enable
1921 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
1922 >filter-client-headers</A
1925 and create your own filter.
1946 > Don't block any header without understanding the consequences.
1954 >Example usage (section):</DT
1965 ># Block the non-existent "Privacy-Violation:" client header
1966 {+crunch-client-header {Privacy-Violation:}}
1983 NAME="CRUNCH-IF-NONE-MATCH"
1985 >8.5.5. crunch-if-none-match</H4
1989 CLASS="VARIABLELIST"
1995 >Prevent yet another way to track the user's steps between sessions.</P
2003 >"If-None-Match:"</SPAN
2004 > HTTP client header.
2024 > Removing the <SPAN
2026 >"If-None-Match:"</SPAN
2027 > HTTP client header
2028 is useful for filter testing, where you want to force a real
2029 reload instead of getting status code <SPAN
2033 would cause the browser to use a cached copy of the page.
2036 > It is also useful to make sure the header isn't used as a cookie
2040 > Blocking the <SPAN
2042 >"If-None-Match:"</SPAN
2043 > header shouldn't cause any
2044 caching problems, as long as the <SPAN
2046 >"If-Modified-Since:"</SPAN
2048 isn't blocked as well.
2051 > It is recommended to use this action together with
2055 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2056 >hide-if-modified-since</A
2063 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2064 >overwrite-last-modified</A
2070 >Example usage (section):</DT
2081 ># Let the browser revalidate cached documents without being tracked across sessions
2082 {+hide-if-modified-since {-1} \
2083 +overwrite-last-modified {randomize} \
2084 +crunch-if-none-match}
2100 NAME="CRUNCH-INCOMING-COOKIES"
2102 >8.5.6. crunch-incoming-cookies</H4
2106 CLASS="VARIABLELIST"
2112 > Prevent the web server from setting any cookies on your system
2121 >"Set-Cookie:"</SPAN
2122 > HTTP headers from server replies.
2142 > This action is only concerned with <SPAN
2159 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2160 >crunch-outgoing-cookies</A
2169 > to disable cookies completely.
2178 > to use this action in conjunction
2182 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2183 >session-cookies-only</A
2186 since it would prevent the session cookies from being set. See also
2190 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2191 >filter-content-cookies</A
2208 >+crunch-incoming-cookies</PRE
2223 NAME="CRUNCH-SERVER-HEADER"
2225 >8.5.7. crunch-server-header</H4
2229 CLASS="VARIABLELIST"
2235 >Remove a server header <SPAN
2238 > has no dedicated action for.</P
2244 > Deletes every header sent by the server that contains the string the user supplied as parameter.
2264 > This action allows you to block server headers for which no dedicated
2268 > action exists. <SPAN
2272 will remove every server header that contains the string you supplied as parameter.
2275 > Regular expressions are <SPAN
2282 use this action to block different headers in the same request, unless
2283 they contain the same string.
2288 >crunch-server-header</TT
2289 > is only meant for quick tests.
2290 If you have to block several different headers, or only want to modify
2291 parts of them, you should enable
2295 HREF="actions-file.html#FILTER-SERVER-HEADERS"
2296 >filter-server-headers</A
2299 and create your own filter.
2320 > Don't block any header without understanding the consequences.
2328 >Example usage (section):</DT
2339 ># Crunch server headers that try to prevent caching
2340 {+crunch-server-header {no-cache}}
2356 NAME="CRUNCH-OUTGOING-COOKIES"
2358 >8.5.8. crunch-outgoing-cookies</H4
2362 CLASS="VARIABLELIST"
2368 > Prevent the web server from reading any cookies from your system
2378 > HTTP headers from client requests.
2398 > This action is only concerned with <SPAN
2415 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
2416 >crunch-incoming-cookies</A
2425 > to disable cookies completely.
2434 > to use this action in conjunction
2438 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2439 >session-cookies-only</A
2442 since it would prevent the session cookies from being read.
2457 >+crunch-outgoing-cookies</PRE
2472 NAME="DEANIMATE-GIFS"
2474 >8.5.9. deanimate-gifs</H4
2478 CLASS="VARIABLELIST"
2484 >Stop those annoying, distracting animated GIF images.</P
2490 > De-animate GIF animations, i.e. reduce them to their first or last image.
2516 > This will also shrink the images considerably (in bytes, not pixels!). If
2520 > is given, the first frame of the animation
2521 is used as the replacement. If <SPAN
2524 > is given, the last
2525 frame of the animation is used instead, which probably makes more sense for
2526 most banner animations, but also has the risk of not showing the entire
2527 last frame (if it is only a delta to an earlier frame).
2530 > You can safely use this action with patterns that will also match non-GIF
2531 objects, because no attempt will be made at anything that doesn't look like
2547 >+deanimate-gifs{last}</PRE
2562 NAME="DOWNGRADE-HTTP-VERSION"
2564 >8.5.10. downgrade-http-version</H4
2568 CLASS="VARIABLELIST"
2574 >Work around (very rare) problems with HTTP/1.1</P
2580 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
2600 > This is a left-over from the time when <SPAN
2604 didn't support important HTTP/1.1 features well. It is left here for the
2605 unlikely case that you experience HTTP/1.1 related problems with some server
2606 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
2607 is a chance you might need this action.
2611 >Example usage (section):</DT
2622 >{+downgrade-http-version}
2623 problem-host.example.com</PRE
2638 NAME="FAST-REDIRECTS"
2640 >8.5.11. fast-redirects</H4
2644 CLASS="VARIABLELIST"
2650 >Fool some click-tracking scripts and speed up indirect links.</P
2656 > Detects redirection URLs and redirects the browser without contacting
2657 the redirection server first.
2676 >"simple-check"</SPAN
2677 > to just search for the string <SPAN
2681 to detect redirection URLs.
2688 >"check-decoded-url"</SPAN
2689 > to decode URLs (if necessary) before searching
2690 for redirection URLs.
2700 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2701 will link to some script on their own servers, giving the destination as a
2702 parameter, which will then redirect you to the final target. URLs
2703 resulting from this scheme typically look like:
2706 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
2710 > Sometimes, there are even multiple consecutive redirects encoded in the
2711 URL. These redirections via scripts make your web browsing more traceable,
2712 since the server from which you follow such a link can see where you go
2713 to. Apart from that, valuable bandwidth and time is wasted, while your
2714 browser asks the server for one redirect after the other. Plus, it feeds
2718 > This feature is currently not very smart and is scheduled for improvement.
2719 If it is enabled by default, you will have to create some exceptions to
2720 this action. It can lead to failures in several ways:
2723 > Not every URLs with other URLs as parameters is evil.
2724 Some sites offer a real service that requires this information to work.
2725 For example a validation service needs to know, which document to validate.
2729 > assumes that every URL parameter that
2730 looks like another URL is a redirection target, and will always redirect to
2731 the last one. Most of the time the assumption is correct, but if it isn't,
2732 the user gets redirected anyway.
2735 > Another failure occurs if the URL contains other parameters after the URL parameter.
2739 >"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</SPAN
2741 contains the redirection URL <SPAN
2743 >"http://www.example.net/"</SPAN
2745 followed by another parameter. <TT
2749 and will cause a redirect to <SPAN
2751 >"http://www.example.net/&foo=bar"</SPAN
2753 Depending on the target server configuration, the parameter will be silently ignored
2756 >"page not found"</SPAN
2757 > error. It is possible to fix these redirected
2761 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
2762 >filter-client-headers</A
2765 but it requires a little effort.
2768 > To detect a redirection URL, <TT
2772 looks for the string <SPAN
2775 >, either in plain text
2776 (invalid but often used) or encoded as <SPAN
2780 Some sites use their own URL encoding scheme, encrypt the address
2781 of the target server or replace it with a database id. In theses cases
2785 > is fooled and the request reaches the
2786 redirection server where it probably gets logged.
2801 >+fast-redirects{simple-check}</PRE
2816 >+fast-redirects{check-decoded-url}</PRE
2837 CLASS="VARIABLELIST"
2843 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
2849 > All files of text-based type, most notably HTML and JavaScript, to which this
2850 action applies, are filtered on-the-fly through the specified regular expression
2851 based substitutions. (Note: as of version 3.0.3 plain text documents
2852 are exempted from filtering, because web servers often use the
2856 > MIME type for all files whose type they
2857 don't know.) By default, filtering works only on the document content
2858 itself, not the headers.
2871 > The name of a filter, as defined in the <A
2872 HREF="filter-file.html"
2875 Filters can be defined in one or more files as defined by the
2879 HREF="config.html#FILTERFILE"
2890 > is the collection of filters
2891 supplied by the developers. Locally defined filters should go
2892 in their own file, such as <TT
2898 > When used in its negative form,
2899 and without parameters, filtering is completely disabled.
2906 > For your convenience, there are a number of pre-defined filters available
2907 in the distribution filter file that you can use. See the examples below for
2911 > Filtering requires buffering the page content, which may appear to
2912 slow down page rendering since nothing is displayed until all content has
2913 passed the filters. (It does not really take longer, but seems that way
2914 since the page is not incrementally displayed.) This effect will be more
2915 noticeable on slower connections.
2918 > This is very powerful feature, and <SPAN
2920 >"rolling your own"</SPAN
2922 filters requires a knowledge of regular expressions and HTML.
2925 > The amount of data that can be filtered is limited to the
2929 HREF="config.html#BUFFER-LIMIT"
2933 option in the main <A
2937 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2938 data, and all pending data, is passed through unfiltered.
2941 > Inadequate MIME types, such as zipped files, are not filtered at all.
2942 (Again, only text-based types except plain text). Encrypted SSL data
2943 (from HTTPS servers) cannot be filtered either, since this would violate
2944 the integrity of the secure transaction. In some situations it might
2945 be necessary to protect certain text, like source code, from filtering
2946 by defining appropriate <TT
2952 > At this time, <SPAN
2955 > cannot (yet!) uncompress compressed
2956 documents. If you want filtering to work on all documents, even those that
2957 would normally be sent compressed, use the
2961 HREF="actions-file.html#PREVENT-COMPRESSION"
2962 >prevent-compression</A
2965 action in conjunction with <TT
2971 > Filtering can achieve some of the same effects as the
2975 HREF="actions-file.html#BLOCK"
2979 action, i.e. it can be used to block ads and banners. But the mechanism
2980 works quite differently. One effective use, is to block ad banners
2981 based on their size (see below), since many of these seem to be somewhat
2988 > with suggestions for new or
2989 improved filters is particularly welcome!
2992 > The below list has only the names and a one-line description of each
2993 predefined filter. There are <A
2994 HREF="filter-file.html#PREDEFINED-FILTERS"
2996 verbose explanations</A
2997 > of what these filters do in the <A
2998 HREF="filter-file.html"
2999 >filter file chapter</A
3004 >Example usage (with filters from the distribution <TT
3009 HREF="filter-file.html#PREDEFINED-FILTERS"
3010 >the Predefined Filters section</A
3012 more explanation on each:</DT
3016 NAME="FILTER-JS-ANNOYANCES"
3027 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
3035 NAME="FILTER-JS-EVENTS"
3046 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
3054 NAME="FILTER-HTML-ANNOYANCES"
3065 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
3073 NAME="FILTER-CONTENT-COOKIES"
3084 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
3092 NAME="FILTER-REFRESH-TAGS"
3103 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
3111 NAME="FILTER-UNSOLICITED-POPUPS"
3122 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
3130 NAME="FILTER-ALL-POPUPS"
3141 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
3149 NAME="FILTER-IMG-REORDER"
3160 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
3168 NAME="FILTER-BANNERS-BY-SIZE"
3179 >+filter{banners-by-size} # Kill banners by size</PRE
3187 NAME="FILTER-BANNERS-BY-LINK"
3198 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
3206 NAME="FILTER-WEBBUGS"
3217 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
3225 NAME="FILTER-TINY-TEXTFORMS"
3236 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
3244 NAME="FILTER-JUMPING-WINDOWS"
3255 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
3263 NAME="FILTER-FRAMESET-BORDERS"
3274 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
3282 NAME="FILTER-DEMORONIZER"
3293 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
3301 NAME="FILTER-SHOCKWAVE-FLASH"
3312 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
3320 NAME="FILTER-QUICKTIME-KIOSKMODE"
3331 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
3350 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
3358 NAME="FILTER-CRUDE-PARENTAL"
3369 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
3377 NAME="FILTER-IE-EXPLOITS"
3388 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
3403 NAME="FILTER-CLIENT-HEADERS"
3405 >8.5.13. filter-client-headers</H4
3409 CLASS="VARIABLELIST"
3415 > To apply filtering to the client's (browser's) headers
3425 > filters only apply
3426 to the document content itself. This will extend those filters to
3427 include the client's headers as well.
3447 > Regular expressions can be used to filter headers as well. Check your
3448 filters closely before activating this action, as it can easily lead to broken
3453 These filters are applied to each header on its own, not to them
3454 all at once. This makes it easier to diagnose problems, but on the downside
3455 you can't write filters that only change header x if header y's value is
3459 > The filters are used after the other header actions have finished and can
3460 use their output as input.
3463 > Whenever possible one should specify <TT
3470 >, the whole header name and the colon, to make sure
3471 the filter doesn't cause havoc to other headers or the
3472 page itself. For example if you want to transform
3491 >s@Galeon/\d\.\d\.\d @@</PRE
3507 >s@^(User-Agent:.*) Galeon/\d\.\d\.\d (Firefox/\d\.\d\.\d\.\d)$@$1 $2@</PRE
3514 >Example usage (section):</DT
3525 >{+filter-client-headers +filter{test_filter}}
3526 problem-host.example.com
3542 NAME="FILTER-SERVER-HEADERS"
3544 >8.5.14. filter-server-headers</H4
3548 CLASS="VARIABLELIST"
3554 > To apply filtering to the server's headers
3564 > filters only apply
3565 to the document content itself. This will extend those filters to
3566 include the server's headers as well.
3588 >filter-client-headers</TT
3590 the server instead. To filter both server and client, use both.
3595 >filter-client-headers</TT
3597 filters before activating this action, as it can easily lead to broken
3602 These filters are applied to each header on its own, not to them
3603 all at once. This makes it easier to diagnose problems, but on the downside
3604 you can't write filters that only change header x if header y's value is
3608 > The filters are used after the other header actions have finished and can
3609 use their output as input.
3612 > Remember too, whenever possible one should specify <TT
3619 >, the whole header name and the colon, to make sure
3620 the filter doesn't cause havoc to other headers or the
3621 page itself. See above for example.
3625 >Example usage (section):</DT
3636 >{+filter-server-headers +filter{test_filter}}
3637 problem-host.example.com
3653 NAME="FORCE-TEXT-MODE"
3655 >8.5.15. force-text-mode</H4
3659 CLASS="VARIABLELIST"
3668 > to treat a document as if it was in some kind of <SPAN
3680 > Declares a document as text, even if the <SPAN
3682 >"Content-Type:"</SPAN
3683 > isn't detected as such.
3706 HREF="actions-file.html#FILTER"
3713 > tries to only filter files that are
3714 in some kind of text format. The same restrictions apply to
3718 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3719 >content-type-overwrite</A
3724 >force-text-mode</TT
3725 > declares a document as text,
3726 without looking at the <SPAN
3728 >"Content-Type:"</SPAN
3750 > Think twice before activating this action. Filtering binary data
3751 with regular expressions can cause file damage.
3786 NAME="HANDLE-AS-EMPTY-DOCUMENT"
3788 >8.5.16. handle-as-empty-document</H4
3792 CLASS="VARIABLELIST"
3798 >Mark URLs that should be replaced by empty documents <SPAN
3802 >if they get blocked</I
3810 > This action alone doesn't do anything noticeable. It just marks URLs.
3814 HREF="actions-file.html#BLOCK"
3824 the presence or absence of this mark decides whether an HTML <SPAN
3828 page, or an empty document will be sent to the client as a substitute for the blocked content.
3835 > document isn't literally empty, but actually contains a single space.
3855 > Some browsers complain about syntax errors if JavaScript documents
3856 are blocked with <SPAN
3860 default HTML page; this option can be used to silence them.
3863 > The content type for the empty document can be specified with
3867 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3868 >content-type-overwrite{}</A
3871 but usually this isn't necessary.
3886 ># Block all documents on example.org that end with ".js",
3887 # but send an empty document instead of the usual HTML message.
3888 {+block +handle-as-empty-document}
3905 NAME="HANDLE-AS-IMAGE"
3907 >8.5.17. handle-as-image</H4
3911 CLASS="VARIABLELIST"
3917 >Mark URLs as belonging to images (so they'll be replaced by imagee <SPAN
3921 >if they get blocked</I
3929 > This action alone doesn't do anything noticeable. It just marks URLs as images.
3933 HREF="actions-file.html#BLOCK"
3943 the presence or absence of this mark decides whether an HTML <SPAN
3947 page, or a replacement image (as determined by the <TT
3950 HREF="actions-file.html#SET-IMAGE-BLOCKER"
3951 >set-image-blocker</A
3953 > action) will be sent to the
3954 client as a substitute for the blocked content.
3974 > The below generic example section is actually part of <TT
3978 It marks all URLs with well-known image file name extensions as images and should
3982 > Users will probably only want to use the handle-as-image action in conjunction with
3986 HREF="actions-file.html#BLOCK"
3989 >, to block sources of banners, whose URLs don't
3990 reflect the file type, like in the second example section.
3993 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
3994 frames require an HTML page to be sent, or they won't display properly.
3997 >handle-as-image</TT
3998 > in this situation will not replace the
3999 ad frame with an image, but lead to error messages.
4003 >Example usage (sections):</DT
4014 ># Generic image extensions:
4017 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4019 # These don't look like images, but they're banners and should be
4020 # blocked as images:
4022 {+block +handle-as-image}
4023 some.nasty-banner-server.com/junk.cgi?output=trash
4025 # Banner source! Who cares if they also have non-image content?
4026 ad.doubleclick.net </PRE
4041 NAME="HIDE-ACCEPT-LANGUAGE"
4043 >8.5.18. hide-accept-language</H4
4047 CLASS="VARIABLELIST"
4053 >Pretend to use different language settings.</P
4059 > Deletes or replaces the <SPAN
4061 >"Accept-Language:"</SPAN
4062 > HTTP header in client requests.
4078 >, or any user defined value.
4085 > Faking the browser's language settings can be useful to make a
4086 foreign User-Agent set with
4090 HREF="actions-file.html#HIDE-USER-AGENT"
4097 > However some sites with content in different languages check the
4100 >"Accept-Language:"</SPAN
4101 > to decide which one to take by default.
4102 Sometimes it isn't possible to later switch to another language without
4105 >"Accept-Language:"</SPAN
4109 > Therefore it's a good idea to either only change the
4112 >"Accept-Language:"</SPAN
4113 > header to languages you understand,
4114 or to languages that aren't wide spread.
4117 > Before setting the <SPAN
4119 >"Accept-Language:"</SPAN
4121 to a rare language, you should consider that it helps to
4122 make your requests unique and thus easier to trace.
4123 If you don't plan to change this header frequently,
4124 you should stick to a common language.
4128 >Example usage (section):</DT
4139 ># Pretend to use Canadian language settings.
4140 {+hide-accept-language{en-ca} \
4141 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4158 NAME="HIDE-CONTENT-DISPOSITION"
4160 >8.5.19. hide-content-disposition</H4
4164 CLASS="VARIABLELIST"
4170 >Prevent download menus for content you prefer to view inside the browser.</P
4176 > Deletes or replaces the <SPAN
4178 >"Content-Disposition:"</SPAN
4179 > HTTP header set by some servers.
4195 >, or any user defined value.
4202 > Some servers set the <SPAN
4204 >"Content-Disposition:"</SPAN
4206 documents they assume you want to save locally before viewing them.
4209 >"Content-Disposition:"</SPAN
4210 > header contains the file name
4211 the browser is supposed to use by default.
4214 > In most browsers that understand this header, it makes it impossible to
4221 > the document, without downloading it first,
4222 even if it's just a simple text file or an image.
4225 > Removing the <SPAN
4227 >"Content-Disposition:"</SPAN
4229 to prevent this annoyance, but some browsers additionally check the
4232 >"Content-Type:"</SPAN
4233 > header, before they decide if they can
4234 display a document without saving it first. In these cases, you have
4235 to change this header as well, before the browser stops displaying
4239 > It is also possible to change the server's file name suggestion
4240 to another one, but in most cases it isn't worth the time to set
4256 ># Disarm the download link in Sourceforge's patch tracker
4258 +content-type-overwrite {text/plain}\
4259 +hide-content-disposition {block} }
4260 .sourceforge.net/tracker/download.php</PRE
4275 NAME="HIDE-IF-MODIFIED-SINCE"
4277 >8.5.20. hide-if-modified-since</H4
4281 CLASS="VARIABLELIST"
4287 >Prevent yet another way to track the user's steps between sessions.</P
4295 >"If-Modified-Since:"</SPAN
4296 > HTTP client header or modifies its value.
4312 >, or a user defined value that specifies a range of hours.
4319 > Removing this header is useful for filter testing, where you want to force a real
4320 reload instead of getting status code <SPAN
4323 >, which would cause the
4324 browser to use a cached copy of the page.
4327 > Instead of removing the header, <TT
4329 >hide-if-modified-since</TT
4331 also add or substract a random amount of time to/from the headers value.
4332 You specify a range of hours were the random factor should be chosen from and
4336 > does the rest. A negative value means
4337 subtracting, a positive value adding.
4340 > Randomizing the value of the <SPAN
4342 >"If-Modified-Since:"</SPAN
4344 sure it isn't used as a cookie replacement, but you will run into
4345 caching problems if the random range is too high.
4348 > It is a good idea to only use a small negative value and let
4352 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
4353 >overwrite-last-modified</A
4356 handle the greater changes.
4359 > It is also recommended to use this action together with
4363 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
4364 >crunch-if-none-match</A
4370 >Example usage (section):</DT
4381 ># Let the browser revalidate without being tracked across sessions
4382 {+hide-if-modified-since {-1}\
4383 +overwrite-last-modified {randomize}\
4384 +crunch-if-none-match}
4400 NAME="HIDE-FORWARDED-FOR-HEADERS"
4402 >8.5.21. hide-forwarded-for-headers</H4
4406 CLASS="VARIABLELIST"
4412 >Improve privacy by hiding the true source of the request</P
4418 > Deletes any existing <SPAN
4420 >"X-Forwarded-for:"</SPAN
4421 > HTTP header from client requests,
4422 and prevents adding a new one.
4442 > It is fairly safe to leave this on.
4445 > This action is scheduled for improvement: It should be able to generate forged
4448 >"X-Forwarded-for:"</SPAN
4449 > headers using random IP addresses from a specified network,
4450 to make successive requests from the same client look like requests from a pool of different
4451 users sharing the same proxy.
4466 >+hide-forwarded-for-headers</PRE
4481 NAME="HIDE-FROM-HEADER"
4483 >8.5.22. hide-from-header</H4
4487 CLASS="VARIABLELIST"
4493 >Keep your (old and ill) browser from telling web servers your email address</P
4499 > Deletes any existing <SPAN
4502 > HTTP header, or replaces it with the
4519 >, or any user defined value.
4529 > will completely remove the header
4530 (not to be confused with the <TT
4533 HREF="actions-file.html#BLOCK"
4540 > Alternately, you can specify any value you prefer to be sent to the web
4541 server. If you do, it is a matter of fairness not to use any address that
4542 is actually used by a real person.
4545 > This action is rarely needed, as modern web browsers don't send
4564 >+hide-from-header{block}</PRE
4577 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
4592 NAME="HIDE-REFERRER"
4594 >8.5.23. hide-referrer</H4
4601 CLASS="VARIABLELIST"
4607 >Conceal which link you followed to get to a particular site</P
4616 > (sic) HTTP header from the client request,
4617 or replaces it with a forged one.
4636 >"conditional-block"</SPAN
4637 > to delete the header completely if the host has changed.</P
4644 > to delete the header unconditionally.</P
4651 > to pretend to be coming from the homepage of the server we are talking to.</P
4655 >Any other string to set a user defined referrer.</P
4665 >conditional-block</TT
4666 > is the only parameter,
4667 that isn't easily detected in the server's log file. If it blocks the
4668 referrer, the request will look like the visitor used a bookmark or
4669 typed in the address directly.
4672 > Leaving the referrer unmodified for requests on the same host
4673 allows the server owner to see the visitor's <SPAN
4677 but in most cases she could also get that information by comparing
4678 other parts of the log file: for example the User-Agent if it isn't
4679 a very common one, or the user's IP address if it doesn't change between
4683 > Always blocking the referrer, or using a custom one, can lead to
4684 failures on servers that check the referrer before they answer any
4685 requests, in an attempt to prevent their valuable content from being
4686 embedded or linked to elsewhere.
4691 >conditional-block</TT
4696 will work with referrer checks, as long as content and valid referring page
4697 are on the same host. Most of the time that's the case.
4704 > is an alternate spelling of
4708 > and the two can be can be freely
4709 substituted with each other. (<SPAN
4713 correct English spelling, however the HTTP specification has a bug - it
4714 requires it to be spelled as <SPAN
4732 >+hide-referrer{forge}</PRE
4745 >+hide-referrer{http://www.yahoo.com/}</PRE
4760 NAME="HIDE-USER-AGENT"
4762 >8.5.24. hide-user-agent</H4
4766 CLASS="VARIABLELIST"
4772 >Conceal your type of browser and client operating system</P
4778 > Replaces the value of the <SPAN
4780 >"User-Agent:"</SPAN
4782 in client requests with the specified value.
4795 > Any user-defined string.
4820 > This can lead to problems on web sites that depend on looking at this header in
4821 order to customize their content for different browsers (which, by the
4828 > the right thing to do: good web sites
4829 work browser-independently).
4837 > Using this action in multi-user setups or wherever different types of
4838 browsers will access the same <SPAN
4848 >. In single-user, single-browser
4849 setups, you might use it to delete your OS version information from
4850 the headers, because it is an invitation to exploit known bugs for your
4851 OS. It is also occasionally useful to forge this in order to access
4852 sites that won't let you in otherwise (though there may be a good
4853 reason in some cases). Example of this: some MSN sites will not
4857 > enter, yet forging to a
4861 > user-agent works just fine.
4862 (Must be just a silly MS goof, I'm sure :-).
4865 > This action is scheduled for improvement.
4880 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
4895 NAME="INSPECT-JPEGS"
4897 >8.5.25. inspect-jpegs</H4
4901 CLASS="VARIABLELIST"
4907 >To protect against the MS buffer over-run in JPEG processing</P
4913 > Protect against a known exploit
4933 > See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
4934 common image types found across the Internet. The exploit as described can
4935 allow execution of code on the target system, giving an attacker access
4936 to the system in question by merely planting an altered JPEG image, which
4937 would have no obvious indications of what lurks inside. This action
4938 prevents unwanted intrusion.
4953 >+inspect-jpegs</PRE
4969 >8.5.26. kill-popups<A
4976 CLASS="VARIABLELIST"
4982 >Eliminate those annoying pop-up windows (deprecated)</P
4988 > While loading the document, replace JavaScript code that opens
4989 pop-up windows with (syntactically neutral) dummy code on the fly.
5009 > This action is basically a built-in, hardwired special-purpose filter
5010 action, but there are important differences: For <TT
5014 the document need not be buffered, so it can be incrementally rendered while
5015 downloading. But <TT
5018 > doesn't catch as many pop-ups as
5022 HREF="actions-file.html#FILTER-ALL-POPUPS"
5031 does and is not as smart as <TT
5034 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5038 >unsolicited-popups</I
5046 > Think of it as a fast and efficient replacement for a filter that you
5047 can use if you don't want any filtering at all. Note that it doesn't make
5048 sense to combine it with any <TT
5051 HREF="actions-file.html#FILTER"
5055 since as soon as one <TT
5058 HREF="actions-file.html#FILTER"
5062 the whole document needs to be buffered anyway, which destroys the advantage of
5066 > action over its filter equivalent.
5069 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
5070 pop-ups to display forms, shopping carts etc, and the <TT
5073 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5077 >unsolicited-popups</I
5082 > does a fairly good job of catching only the unwanted ones.
5085 > If the only kind of pop-ups that you want to kill are exit consoles (those
5092 > windows that appear when you close an other
5093 one), you might want to use
5097 HREF="actions-file.html#FILTER"
5135 NAME="LIMIT-CONNECT"
5137 >8.5.27. limit-connect</H4
5141 CLASS="VARIABLELIST"
5147 >Prevent abuse of <SPAN
5150 > as a TCP proxy relay or disable SSL for untrusted sites</P
5156 > Specifies to which ports HTTP CONNECT requests are allowable.
5169 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5170 defaulting to 0 and the maximum to 65K).
5177 > By default, i.e. if no <TT
5184 > only allows HTTP CONNECT
5185 requests to port 443 (the standard, secure HTTPS port). Use
5189 > if more fine-grained control is desired
5190 for some or all destinations.
5193 > The CONNECT methods exists in HTTP to allow access to secure websites
5197 > URLs) through proxies. It works very simply:
5198 the proxy connects to the server on the specified port, and then
5199 short-circuits its connections to the client and to the remote server.
5200 This can be a big security hole, since CONNECT-enabled proxies can be
5201 abused as TCP relays very easily.
5207 > relays HTTPS traffic without seeing
5208 the decoded content. Websites can leverage this limitation to circumvent Privoxy's
5209 filters. By specifying an invalid port range you can disable HTTPS entirely.
5210 If you plan to disable SSL by default, consider enabling
5214 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
5215 >treat-forbidden-connects-like-blocks</A
5218 as well, to be able to quickly create exceptions.
5222 >Example usages:</DT
5233 >+limit-connect{443} # This is the default and need not be specified.
5234 +limit-connect{80,443} # Ports 80 and 443 are OK.
5235 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5236 +limit-connect{-} # All ports are OK
5237 +limit-connect{,} # No HTTPS traffic is allowed</PRE
5252 NAME="PREVENT-COMPRESSION"
5254 >8.5.28. prevent-compression</H4
5258 CLASS="VARIABLELIST"
5264 > Ensure that servers send the content uncompressed, so it can be
5268 HREF="actions-file.html#FILTER"
5278 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5298 > More and more websites send their content compressed by default, which
5299 is generally a good idea and saves bandwidth. But for the <TT
5302 HREF="actions-file.html#FILTER"
5308 HREF="actions-file.html#DEANIMATE-GIFS"
5315 HREF="actions-file.html#KILL-POPUPS"
5322 > needs access to the uncompressed data.
5323 Unfortunately, <SPAN
5326 > can't yet(!) uncompress, filter, and
5327 re-compress the content on the fly. So if you want to ensure that all websites, including
5328 those that normally compress, can be filtered, you need to use this action.
5331 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
5332 actions, you will typically want to use <TT
5334 >prevent-compression</TT
5339 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5340 documents correctly (they send an empty document body). If you use <TT
5342 >prevent-compression</TT
5344 per default, you'll have to add exceptions for those sites. See the example for how to do that.
5348 >Example usage (sections):</DT
5361 {+prevent-compression}
5364 # Make exceptions for ill sites:
5366 {-prevent-compression}
5368 www.pclinuxonline.com</PRE
5383 NAME="OVERWRITE-LAST-MODIFIED"
5385 >8.5.29. overwrite-last-modified</H4
5389 CLASS="VARIABLELIST"
5395 >Prevent yet another way to track the user's steps between sessions.</P
5403 >"Last-Modified:"</SPAN
5404 > HTTP server header or modifies its value.
5417 > One of the keywords: <SPAN
5422 >"reset-to-request-time"</SPAN
5434 > Removing the <SPAN
5436 >"Last-Modified:"</SPAN
5437 > header is useful for filter
5438 testing, where you want to force a real reload instead of getting status
5442 >, which would cause the browser to reuse the old
5443 version of the page.
5449 > option overwrites the value of the
5452 >"Last-Modified:"</SPAN
5453 > header with a randomly chosen time
5454 between the original value and the current time. In theory the server
5455 could send each document with a different <SPAN
5457 >"Last-Modified:"</SPAN
5459 header to track visits without using cookies. <SPAN
5463 makes it impossible and the browser can still revalidate cached documents.
5468 >"reset-to-request-time"</SPAN
5469 > overwrites the value of the
5472 >"Last-Modified:"</SPAN
5473 > header with the current time. You could use
5474 this option together with
5478 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5479 >hided-if-modified-since</A
5482 to further customize your random range.
5485 > The preferred parameter here is <SPAN
5489 to use, as long as the time settings are more or less correct.
5490 If the server sets the <SPAN
5492 >"Last-Modified:"</SPAN
5493 > header to the time
5494 of the request, the random range becomes zero and the value stays the same.
5495 Therefore you should later randomize it a second time with
5499 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5500 >hided-if-modified-since</A
5506 > It is also recommended to use this action together with
5510 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5511 >crunch-if-none-match</A
5528 ># Let the browser revalidate without being tracked across sessions
5529 {+hide-if-modified-since {-1}\
5530 +overwrite-last-modified {randomize}\
5531 +crunch-if-none-match}
5549 >8.5.30. redirect</H4
5553 CLASS="VARIABLELIST"
5559 > Redirect requests to other sites.
5566 > Convinces the browser that the requested document has been moved
5567 to another location and the browser should get it from there.
5587 > This action is useful to replace whole documents with your own
5588 ones. For that to work, they have to be available on another server,
5589 and both should resolve.
5592 > You can do the same by combining the actions
5596 HREF="actions-file.html#BLOCK"
5603 HREF="actions-file.html#HANDLE-AS-IMAGE"
5610 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5611 >set-image-blocker{URL}</A
5614 It doesn't sound right for non-image documents, and that's why this action
5618 > This action will be ignored if you use it together with
5622 HREF="actions-file.html#BLOCK"
5640 ># Replace example.com's style sheet with another one
5641 {+redirect{http://localhost/css-replacements/example.com.css}}
5642 example.com/stylesheet.css</PRE
5657 NAME="SEND-VANILLA-WAFER"
5659 >8.5.31. send-vanilla-wafer</H4
5663 CLASS="VARIABLELIST"
5669 > Feed log analysis scripts with useless data.
5676 > Sends a cookie with each request stating that you do not accept any copyright
5677 on cookies sent to you, and asking the site operator not to track you.
5697 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
5700 > This action is rarely used and not enabled in the default configuration.
5715 >+send-vanilla-wafer</PRE
5732 >8.5.32. send-wafer</H4
5736 CLASS="VARIABLELIST"
5742 > Send custom cookies or feed log analysis scripts with even more useless data.
5749 > Sends a custom, user-defined cookie with each request.
5762 > A string of the form <SPAN
5782 > Being multi-valued, multiple instances of this action can apply to the same request,
5783 resulting in multiple cookies being sent.
5786 > This action is rarely used and not enabled in the default configuration.
5790 >Example usage (section):</DT
5801 >{+send-wafer{UsingPrivoxy=true}}
5802 my-internal-testing-server.void</PRE
5817 NAME="SESSION-COOKIES-ONLY"
5819 >8.5.33. session-cookies-only</H4
5823 CLASS="VARIABLELIST"
5829 > Allow only temporary <SPAN
5832 > cookies (for the current
5833 browser session <SPAN
5851 >"Set-Cookie:"</SPAN
5853 server headers. Most browsers will not store such cookies permanently and
5854 forget them in between sessions.
5874 > This is less strict than <TT
5877 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5878 >crunch-incoming-cookies</A
5884 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5885 >crunch-outgoing-cookies</A
5887 > and allows you to browse
5888 websites that insist or rely on setting cookies, without compromising your privacy too badly.
5891 > Most browsers will not permanently store cookies that have been processed by
5894 >session-cookies-only</TT
5895 > and will forget about them between sessions.
5896 This makes profiling cookies useless, but won't break sites which require cookies so
5897 that you can log in for transactions. This is generally turned on for all
5898 sites, and is the recommended setting.
5909 >session-cookies-only</TT
5914 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5915 >crunch-incoming-cookies</A
5921 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5922 >crunch-outgoing-cookies</A
5924 >. If you do, cookies
5925 will be plainly killed.
5928 > Note that it is up to the browser how it handles such cookies without an <SPAN
5932 field. If you use an exotic browser, you might want to try it out to be sure.
5935 > This setting also has no effect on cookies that may have been stored
5936 previously by the browser before starting <SPAN
5940 These would have to be removed manually.
5948 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
5949 >content-cookies filter</A
5951 to block some types of cookies. Content cookies are not effected by
5954 >session-cookies-only</TT
5970 >+session-cookies-only</PRE
5985 NAME="SET-IMAGE-BLOCKER"
5987 >8.5.34. set-image-blocker</H4
5991 CLASS="VARIABLELIST"
5997 >Choose the replacement for blocked images</P
6003 > This action alone doesn't do anything noticeable. If <SPAN
6013 HREF="actions-file.html#BLOCK"
6025 HREF="actions-file.html#HANDLE-AS-IMAGE"
6035 apply, i.e. if the request is to be blocked as an image,
6042 > the parameter of this action decides what will be
6043 sent as a replacement.
6063 > to send a built-in checkerboard pattern image. The image is visually
6064 decent, scales very well, and makes it obvious where banners were busted.
6072 > to send a built-in transparent image. This makes banners disappear
6073 completely, but makes it hard to detect where <SPAN
6077 images on a given page and complicates troubleshooting if <SPAN
6081 has blocked innocent images, like navigation icons.
6095 send a redirect to <TT
6101 to any image anywhere, even in your local filesystem via <SPAN
6105 (But note that not all browsers support redirecting to a local file system).
6108 > A good application of redirects is to use special <SPAN
6112 URLs, which send the built-in images, as <TT
6118 This has the same visual effect as specifying <SPAN
6125 the first place, but enables your browser to cache the replacement image, instead of requesting
6126 it over and over again.
6135 > The URLs for the built-in images are <SPAN
6137 >"http://config.privoxy.org/send-banner?type=<TT
6158 > There is a third (advanced) type, called <SPAN
6170 >set-image-blocker</TT
6171 >, but meant for use from <A
6172 HREF="filter-file.html"
6175 Auto will select the type of image that would have applied to the referring page, had it been an image.
6193 >+set-image-blocker{pattern}</PRE
6200 > Redirect to the BSD devil:
6211 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6218 > Redirect to the built-in pattern for better caching:
6229 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6244 NAME="TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
6246 >8.5.35. treat-forbidden-connects-like-blocks</H4
6250 CLASS="VARIABLELIST"
6256 >Block forbidden connects with an easy to find error message.</P
6262 > If this action is enabled, <SPAN
6266 makes a difference between forbidden connects and ordinary blocks.
6290 HREF="actions-file.html#LIMIT-CONNECT"
6296 with a short error message inside the headers. If the browser doesn't display
6297 headers (most don't), you just see an empty page.
6300 > With this action enabled, <SPAN
6304 the message that is used for ordinary blocks instead. If you decide
6305 to make an exception for the page in question, you can do so by
6315 > requests the clients tell
6319 > which host they are interested
6320 in, but not which document they plan to get later. As a result, the
6323 >"Go there anyway"</SPAN
6324 > link becomes rather useless:
6325 it lets the client request the home page of the forbidden host
6326 through unencrypted HTTP, still using the port of the last request.
6329 > If you previously configured <SPAN
6333 request through a SSL tunnel, everything will work. Most likely you haven't
6334 and the server will respond with an error message because it is expecting
6350 >+treat-forbidden-connects-like-blocks</PRE
6367 >8.5.36. Summary</H3
6369 > Note that many of these actions have the potential to cause a page to
6370 misbehave, possibly even not to display at all. There are many ways
6371 a site designer may choose to design his site, and what HTTP header
6372 content, and other criteria, he may depend on. There is no way to have hard
6373 and fast rules for all sites. See the <A
6374 HREF="appendix.html#ACTIONSANAT"
6376 > for a brief example on troubleshooting
6399 >, can be defined by combining other actions.
6400 These can in turn be invoked just like the built-in actions.
6401 Currently, an alias name can contain any character except space, tab,
6419 > that you only use <SPAN
6439 Alias names are not case sensitive, and are not required to start with a
6446 > sign, since they are merely textually
6449 > Aliases can be used throughout the actions file, but they <SPAN
6454 defined in a special section at the top of the file!</I
6457 And there can only be one such section per actions file. Each actions file may
6458 have its own alias section, and the aliases defined in it are only visible
6459 within that file.</P
6461 > There are two main reasons to use aliases: One is to save typing for frequently
6462 used combinations of actions, the other one is a gain in flexibility: If you
6463 decide once how you want to handle shops by defining an alias called
6467 >, you can later change your policy on shops in
6474 > place, and your changes will take effect everywhere
6475 in the actions file where the <SPAN
6478 > alias is used. Calling aliases
6479 by their purpose also makes your actions files more readable.</P
6481 > Currently, there is one big drawback to using aliases, though:
6485 >'s built-in web-based action file
6486 editor honors aliases when reading the actions files, but it expands
6487 them before writing. So the effects of your aliases are of course preserved,
6488 but the aliases themselves are lost when you edit sections that use aliases
6490 This is likely to change in future versions of <SPAN
6495 > Now let's define some aliases...</P
6505 > # Useful custom aliases we can use later.
6507 # Note the (required!) section header line and that this section
6508 # must be at the top of the actions file!
6512 # These aliases just save typing later:
6513 # (Note that some already use other aliases!)
6515 +crunch-all-cookies = +<A
6516 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6517 >crunch-incoming-cookies</A
6519 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6520 >crunch-outgoing-cookies</A
6522 -crunch-all-cookies = -<A
6523 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6524 >crunch-incoming-cookies</A
6526 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6527 >crunch-outgoing-cookies</A
6529 block-as-image = +block +handle-as-image
6530 mercy-for-cookies = -crunch-all-cookies -<A
6531 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6532 >session-cookies-only</A
6534 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6535 >filter{content-cookies}</A
6538 # These aliases define combinations of actions
6539 # that are useful for certain types of sites:
6542 HREF="actions-file.html#BLOCK"
6545 HREF="actions-file.html#FILTER"
6547 > -crunch-all-cookies -<A
6548 HREF="actions-file.html#FAST-REDIRECTS"
6551 HREF="actions-file.html#HIDE-REFERER"
6554 HREF="actions-file.html#KILL-POPUPS"
6557 shop = -crunch-all-cookies -<A
6558 HREF="actions-file.html#FILTER-ALL-POPUPS"
6559 >filter{all-popups}</A
6561 HREF="actions-file.html#KILL-POPUPS"
6565 # Short names for other aliases, for really lazy people ;-)
6567 c0 = +crunch-all-cookies
6568 c1 = -crunch-all-cookies</PRE
6574 > ...and put them to use. These sections would appear in the lower part of an
6575 actions file and define exceptions to the default actions (as specified further
6589 > # These sites are either very complex or very keen on
6590 # user data and require minimal interference to work:
6593 .office.microsoft.com
6594 .windowsupdate.microsoft.com
6598 # Allow cookies (for setting and retrieving your customer data)
6602 .worldpay.com # for quietpc.com
6605 # These shops require pop-ups:
6607 {shop -kill-popups -filter{all-popups}}
6609 .overclockers.co.uk</PRE
6615 > Aliases like <SPAN
6621 > are often used for
6625 > sites that require some actions to be disabled
6626 in order to function properly.</P
6635 >8.7. Actions Files Tutorial</H2
6637 > The above chapters have shown <A
6638 HREF="actions-file.html"
6639 >which actions files
6640 there are and how they are organized</A
6641 >, how actions are <A
6642 HREF="actions-file.html#ACTIONS"
6645 HREF="actions-file.html#ACTIONS-APPLY"
6649 HREF="actions-file.html#AF-PATTERNS"
6653 HREF="actions-file.html#ALIASES"
6655 >. Now, let's look at an
6663 file and see how all these pieces come together:</P
6671 >8.7.1. default.action</H3
6673 >Every config file should start with a short comment stating its purpose:</P
6683 ># Sample default.action file <ijbswa-developers@lists.sourceforge.net></PRE
6689 >Then, since this is the <TT
6693 first section is a special section for internal use that you needn't
6694 change or worry about:</P
6704 >##########################################################################
6705 # Settings -- Don't change! For internal Privoxy use ONLY.
6706 ##########################################################################
6709 for-privoxy-version=3.0</PRE
6715 >After that comes the (optional) alias section. We'll use the example
6716 section from the above <A
6717 HREF="actions-file.html#ALIASES"
6718 >chapter on aliases</A
6720 that also explains why and how aliases are used:</P
6730 >##########################################################################
6732 ##########################################################################
6735 # These aliases just save typing later:
6736 # (Note that some already use other aliases!)
6738 +crunch-all-cookies = +<A
6739 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6740 >crunch-incoming-cookies</A
6742 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6743 >crunch-outgoing-cookies</A
6745 -crunch-all-cookies = -<A
6746 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6747 >crunch-incoming-cookies</A
6749 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6750 >crunch-outgoing-cookies</A
6752 block-as-image = +block +handle-as-image
6753 mercy-for-cookies = -crunch-all-cookies -<A
6754 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6755 >session-cookies-only</A
6757 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6758 >filter{content-cookies}</A
6761 # These aliases define combinations of actions
6762 # that are useful for certain types of sites:
6765 HREF="actions-file.html#BLOCK"
6768 HREF="actions-file.html#FILTER"
6770 > -crunch-all-cookies -<A
6771 HREF="actions-file.html#FAST-REDIRECTS"
6774 HREF="actions-file.html#HIDE-REFERER"
6777 HREF="actions-file.html#KILL-POPUPS"
6780 shop = -crunch-all-cookies -<A
6781 HREF="actions-file.html#FILTER-ALL-POPUPS"
6782 >filter{all-popups}</A
6784 HREF="actions-file.html#KILL-POPUPS"
6792 > Now come the regular sections, i.e. sets of actions, accompanied
6793 by URL patterns to which they apply. Remember <SPAN
6798 are disabled when matching starts</I
6800 >, so we have to explicitly
6801 enable the ones we want.</P
6803 > The first regular section is probably the most important. It has only
6812 HREF="actions-file.html#AF-PATTERNS"
6813 >matches all URLs</A
6815 set of actions used in this <SPAN
6823 be applied to all requests as a start</I
6825 >. It can be partly or
6826 wholly overridden by later matches further down this file, or in user.action,
6827 but it will still be largely responsible for your overall browsing
6830 > Again, at the start of matching, all actions are disabled, so there is
6831 no real need to disable any actions here, but we will do that nonetheless,
6832 to have a complete listing for your reference. (Remember: a <SPAN
6836 preceding the action name enables the action, a <SPAN
6840 Also note how this long line has been made more readable by splitting it into
6841 multiple lines with line continuation.</P
6851 >##########################################################################
6852 # "Defaults" section:
6853 ##########################################################################
6856 HREF="actions-file.html#ADD-HEADER"
6860 HREF="actions-file.html#BLOCK"
6864 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
6865 >content-type-overwrite</A
6868 HREF="actions-file.html#CRUNCH-CLIENT-HEADER"
6869 >crunch-client-header</A
6872 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
6873 >crunch-if-none-match</A
6876 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6877 >crunch-incoming-cookies</A
6880 HREF="actions-file.html#CRUNCH-SERVER-HEADER"
6881 >crunch-server-header</A
6884 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6885 >crunch-outgoing-cookies</A
6888 HREF="actions-file.html#DEANIMATE-GIFS"
6892 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
6893 >downgrade-http-version</A
6896 HREF="actions-file.html#FAST-REDIRECTS"
6897 >fast-redirects{check-decoded-url}</A
6900 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
6901 >filter{js-annoyances}</A
6904 HREF="actions-file.html#FILTER-JS-EVENTS"
6905 >filter{js-events}</A
6908 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
6909 >filter{html-annoyances}</A
6912 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6913 >filter{content-cookies}</A
6916 HREF="actions-file.html#FILTER-REFRESH-TAGS"
6917 >filter{refresh-tags}</A
6920 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
6921 >filter{unsolicited-popups}</A
6924 HREF="actions-file.html#FILTER-ALL-POPUPS"
6925 >filter{all-popups}</A
6928 HREF="actions-file.html#FILTER-IMG-REORDER"
6929 >filter{img-reorder}</A
6932 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
6933 >filter{banners-by-size}</A
6936 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
6937 >filter{banners-by-link}</A
6940 HREF="actions-file.html#FILTER-WEBBUGS"
6944 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
6945 >filter{tiny-textforms}</A
6948 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
6949 >filter{jumping-windows}</A
6952 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
6953 >filter{frameset-borders}</A
6956 HREF="actions-file.html#FILTER-DEMORONIZER"
6957 >filter{demoronizer}</A
6960 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
6961 >filter{shockwave-flash}</A
6964 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
6965 >filter{quicktime-kioskmode}</A
6968 HREF="actions-file.html#FILTER-FUN"
6972 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
6973 >filter{crude-parental}</A
6976 HREF="actions-file.html#FILTER-IE-EXPLOITS"
6977 >filter{ie-exploits}</A
6980 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
6981 >filter-client-headers</A
6984 HREF="actions-file.html#FILTER-SERVER-HEADERS"
6985 >filter-server-headers</A
6988 HREF="actions-file.html#FORCE-TEXT-MODE"
6992 HREF="actions-file.html#HANDLE-AS-EMPTY-DOCUMENT"
6993 >handle-as-empty-document</A
6996 HREF="actions-file.html#HANDLE-AS-IMAGE"
7000 HREF="actions-file.html#HIDE-ACCEPT-LANGUAGE"
7001 >hide-accept-language</A
7004 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7005 >hide-content-disposition</A
7008 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
7009 >hide-if-modified-since</A
7012 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
7013 >hide-forwarded-for-headers</A
7016 HREF="actions-file.html#HIDE-FROM-HEADER"
7017 >hide-from-header{block}</A
7020 HREF="actions-file.html#HIDE-REFERER"
7021 >hide-referrer{forge}</A
7024 HREF="actions-file.html#HIDE-USER-AGENT"
7028 HREF="actions-file.html#INSPECT-JPEGS"
7032 HREF="actions-file.html#KILL-POPUPS"
7036 HREF="actions-file.html#LIMIT-CONNECT"
7040 HREF="actions-file.html#PREVENT-COMPRESSION"
7041 >prevent-compression</A
7044 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
7045 >overwrite-last-modified</A
7048 HREF="actions-file.html#REDIRECT"
7052 HREF="actions-file.html#SEND-VANILLA-WAFER"
7053 >send-vanilla-wafer</A
7056 HREF="actions-file.html#SEND-WAFER"
7060 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7061 >session-cookies-only</A
7064 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7065 >set-image-blocker{pattern}</A
7068 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
7069 >treat-forbidden-connects-like-blocks</A
7072 / # forward slash will match *all* potential URL patterns.</PRE
7078 > The default behavior is now set. Note that some actions, like not hiding
7079 the user agent, are part of a <SPAN
7081 >"general policy"</SPAN
7083 universally and won't get any exceptions defined later. Other choices,
7084 like not blocking (which is <SPAN
7091 default!) need exceptions, i.e. we need to specify explicitly what we
7092 want to block in later sections.</P
7094 > The first of our specialized sections is concerned with <SPAN
7098 sites, i.e. sites that require minimum interference, because they are either
7099 very complex or very keen on tracking you (and have mechanisms in place that
7100 make them unusable for people who avoid being tracked). We will simply use
7104 > alias instead of stating the list
7105 of actions explicitly:</P
7115 >##########################################################################
7116 # Exceptions for sites that'll break under the default action set:
7117 ##########################################################################
7119 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7122 .office.microsoft.com # surprise, surprise!
7123 .windowsupdate.microsoft.com</PRE
7129 > Shopping sites are not as fragile, but they typically
7130 require cookies to log in, and pop-up windows for shopping
7131 carts or item details. Again, we'll use a pre-defined alias:</P
7145 .worldpay.com # for quietpc.com
7156 HREF="actions-file.html#FAST-REDIRECTS"
7160 action, which we enabled per default above, breaks some sites. So disable
7161 it for popular sites where we know it misbehaves:</P
7172 HREF="actions-file.html#FAST-REDIRECTS"
7178 .altavista.com/.*(like|url|link):http
7179 .altavista.com/trans.*urltext=http
7186 > It is important that <SPAN
7190 URLs belong to images, so that <SPAN
7197 be blocked, a substitute image can be sent, rather than an HTML page.
7198 Contacting the remote site to find out is not an option, since it
7199 would destroy the loading time advantage of banner blocking, and it
7200 would feed the advertisers (in terms of money <SPAN
7207 information). We can mark any URL as an image with the <TT
7210 HREF="actions-file.html#HANDLE-AS-IMAGE"
7214 and marking all URLs that end in a known image file extension is a
7225 >##########################################################################
7227 ##########################################################################
7229 # Define which file types will be treated as images, in case they get
7230 # blocked further down this file:
7233 HREF="actions-file.html#HANDLE-AS-IMAGE"
7236 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7242 > And then there are known banner sources. They often use scripts to
7243 generate the banners, so it won't be visible from the URL that the
7244 request is for an image. Hence we block them <SPAN
7251 mark them as images in one go, with the help of our
7255 > alias defined above. (We could of
7256 course just as well use <TT
7259 HREF="actions-file.html#BLOCK"
7263 HREF="actions-file.html#HANDLE-AS-IMAGE"
7267 Remember that the type of the replacement image is chosen by the
7271 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7272 >set-image-blocker</A
7275 action. Since all URLs have matched the default section with its
7279 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7280 >set-image-blocker</A
7283 action before, it still applies and needn't be repeated:</P
7293 ># Known ad generators:
7298 .ad.*.doubleclick.net
7299 .a.yimg.com/(?:(?!/i/).)*$
7300 .a[0-9].yimg.com/(?:(?!/i/).)*$
7309 > One of the most important jobs of <SPAN
7313 is to block banners. A huge bunch of them can be <SPAN
7320 HREF="actions-file.html#FILTER"
7322 >{banners-by-size}</TT
7324 action, which we enabled above, and which deletes the references to banner
7325 images from the pages while they are loaded, so the browser doesn't request
7326 them anymore, and hence they don't need to be blocked here. But this naturally
7327 doesn't catch all banners, and some people choose not to use filters, so we
7328 need a comprehensive list of patterns for banner URLs here, and apply the
7332 HREF="actions-file.html#BLOCK"
7335 > action to them.</P
7337 > First comes a bunch of generic patterns, which do most of the work, by
7338 matching typical domain and path name components of banners. Then comes
7339 a list of individual patterns for specific sites, which is omitted here
7340 to keep the example short:</P
7350 >##########################################################################
7351 # Block these fine banners:
7352 ##########################################################################
7354 HREF="actions-file.html#BLOCK"
7364 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7365 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7367 # Site-specific patterns (abbreviated):
7375 > You wouldn't believe how many advertisers actually call their banner
7381 >.com, or call the directory
7382 in which the banners are stored simply <SPAN
7386 generic patterns are surprisingly effective.</P
7388 > But being very generic, they necessarily also catch URLs that we don't want
7389 to block. The pattern <TT
7401 >.nasty-corp.com"</SPAN
7411 >.sourcefroge.net"</SPAN
7421 >l.some-provider.net."</SPAN
7423 well-known exceptions to the <TT
7426 HREF="actions-file.html#BLOCK"
7432 > Note that these are exceptions to exceptions from the default! Consider the URL
7435 >"downloads.sourcefroge.net"</SPAN
7436 >: Initially, all actions are deactivated,
7437 so it wouldn't get blocked. Then comes the defaults section, which matches the
7438 URL, but just deactivates the <TT
7441 HREF="actions-file.html#BLOCK"
7445 action once again. Then it matches <TT
7448 >, an exception to the
7449 general non-blocking policy, and suddenly
7453 HREF="actions-file.html#BLOCK"
7456 > applies. And now, it'll match
7463 HREF="actions-file.html#BLOCK"
7467 applies, so (unless it matches <SPAN
7473 > further down) it ends up
7477 HREF="actions-file.html#BLOCK"
7480 > action applying.</P
7490 >##########################################################################
7491 # Save some innocent victims of the above generic block patterns:
7492 ##########################################################################
7497 HREF="actions-file.html#BLOCK"
7500 adv[io]*. # (for advogato.org and advice.*)
7501 adsl. # (has nothing to do with ads)
7502 ad[ud]*. # (adult.* and add.*)
7503 .edu # (universities don't host banners (yet!))
7504 .*loads. # (downloads, uploads etc)
7512 www.globalintersec.com/adv # (adv = advanced)
7513 www.ugu.com/sui/ugu/adv</PRE
7519 > Filtering source code can have nasty side effects,
7520 so make an exception for our friends at sourceforge.net,
7521 and all paths with <SPAN
7524 > in them. Note that
7528 HREF="actions-file.html#FILTER"
7538 > filters in one fell swoop!</P
7548 ># Don't filter code!
7551 HREF="actions-file.html#FILTER"
7555 .sourceforge.net</PRE
7564 > is of course much more
7565 comprehensive, but we hope this example made clear how it works.</P
7574 >8.7.2. user.action</H3
7576 > So far we are painting with a broad brush by setting general policies,
7577 which would be a reasonable starting point for many people. Now,
7578 you might want to be more specific and have customized rules that
7579 are more suitable to your personal habits and preferences. These would
7580 be for narrowly defined situations like your ISP or your bank, and should
7584 >, which is parsed after all other
7585 actions files and hence has the last word, over-riding any previously
7586 defined actions. <TT
7596 > place for your personal settings, since
7600 > is actively maintained by the
7604 > developers and you'll probably want
7605 to install updated versions from time to time.</P
7607 > So let's look at a few examples of things that one might typically do in
7621 ># My user.action file. <fred@foobar.com></PRE
7628 HREF="actions-file.html#ALIASES"
7630 > are local to the actions
7631 file that they are defined in, you can't use the ones from
7635 >, unless you repeat them here:</P
7645 ># Aliases are local to the file they are defined in.
7646 # (Re-)define aliases for this file:
7650 # These aliases just save typing later, and the alias names should
7651 # be self explanatory.
7653 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7654 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7655 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7656 allow-popups = -filter{all-popups} -kill-popups
7657 +block-as-image = +block +handle-as-image
7658 -block-as-image = -block
7660 # These aliases define combinations of actions that are useful for
7661 # certain types of sites:
7663 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
7664 shop = -crunch-all-cookies allow-popups
7666 # Allow ads for selected useful free sites:
7668 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
7670 # Alias for specific file types that are text, but might have conflicting
7671 # MIME types. We want the browser to force these to be text documents.
7672 handle-as-text = -<A
7673 HREF="actions-file.html#FILTER"
7676 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
7677 >content-type-overwrite{text/plain}</A
7679 HREF="actions-file.html#FORCE-TEXT-MODE"
7682 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7683 >hide-content-disposition</A
7690 > Say you have accounts on some sites that you visit regularly, and
7691 you don't want to have to log in manually each time. So you'd like
7692 to allow persistent cookies for these sites. The
7695 >allow-all-cookies</TT
7696 > alias defined above does exactly
7697 that, i.e. it disables crunching of cookies in any direction, and the
7698 processing of cookies to make them only temporary.</P
7708 >{ allow-all-cookies }
7720 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7731 HREF="actions-file.html#FILTER"
7734 .your-home-banking-site.com</PRE
7740 > Some file types you may not want to filter for various reasons:</P
7750 ># Technical documentation is likely to contain strings that might
7751 # erroneously get altered by the JavaScript-oriented filters:
7756 # And this stupid host sends streaming video with a wrong MIME type,
7757 # so that Privoxy thinks it is getting HTML and starts filtering:
7759 stupid-server.example.com/</PRE
7765 > Example of a simple <A
7766 HREF="actions-file.html#BLOCK"
7768 > action. Say you've
7769 seen an ad on your favourite page on example.com that you want to get rid of.
7770 You have right-clicked the image, selected <SPAN
7772 >"copy image location"</SPAN
7774 and pasted the URL below while removing the leading http://, into a
7778 > section. Note that <TT
7782 > need not be specified, since all URLs ending in
7786 > will be tagged as images by the general rules as set
7787 in default.action anyway:</P
7798 HREF="actions-file.html#BLOCK"
7801 www.example.com/nasty-ads/sponsor.gif
7802 another.popular.site.net/more/junk/here/</PRE
7808 > The URLs of dynamically generated banners, especially from large banner
7809 farms, often don't use the well-known image file name extensions, which
7810 makes it impossible for <SPAN
7814 the file type just by looking at the URL.
7817 >+block-as-image</TT
7818 > alias defined above for
7820 Note that objects which match this rule but then turn out NOT to be an
7821 image are typically rendered as a <SPAN
7823 >"broken image"</SPAN
7825 browser. Use cautiously.</P
7835 >{ +block-as-image }
7844 > Now you noticed that the default configuration breaks Forbes Magazine,
7845 but you were too lazy to find out which action is the culprit, and you
7846 were again too lazy to give <A
7850 you just used the <TT
7853 > alias on the site, and
7860 > -- it worked. The <TT
7864 aliases disables those actions that are most likely to break a site. Also,
7865 good for testing purposes to see if it is <SPAN
7869 that is causing the problem or not.</P
7886 > You like the <SPAN
7889 > text replacements in <TT
7893 but it is disabled in the distributed actions file. (My colleagues on the team just
7894 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
7895 update-safe config, once and for all:</P
7906 HREF="actions-file.html#FILTER-FUN"
7909 / # For ALL sites!</PRE
7915 > Note that the above is not really a good idea: There are exceptions
7916 to the filters in <TT
7920 really shouldn't be filtered, like code on CVS->Web interfaces. Since
7924 > has the last word, these exceptions
7925 won't be valid for the <SPAN
7928 > filtering specified here.</P
7930 > You might also worry about how your favourite free websites are
7931 funded, and find that they rely on displaying banner advertisements
7932 to survive. So you might want to specifically allow banners for those
7933 sites that you feel provide value to you:</P
7955 > has been aliased to
7959 HREF="actions-file.html#BLOCK"
7966 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
7967 >filter{banners-by-size}</A
7973 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
7974 >filter{banners-by-link}</A
7978 > Invoke another alias here to force an over-ride of the MIME type <TT
7980 > application/x-sh</TT
7981 > which typically would open a download type
7982 dialog. In my case, I want to look at the shell script, and then I can save
7983 it should I choose to.</P
8003 > is generally the best place to define
8004 exceptions and additions to the default policies of
8008 >. Some actions are safe to have their
8009 default policies set here though. So let's set a default policy to have a
8013 > image as opposed to the checkerboard pattern for
8023 > of course matches all URL
8024 paths and patterns:</P
8035 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8036 >set-image-blocker{blank}</A
8051 SUMMARY="Footer navigation table"
8080 HREF="filter-file.html"
8090 >The Main Configuration File</TD