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
21 <LINK REL="STYLESHEET" TYPE="text/css" HREF="p_doc.css">
33 SUMMARY="Header navigation table"
42 >Privoxy 3.0.4 User Manual</TH
64 HREF="filter-file.html"
82 > The actions files are used to define what <SPAN
92 > takes for which URLs, and thus determines
93 how ad images, cookies and various other aspects of HTTP content and
94 transactions are handled, and on which sites (or even parts thereof).
95 There are a number of such actions, with a wide range of functionality.
96 Each action does something a little different.
97 These actions give us a veritable arsenal of tools with which to exert
98 our control, preferences and independence.</P
101 are three action files included with <SPAN
116 > - is the primary action file
117 that sets the initial values for all actions. It is intended to
118 provide a base level of functionality for
122 > array of features. So it is
123 a set of broad rules that should work reasonably well for users everywhere.
124 This is the file that the developers are keeping updated, and <A
125 HREF="installation.html#INSTALLATION-KEEPUPDATED"
126 >making available to users</A
135 > - is intended to be for local site
136 preferences and exceptions. As an example, if your ISP or your bank
137 has specific requirements, and need special handling, this kind of
138 thing should go here. This file will not be upgraded.
146 > - is used by the web based editor,
147 to set various pre-defined sets of rules for the default actions section
151 >. These have increasing levels of
156 >and have no influence on your browsing unless
157 you select them explicitly in the editor</I
159 >. It is not recommend
163 > The default profiles, and their associated actions, as pre-defined in
177 >Table 1. Default Configurations</B
212 >Ad-blocking by URL</TD
234 >Ad-filtering by size</TD
256 >GIF de-animation</TD
388 >JavaScript taming</TD
432 >Fun text replacements</TD
454 >Image tag reordering</TD
476 >Ad-filtering by link</TD
525 > The list of actions files to be used are defined in the main configuration
526 file, and are processed in the order they are defined (e.g.
530 > is typically process before
534 >). The content of these can all be viewed and
536 HREF="http://config.privoxy.org/show-status"
538 >http://config.privoxy.org/show-status</A
541 > An actions file typically has multiple sections. If you want to use
545 > in an actions file, you have to place the (optional)
547 HREF="actions-file.html#ALIASES"
549 > at the top of that file.
550 Then comes the default set of rules which will apply universally to all
551 sites and pages (be <SPAN
561 > or any other actions file after
565 >, because it will override the result
566 from consulting any previous file). And then below that,
567 exceptions to the defined universal policies. You can regard
571 > as an appendix to <TT
575 with the advantage that is a separate file, which makes preserving your
576 personal settings across <SPAN
579 > upgrades easier.</P
582 Actions can be used to block anything you want, including ads, banners, or
583 just some obnoxious URL that you would rather not see. Cookies can be accepted
584 or rejected, or accepted only during the current browser session (i.e. not
585 written to disk), content can be modified, JavaScripts tamed, user-tracking
586 fooled, and much more. See below for a <A
587 HREF="actions-file.html#ACTIONS"
598 >8.1. Finding the Right Mix</H2
601 HREF="actions-file.html#ACTIONS"
603 >, like cookie suppression
604 or script disabling, may render some sites unusable that rely on these
605 techniques to work properly. Finding the right mix of actions is not always easy and
606 certainly a matter of personal taste. In general, it can be said that the more
610 > your default settings (in the top section of the
611 actions file) are, the more exceptions for <SPAN
615 will have to make later. If, for example, you want to crunch all cookies per
616 default, you'll have to make exceptions from that rule for sites that you
617 regularly use and that require cookies for actually useful puposes, like maybe
618 your bank, favorite shop, or newspaper. </P
620 > We have tried to provide you with reasonable rules to start from in the
621 distribution actions files. But there is no general rule of thumb on these
622 things. There just are too many variables, and sites are constantly changing.
623 Sooner or later you will want to change the rules (and read this chapter again :).</P
632 >8.2. How to Edit</H2
634 > The easiest way to edit the actions files is with a browser by
635 using our browser-based editor, which can be reached from <A
636 HREF="http://config.privoxy.org/show-status"
638 >http://config.privoxy.org/show-status</A
640 The editor allows both fine-grained control over every single feature on a
641 per-URL basis, and easy choosing from wholesale sets of defaults like
650 >"Adventuresome"</SPAN
654 >"Adventuresome"</SPAN
655 > setting is not only more aggressive,
656 but includes settings that are fun and subversive, and which some may find of
659 > If you prefer plain text editing to GUIs, you can of course also directly edit the
660 the actions files. Look at <TT
673 >8.3. How Actions are Applied to URLs</H2
675 > Actions files are divided into sections. There are special sections,
679 HREF="actions-file.html#ALIASES"
682 > sections which will
683 be discussed later. For now let's concentrate on regular sections: They have a
684 heading line (often split up to multiple lines for readability) which consist
685 of a list of actions, separated by whitespace and enclosed in curly braces.
686 Below that, there is a list of URL patterns, each on a separate line.</P
688 > To determine which actions apply to a request, the URL of the request is
689 compared to all patterns in each <SPAN
692 > file. Every time it matches, the list of
693 applicable actions for the URL is incrementally updated, using the heading
694 of the section in which the pattern is located. If multiple matches for
695 the same URL set the same action differently, the last match wins. If not,
696 the effects are aggregated. E.g. a URL might match a regular section with
697 a heading line of <TT
701 HREF="actions-file.html#HANDLE-AS-IMAGE"
705 then later another one with just <TT
709 HREF="actions-file.html#BLOCK"
719 > actions to apply.</P
721 > You can trace this process for any given URL by visiting <A
722 HREF="http://config.privoxy.org/show-url-info"
724 >http://config.privoxy.org/show-url-info</A
727 > More detail on this is provided in the Appendix, <A
728 HREF="appendix.html#ACTIONSANAT"
729 > Anatomy of an Action</A
749 to determine what actions might apply to which sites and pages your browser
750 attempts to access. These <SPAN
760 > matching to achieve a high degree of
761 flexibility. This allows one expression to be expanded and potentially match
762 against many similar patterns.</P
767 > pattern has the form
770 ><domain>/<path></TT
774 ><domain></TT
779 optional. (This is why the special <TT
782 > pattern matches all
783 URLs). Note that the protocol portion of the URL pattern (e.g.
794 the pattern. This is assumed already!</P
803 >www.example.com/</TT
807 > is a domain-only pattern and will match any request to <TT
811 regardless of which document on that server is requested.
821 > means exactly the same. For domain-only patterns, the trailing <TT
831 >www.example.com/index.html</TT
835 > matches only the single document <TT
852 > matches the document <TT
855 >, regardless of the domain,
872 > matches nothing, since it would be interpreted as a domain name and
873 there is no top-level domain called <TT
888 >8.4.1. The Domain Pattern</H3
890 > The matching of the domain part offers some flexible options: if the
891 domain starts or ends with a dot, it becomes unanchored at that end.
905 > matches any domain that <SPAN
925 > matches any domain that <SPAN
945 > matches any domain that <SPAN
955 (Correctly speaking: It matches any FQDN that contains <TT
964 > Additionally, there are wild-cards that you can use in the domain names
965 themselves. They work pretty similar to shell wild-cards: <SPAN
969 stands for zero or more arbitrary characters, <SPAN
973 any single character, you can define character classes in square
974 brackets and all of that can be freely mixed:</P
989 >"adserver.example.com"</SPAN
993 >"ads.example.com"</SPAN
996 >"sfads.example.com"</SPAN
1003 >*ad*.example.com</TT
1007 > matches all of the above, and then some.
1023 >pictures.epix.com</TT
1026 >a.b.c.d.e.upix.com</TT
1033 >www[1-9a-ez].example.c*</TT
1039 >www1.example.com</TT
1043 >www4.example.cc</TT
1046 >wwwd.example.cy</TT
1050 >wwwz.example.com</TT
1060 >wwww.example.com</TT
1074 >8.4.2. The Path Pattern</H3
1079 > uses Perl compatible regular expressions
1081 HREF="http://www.pcre.org/"
1085 matching the path.</P
1088 HREF="appendix.html#REGEX"
1090 > with a brief quick-start into regular
1091 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
1093 HREF="http://www.pcre.org/man.txt"
1095 >http://www.pcre.org/man.txt</A
1097 You might also find the Perl man page on regular expressions (<TT
1101 useful, which is available on-line at <A
1102 HREF="http://perldoc.perl.org/perlre.html"
1104 >http://perldoc.perl.org/perlre.html</A
1107 > Note that the path pattern is automatically left-anchored at the <SPAN
1111 i.e. it matches as if it would start with a <SPAN
1114 > (regular expression speak
1115 for the beginning of a line).</P
1117 > Please also note that matching in the path is <SPAN
1121 >CASE INSENSITIVE</I
1124 by default, but you can switch to case sensitive at any point in the pattern by using the
1130 >www.example.com/(?-i)PaTtErN.*</TT
1132 only documents whose path starts with <TT
1142 > this capitalization.</P
1154 > All actions are disabled by default, until they are explicitly enabled
1155 somewhere in an actions file. Actions are turned on if preceded with a
1159 >, and turned off if preceded with a <SPAN
1168 >"do that action"</SPAN
1175 >"please block URLs that match the
1176 following patterns"</SPAN
1183 block URLs that match the following patterns, even if <TT
1187 previously applied."</SPAN
1191 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1192 separated by whitespace, like in
1195 >{+some-action -some-other-action{some-parameter}}</TT
1197 followed by a list of URL patterns, one per line, to which they apply.
1198 Together, the actions line and the following pattern lines make up a section
1199 of the actions file. </P
1202 There are three classes of actions:</P
1210 Boolean, i.e the action can only be <SPAN
1233 > # enable action <TT
1244 > # disable action <TT
1266 Parameterized, where some value is required in order to enable this type of action.
1288 >} # enable action and set parameter to <TT
1294 # overwriting parameter from previous match if necessary
1300 > # disable action. The parameter can be omitted</PRE
1307 > Note that if the URL matches multiple positive forms of a parameterized action,
1308 the last match wins, i.e. the params from earlier matches are simply ignored.
1314 >+hide-user-agent{ Mozilla 1.0 }</TT
1321 Multi-value. These look exactly like parameterized actions,
1322 but they behave differently: If the action applies multiple times to the
1323 same URL, but with different parameters, <SPAN
1336 > matches are remembered. This is used for actions
1337 that can be executed for the same request repeatedly, like adding multiple
1338 headers, or filtering through multiple filters. Syntax:
1359 >} # enable action and add <TT
1364 > to the list of parameters
1375 >} # remove the parameter <TT
1380 > from the list of parameters
1381 # If it was the last one left, disable the action.
1387 > # disable this action completely and remove all parameters from the list</PRE
1397 >+add-header{X-Fun-Header: Some text}</TT
1401 >+filter{html-annoyances}</TT
1408 > If nothing is specified in any actions file, no <SPAN
1412 taken. So in this case <SPAN
1416 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
1417 privacy and blocking features you need (although the provided default actions
1418 files will give a good starting point).</P
1420 > Later defined actions always over-ride earlier ones. So exceptions
1421 to any rules you make, should come in the latter part of the file (or
1422 in a file that is processed later when using multiple actions files). For
1423 multi-valued actions, the actions are applied in the order they are specified.
1424 Actions files are processed in the order they are defined in
1428 > (the default installation has three actions
1429 files). It also quite possible for any given URL pattern to match more than
1430 one pattern and thus more than one set of actions!</P
1432 > The list of valid <SPAN
1443 >8.5.1. add-header</H4
1447 CLASS="VARIABLELIST"
1453 >Confuse log analysis, custom applications</P
1459 > Sends a user defined HTTP header to the web server.
1472 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1473 It is recommended that you use the <SPAN
1487 > This action may be specified multiple times, in order to define multiple
1488 headers. This is rarely needed for the typical user. If you don't know what
1491 >"HTTP headers"</SPAN
1492 > are, you definitely don't need to worry about this
1508 >+add-header{X-User-Tracking: sucks}</PRE
1529 CLASS="VARIABLELIST"
1535 >Block ads or other obnoxious content</P
1541 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1542 forwarded to the remote server, but answered locally with a substitute page or image,
1543 as determined by the <TT
1546 HREF="actions-file.html#HANDLE-AS-IMAGE"
1553 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1554 >set-image-blocker</A
1578 > sends a special <SPAN
1582 for requests to blocked pages. This page contains links to find out why the request
1583 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1584 force feature enabled). The <SPAN
1587 > page adapts to the available
1588 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1589 if loaded into a small frame or window. If you are using <SPAN
1593 right now, you can take a look at the
1595 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1606 A very important exception occurs if <SPAN
1619 HREF="actions-file.html#HANDLE-AS-IMAGE"
1623 apply to the same request: it will then be replaced by an image. If
1627 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1628 >set-image-blocker</A
1631 (see below) also applies, the type of image will be determined by its parameter,
1632 if not, the standard checkerboard pattern is sent.
1635 > It is important to understand this process, in order
1636 to understand how <SPAN
1640 ads and other unwanted content.
1646 HREF="actions-file.html#FILTER"
1650 action can perform a very similar task, by <SPAN
1654 banner images and other content through rewriting the relevant URLs in the
1655 document's HTML source, so they don't get requested in the first place.
1656 Note that this is a totally different technique, and it's easy to confuse the two.
1660 >Example usage (section):</DT
1671 >{+block} # Block and replace with "blocked" page
1672 .nasty-stuff.example.com
1674 {+block +handle-as-image} # Block and replace with image
1691 NAME="CONTENT-TYPE-OVERWRITE"
1693 >8.5.3. content-type-overwrite</H4
1697 CLASS="VARIABLELIST"
1703 >Stop useless download menus from popping up, or change the browser's rendering mode</P
1709 > Replaces the <SPAN
1711 >"Content-Type:"</SPAN
1712 > HTTP server header.
1734 >"Content-Type:"</SPAN
1735 > HTTP server header is used by the
1736 browser to decide what to do with the document. The value of this
1737 header can cause the browser to open a download menu instead of
1738 displaying the document by itself, even if the document's format is
1739 supported by the browser.
1742 > The declared content type can also affect which rendering mode
1743 the browser chooses. If XHTML is delivered as <SPAN
1747 many browsers treat it as yet another broken HTML document.
1748 If it is send as <SPAN
1750 >"application/xml"</SPAN
1752 XHTML support will only display it, if the syntax is correct.
1755 > If you see a web site that proudly uses XHTML buttons, but sets
1758 >"Content-Type: text/html"</SPAN
1759 >, you can use Privoxy
1760 to overwrite it with <SPAN
1762 >"application/xml"</SPAN
1764 the web master's claim inside your XHTML-supporting browser.
1765 If the syntax is incorrect, the browser will complain loudly.
1768 > You can also go the opposite direction: if your browser prints
1769 error messages instead of rendering a document falsely declared
1770 as XHTML, you can overwrite the content type with
1774 > and have it rendered as broken HTML document.
1779 >content-type-overwrite</TT
1783 >"Content-Type:"</SPAN
1784 > headers that look like some kind of text.
1785 If you want to overwrite it unconditionally, you have to combine it with
1789 HREF="actions-file.html#FORCE-TEXT-MODE"
1793 This limitation exists for a reason, think twice before circumventing it.
1796 > Most of the time it's easier to enable
1800 HREF="actions-file.html#FILTER-SERVER-HEADERS"
1801 >filter-server-headers</A
1804 and replace this action with a custom regular expression. It allows you
1805 to activate it for every document of a certain site and it will still
1806 only replace the content types you aimed at.
1809 > Of course you can apply <TT
1811 >content-type-overwrite</TT
1813 to a whole site and then make URL based exceptions, but it's a lot
1814 more work to get the same precision.
1818 >Example usage (sections):</DT
1829 ># Check if www.example.net/ really uses valid XHTML
1830 {+content-type-overwrite {application/xml}}
1832 # but leave the content type unmodified if the URL looks like a style sheet
1833 {-content-type-overwrite}
1834 www.example.net/*.\.css$
1835 www.example.net/*.style</PRE
1850 NAME="CRUNCH-CLIENT-HEADER"
1852 >8.5.4. crunch-client-header</H4
1856 CLASS="VARIABLELIST"
1862 >Remove a client header <SPAN
1865 > has no dedicated action for.</P
1871 > Deletes every header sent by the client that contains the string the user supplied as parameter.
1891 > This action allows you to block client headers for which no dedicated
1899 > will remove every client header that
1900 contains the string you supplied as parameter.
1903 > Regular expressions are <SPAN
1910 use this action to block different headers in the same request, unless
1911 they contain the same string.
1916 >crunch-client-header</TT
1917 > is only meant for quick tests.
1918 If you have to block several different headers, or only want to modify
1919 parts of them, you should enable
1923 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
1924 >filter-client-headers</A
1927 and create your own filter.
1948 > Don't block any header without understanding the consequences.
1956 >Example usage (section):</DT
1967 ># Block the non-existent "Privacy-Violation:" client header
1968 {+crunch-client-header {Privacy-Violation:}}
1985 NAME="CRUNCH-IF-NONE-MATCH"
1987 >8.5.5. crunch-if-none-match</H4
1991 CLASS="VARIABLELIST"
1997 >Prevent yet another way to track the user's steps between sessions.</P
2005 >"If-None-Match:"</SPAN
2006 > HTTP client header.
2026 > Removing the <SPAN
2028 >"If-None-Match:"</SPAN
2029 > HTTP client header
2030 is useful for filter testing, where you want to force a real
2031 reload instead of getting status code <SPAN
2035 would cause the browser to use a cached copy of the page.
2038 > It is also useful to make sure the header isn't used as a cookie
2042 > Blocking the <SPAN
2044 >"If-None-Match:"</SPAN
2045 > header shouldn't cause any
2046 caching problems, as long as the <SPAN
2048 >"If-Modified-Since:"</SPAN
2050 isn't blocked as well.
2053 > It is recommended to use this action together with
2057 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2058 >hide-if-modified-since</A
2065 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2066 >overwrite-last-modified</A
2072 >Example usage (section):</DT
2083 ># Let the browser revalidate cached documents without being tracked across sessions
2084 {+hide-if-modified-since {-1} \
2085 +overwrite-last-modified {randomize} \
2086 +crunch-if-none-match}
2102 NAME="CRUNCH-INCOMING-COOKIES"
2104 >8.5.6. crunch-incoming-cookies</H4
2108 CLASS="VARIABLELIST"
2114 > Prevent the web server from setting any cookies on your system
2123 >"Set-Cookie:"</SPAN
2124 > HTTP headers from server replies.
2144 > This action is only concerned with <SPAN
2161 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2162 >crunch-outgoing-cookies</A
2171 > to disable cookies completely.
2180 > to use this action in conjunction
2184 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2185 >session-cookies-only</A
2188 since it would prevent the session cookies from being set. See also
2192 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2193 >filter-content-cookies</A
2210 >+crunch-incoming-cookies</PRE
2225 NAME="CRUNCH-SERVER-HEADER"
2227 >8.5.7. crunch-server-header</H4
2231 CLASS="VARIABLELIST"
2237 >Remove a server header <SPAN
2240 > has no dedicated action for.</P
2246 > Deletes every header sent by the server that contains the string the user supplied as parameter.
2266 > This action allows you to block server headers for which no dedicated
2270 > action exists. <SPAN
2274 will remove every server header that contains the string you supplied as parameter.
2277 > Regular expressions are <SPAN
2284 use this action to block different headers in the same request, unless
2285 they contain the same string.
2290 >crunch-server-header</TT
2291 > is only meant for quick tests.
2292 If you have to block several different headers, or only want to modify
2293 parts of them, you should enable
2297 HREF="actions-file.html#FILTER-SERVER-HEADERS"
2298 >filter-server-headers</A
2301 and create your own filter.
2322 > Don't block any header without understanding the consequences.
2330 >Example usage (section):</DT
2341 ># Crunch server headers that try to prevent caching
2342 {+crunch-server-header {no-cache}}
2358 NAME="CRUNCH-OUTGOING-COOKIES"
2360 >8.5.8. crunch-outgoing-cookies</H4
2364 CLASS="VARIABLELIST"
2370 > Prevent the web server from reading any cookies from your system
2380 > HTTP headers from client requests.
2400 > This action is only concerned with <SPAN
2417 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
2418 >crunch-incoming-cookies</A
2427 > to disable cookies completely.
2436 > to use this action in conjunction
2440 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2441 >session-cookies-only</A
2444 since it would prevent the session cookies from being read.
2459 >+crunch-outgoing-cookies</PRE
2474 NAME="DEANIMATE-GIFS"
2476 >8.5.9. deanimate-gifs</H4
2480 CLASS="VARIABLELIST"
2486 >Stop those annoying, distracting animated GIF images.</P
2492 > De-animate GIF animations, i.e. reduce them to their first or last image.
2518 > This will also shrink the images considerably (in bytes, not pixels!). If
2522 > is given, the first frame of the animation
2523 is used as the replacement. If <SPAN
2526 > is given, the last
2527 frame of the animation is used instead, which probably makes more sense for
2528 most banner animations, but also has the risk of not showing the entire
2529 last frame (if it is only a delta to an earlier frame).
2532 > You can safely use this action with patterns that will also match non-GIF
2533 objects, because no attempt will be made at anything that doesn't look like
2549 >+deanimate-gifs{last}</PRE
2564 NAME="DOWNGRADE-HTTP-VERSION"
2566 >8.5.10. downgrade-http-version</H4
2570 CLASS="VARIABLELIST"
2576 >Work around (very rare) problems with HTTP/1.1</P
2582 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
2602 > This is a left-over from the time when <SPAN
2606 didn't support important HTTP/1.1 features well. It is left here for the
2607 unlikely case that you experience HTTP/1.1 related problems with some server
2608 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
2609 is a chance you might need this action.
2613 >Example usage (section):</DT
2624 >{+downgrade-http-version}
2625 problem-host.example.com</PRE
2640 NAME="FAST-REDIRECTS"
2642 >8.5.11. fast-redirects</H4
2646 CLASS="VARIABLELIST"
2652 >Fool some click-tracking scripts and speed up indirect links.</P
2658 > Detects redirection URLs and redirects the browser without contacting
2659 the redirection server first.
2678 >"simple-check"</SPAN
2679 > to just search for the string <SPAN
2683 to detect redirection URLs.
2690 >"check-decoded-url"</SPAN
2691 > to decode URLs (if necessary) before searching
2692 for redirection URLs.
2702 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2703 will link to some script on their own servers, giving the destination as a
2704 parameter, which will then redirect you to the final target. URLs
2705 resulting from this scheme typically look like:
2708 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
2712 > Sometimes, there are even multiple consecutive redirects encoded in the
2713 URL. These redirections via scripts make your web browsing more traceable,
2714 since the server from which you follow such a link can see where you go
2715 to. Apart from that, valuable bandwidth and time is wasted, while your
2716 browser asks the server for one redirect after the other. Plus, it feeds
2720 > This feature is currently not very smart and is scheduled for improvement.
2721 If it is enabled by default, you will have to create some exceptions to
2722 this action. It can lead to failures in several ways:
2725 > Not every URLs with other URLs as parameters is evil.
2726 Some sites offer a real service that requires this information to work.
2727 For example a validation service needs to know, which document to validate.
2731 > assumes that every URL parameter that
2732 looks like another URL is a redirection target, and will always redirect to
2733 the last one. Most of the time the assumption is correct, but if it isn't,
2734 the user gets redirected anyway.
2737 > Another failure occurs if the URL contains other parameters after the URL parameter.
2741 >"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</SPAN
2743 contains the redirection URL <SPAN
2745 >"http://www.example.net/"</SPAN
2747 followed by another parameter. <TT
2751 and will cause a redirect to <SPAN
2753 >"http://www.example.net/&foo=bar"</SPAN
2755 Depending on the target server configuration, the parameter will be silently ignored
2758 >"page not found"</SPAN
2759 > error. It is possible to fix these redirected
2763 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
2764 >filter-client-headers</A
2767 but it requires a little effort.
2770 > To detect a redirection URL, <TT
2774 looks for the string <SPAN
2777 >, either in plain text
2778 (invalid but often used) or encoded as <SPAN
2782 Some sites use their own URL encoding scheme, encrypt the address
2783 of the target server or replace it with a database id. In theses cases
2787 > is fooled and the request reaches the
2788 redirection server where it probably gets logged.
2803 >+fast-redirects{simple-check}</PRE
2818 >+fast-redirects{check-decoded-url}</PRE
2839 CLASS="VARIABLELIST"
2845 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
2851 > All files of text-based type, most notably HTML and JavaScript, to which this
2852 action applies, are filtered on-the-fly through the specified regular expression
2853 based substitutions. (Note: as of version 3.0.3 plain text documents
2854 are exempted from filtering, because web servers often use the
2858 > MIME type for all files whose type they
2859 don't know.) By default, filtering works only on the document content
2860 itself, not the headers.
2873 > The name of a filter, as defined in the <A
2874 HREF="filter-file.html"
2877 Filters can be defined in one or more files as defined by the
2881 HREF="config.html#FILTERFILE"
2892 > is the collection of filters
2893 supplied by the developers. Locally defined filters should go
2894 in their own file, such as <TT
2900 > When used in its negative form,
2901 and without parameters, filtering is completely disabled.
2908 > For your convenience, there are a number of pre-defined filters available
2909 in the distribution filter file that you can use. See the examples below for
2913 > Filtering requires buffering the page content, which may appear to
2914 slow down page rendering since nothing is displayed until all content has
2915 passed the filters. (It does not really take longer, but seems that way
2916 since the page is not incrementally displayed.) This effect will be more
2917 noticeable on slower connections.
2920 > This is very powerful feature, and <SPAN
2922 >"rolling your own"</SPAN
2924 filters requires a knowledge of regular expressions and HTML.
2927 > The amount of data that can be filtered is limited to the
2931 HREF="config.html#BUFFER-LIMIT"
2935 option in the main <A
2939 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2940 data, and all pending data, is passed through unfiltered.
2943 > Inadequate MIME types, such as zipped files, are not filtered at all.
2944 (Again, only text-based types except plain text). Encrypted SSL data
2945 (from HTTPS servers) cannot be filtered either, since this would violate
2946 the integrity of the secure transaction. In some situations it might
2947 be necessary to protect certain text, like source code, from filtering
2948 by defining appropriate <TT
2954 > At this time, <SPAN
2957 > cannot (yet!) uncompress compressed
2958 documents. If you want filtering to work on all documents, even those that
2959 would normally be sent compressed, use the
2963 HREF="actions-file.html#PREVENT-COMPRESSION"
2964 >prevent-compression</A
2967 action in conjunction with <TT
2973 > Filtering can achieve some of the same effects as the
2977 HREF="actions-file.html#BLOCK"
2981 action, i.e. it can be used to block ads and banners. But the mechanism
2982 works quite differently. One effective use, is to block ad banners
2983 based on their size (see below), since many of these seem to be somewhat
2990 > with suggestions for new or
2991 improved filters is particularly welcome!
2994 > The below list has only the names and a one-line description of each
2995 predefined filter. There are <A
2996 HREF="filter-file.html#PREDEFINED-FILTERS"
2998 verbose explanations</A
2999 > of what these filters do in the <A
3000 HREF="filter-file.html"
3001 >filter file chapter</A
3006 >Example usage (with filters from the distribution <TT
3011 HREF="filter-file.html#PREDEFINED-FILTERS"
3012 >the Predefined Filters section</A
3014 more explanation on each:</DT
3018 NAME="FILTER-JS-ANNOYANCES"
3029 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
3037 NAME="FILTER-JS-EVENTS"
3048 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
3056 NAME="FILTER-HTML-ANNOYANCES"
3067 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
3075 NAME="FILTER-CONTENT-COOKIES"
3086 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
3094 NAME="FILTER-REFRESH-TAGS"
3105 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
3113 NAME="FILTER-UNSOLICITED-POPUPS"
3124 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
3132 NAME="FILTER-ALL-POPUPS"
3143 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
3151 NAME="FILTER-IMG-REORDER"
3162 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
3170 NAME="FILTER-BANNERS-BY-SIZE"
3181 >+filter{banners-by-size} # Kill banners by size</PRE
3189 NAME="FILTER-BANNERS-BY-LINK"
3200 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
3208 NAME="FILTER-WEBBUGS"
3219 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
3227 NAME="FILTER-TINY-TEXTFORMS"
3238 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
3246 NAME="FILTER-JUMPING-WINDOWS"
3257 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
3265 NAME="FILTER-FRAMESET-BORDERS"
3276 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
3284 NAME="FILTER-DEMORONIZER"
3295 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
3303 NAME="FILTER-SHOCKWAVE-FLASH"
3314 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
3322 NAME="FILTER-QUICKTIME-KIOSKMODE"
3333 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
3352 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
3360 NAME="FILTER-CRUDE-PARENTAL"
3371 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
3379 NAME="FILTER-IE-EXPLOITS"
3390 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
3405 NAME="FILTER-CLIENT-HEADERS"
3407 >8.5.13. filter-client-headers</H4
3411 CLASS="VARIABLELIST"
3417 > To apply filtering to the client's (browser's) headers
3427 > filters only apply
3428 to the document content itself. This will extend those filters to
3429 include the client's headers as well.
3449 > Regular expressions can be used to filter headers as well. Check your
3450 filters closely before activating this action, as it can easily lead to broken
3455 These filters are applied to each header on its own, not to them
3456 all at once. This makes it easier to diagnose problems, but on the downside
3457 you can't write filters that only change header x if header y's value is
3461 > The filters are used after the other header actions have finished and can
3462 use their output as input.
3465 > Whenever possible one should specify <TT
3472 >, the whole header name and the colon, to make sure
3473 the filter doesn't cause havoc to other headers or the
3474 page itself. For example if you want to transform
3493 >s@Galeon/\d\.\d\.\d @@</PRE
3509 >s@^(User-Agent:.*) Galeon/\d\.\d\.\d (Firefox/\d\.\d\.\d\.\d)$@$1 $2@</PRE
3516 >Example usage (section):</DT
3527 >{+filter-client-headers +filter{test_filter}}
3528 problem-host.example.com
3544 NAME="FILTER-SERVER-HEADERS"
3546 >8.5.14. filter-server-headers</H4
3550 CLASS="VARIABLELIST"
3556 > To apply filtering to the server's headers
3566 > filters only apply
3567 to the document content itself. This will extend those filters to
3568 include the server's headers as well.
3590 >filter-client-headers</TT
3592 the server instead. To filter both server and client, use both.
3597 >filter-client-headers</TT
3599 filters before activating this action, as it can easily lead to broken
3604 These filters are applied to each header on its own, not to them
3605 all at once. This makes it easier to diagnose problems, but on the downside
3606 you can't write filters that only change header x if header y's value is
3610 > The filters are used after the other header actions have finished and can
3611 use their output as input.
3614 > Remember too, whenever possible one should specify <TT
3621 >, the whole header name and the colon, to make sure
3622 the filter doesn't cause havoc to other headers or the
3623 page itself. See above for example.
3627 >Example usage (section):</DT
3638 >{+filter-server-headers +filter{test_filter}}
3639 problem-host.example.com
3655 NAME="FORCE-TEXT-MODE"
3657 >8.5.15. force-text-mode</H4
3661 CLASS="VARIABLELIST"
3670 > to treat a document as if it was in some kind of <SPAN
3682 > Declares a document as text, even if the <SPAN
3684 >"Content-Type:"</SPAN
3685 > isn't detected as such.
3708 HREF="actions-file.html#FILTER"
3715 > tries to only filter files that are
3716 in some kind of text format. The same restrictions apply to
3720 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3721 >content-type-overwrite</A
3726 >force-text-mode</TT
3727 > declares a document as text,
3728 without looking at the <SPAN
3730 >"Content-Type:"</SPAN
3752 > Think twice before activating this action. Filtering binary data
3753 with regular expressions can cause file damage.
3788 NAME="HANDLE-AS-EMPTY-DOCUMENT"
3790 >8.5.16. handle-as-empty-document</H4
3794 CLASS="VARIABLELIST"
3800 >Mark URLs that should be replaced by empty documents <SPAN
3804 >if they get blocked</I
3812 > This action alone doesn't do anything noticeable. It just marks URLs.
3816 HREF="actions-file.html#BLOCK"
3826 the presence or absence of this mark decides whether an HTML <SPAN
3830 page, or an empty document will be sent to the client as a substitute for the blocked content.
3837 > document isn't literally empty, but actually contains a single space.
3857 > Some browsers complain about syntax errors if JavaScript documents
3858 are blocked with <SPAN
3862 default HTML page; this option can be used to silence them.
3865 > The content type for the empty document can be specified with
3869 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3870 >content-type-overwrite{}</A
3873 but usually this isn't necessary.
3888 ># Block all documents on example.org that end with ".js",
3889 # but send an empty document instead of the usual HTML message.
3890 {+block +handle-as-empty-document}
3907 NAME="HANDLE-AS-IMAGE"
3909 >8.5.17. handle-as-image</H4
3913 CLASS="VARIABLELIST"
3919 >Mark URLs as belonging to images (so they'll be replaced by imagee <SPAN
3923 >if they get blocked</I
3931 > This action alone doesn't do anything noticeable. It just marks URLs as images.
3935 HREF="actions-file.html#BLOCK"
3945 the presence or absence of this mark decides whether an HTML <SPAN
3949 page, or a replacement image (as determined by the <TT
3952 HREF="actions-file.html#SET-IMAGE-BLOCKER"
3953 >set-image-blocker</A
3955 > action) will be sent to the
3956 client as a substitute for the blocked content.
3976 > The below generic example section is actually part of <TT
3980 It marks all URLs with well-known image file name extensions as images and should
3984 > Users will probably only want to use the handle-as-image action in conjunction with
3988 HREF="actions-file.html#BLOCK"
3991 >, to block sources of banners, whose URLs don't
3992 reflect the file type, like in the second example section.
3995 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
3996 frames require an HTML page to be sent, or they won't display properly.
3999 >handle-as-image</TT
4000 > in this situation will not replace the
4001 ad frame with an image, but lead to error messages.
4005 >Example usage (sections):</DT
4016 ># Generic image extensions:
4019 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4021 # These don't look like images, but they're banners and should be
4022 # blocked as images:
4024 {+block +handle-as-image}
4025 some.nasty-banner-server.com/junk.cgi?output=trash
4027 # Banner source! Who cares if they also have non-image content?
4028 ad.doubleclick.net </PRE
4043 NAME="HIDE-ACCEPT-LANGUAGE"
4045 >8.5.18. hide-accept-language</H4
4049 CLASS="VARIABLELIST"
4055 >Pretend to use different language settings.</P
4061 > Deletes or replaces the <SPAN
4063 >"Accept-Language:"</SPAN
4064 > HTTP header in client requests.
4080 >, or any user defined value.
4087 > Faking the browser's language settings can be useful to make a
4088 foreign User-Agent set with
4092 HREF="actions-file.html#HIDE-USER-AGENT"
4099 > However some sites with content in different languages check the
4102 >"Accept-Language:"</SPAN
4103 > to decide which one to take by default.
4104 Sometimes it isn't possible to later switch to another language without
4107 >"Accept-Language:"</SPAN
4111 > Therefore it's a good idea to either only change the
4114 >"Accept-Language:"</SPAN
4115 > header to languages you understand,
4116 or to languages that aren't wide spread.
4119 > Before setting the <SPAN
4121 >"Accept-Language:"</SPAN
4123 to a rare language, you should consider that it helps to
4124 make your requests unique and thus easier to trace.
4125 If you don't plan to change this header frequently,
4126 you should stick to a common language.
4130 >Example usage (section):</DT
4141 ># Pretend to use Canadian language settings.
4142 {+hide-accept-language{en-ca} \
4143 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4160 NAME="HIDE-CONTENT-DISPOSITION"
4162 >8.5.19. hide-content-disposition</H4
4166 CLASS="VARIABLELIST"
4172 >Prevent download menus for content you prefer to view inside the browser.</P
4178 > Deletes or replaces the <SPAN
4180 >"Content-Disposition:"</SPAN
4181 > HTTP header set by some servers.
4197 >, or any user defined value.
4204 > Some servers set the <SPAN
4206 >"Content-Disposition:"</SPAN
4208 documents they assume you want to save locally before viewing them.
4211 >"Content-Disposition:"</SPAN
4212 > header contains the file name
4213 the browser is supposed to use by default.
4216 > In most browsers that understand this header, it makes it impossible to
4223 > the document, without downloading it first,
4224 even if it's just a simple text file or an image.
4227 > Removing the <SPAN
4229 >"Content-Disposition:"</SPAN
4231 to prevent this annoyance, but some browsers additionally check the
4234 >"Content-Type:"</SPAN
4235 > header, before they decide if they can
4236 display a document without saving it first. In these cases, you have
4237 to change this header as well, before the browser stops displaying
4241 > It is also possible to change the server's file name suggestion
4242 to another one, but in most cases it isn't worth the time to set
4258 ># Disarm the download link in Sourceforge's patch tracker
4260 +content-type-overwrite {text/plain}\
4261 +hide-content-disposition {block} }
4262 .sourceforge.net/tracker/download.php</PRE
4277 NAME="HIDE-IF-MODIFIED-SINCE"
4279 >8.5.20. hide-if-modified-since</H4
4283 CLASS="VARIABLELIST"
4289 >Prevent yet another way to track the user's steps between sessions.</P
4297 >"If-Modified-Since:"</SPAN
4298 > HTTP client header or modifies its value.
4314 >, or a user defined value that specifies a range of hours.
4321 > Removing this header is useful for filter testing, where you want to force a real
4322 reload instead of getting status code <SPAN
4325 >, which would cause the
4326 browser to use a cached copy of the page.
4329 > Instead of removing the header, <TT
4331 >hide-if-modified-since</TT
4333 also add or substract a random amount of time to/from the headers value.
4334 You specify a range of hours were the random factor should be chosen from and
4338 > does the rest. A negative value means
4339 subtracting, a positive value adding.
4342 > Randomizing the value of the <SPAN
4344 >"If-Modified-Since:"</SPAN
4346 sure it isn't used as a cookie replacement, but you will run into
4347 caching problems if the random range is too high.
4350 > It is a good idea to only use a small negative value and let
4354 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
4355 >overwrite-last-modified</A
4358 handle the greater changes.
4361 > It is also recommended to use this action together with
4365 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
4366 >crunch-if-none-match</A
4372 >Example usage (section):</DT
4383 ># Let the browser revalidate without being tracked across sessions
4384 {+hide-if-modified-since {-1}\
4385 +overwrite-last-modified {randomize}\
4386 +crunch-if-none-match}
4402 NAME="HIDE-FORWARDED-FOR-HEADERS"
4404 >8.5.21. hide-forwarded-for-headers</H4
4408 CLASS="VARIABLELIST"
4414 >Improve privacy by hiding the true source of the request</P
4420 > Deletes any existing <SPAN
4422 >"X-Forwarded-for:"</SPAN
4423 > HTTP header from client requests,
4424 and prevents adding a new one.
4444 > It is fairly safe to leave this on.
4447 > This action is scheduled for improvement: It should be able to generate forged
4450 >"X-Forwarded-for:"</SPAN
4451 > headers using random IP addresses from a specified network,
4452 to make successive requests from the same client look like requests from a pool of different
4453 users sharing the same proxy.
4468 >+hide-forwarded-for-headers</PRE
4483 NAME="HIDE-FROM-HEADER"
4485 >8.5.22. hide-from-header</H4
4489 CLASS="VARIABLELIST"
4495 >Keep your (old and ill) browser from telling web servers your email address</P
4501 > Deletes any existing <SPAN
4504 > HTTP header, or replaces it with the
4521 >, or any user defined value.
4531 > will completely remove the header
4532 (not to be confused with the <TT
4535 HREF="actions-file.html#BLOCK"
4542 > Alternately, you can specify any value you prefer to be sent to the web
4543 server. If you do, it is a matter of fairness not to use any address that
4544 is actually used by a real person.
4547 > This action is rarely needed, as modern web browsers don't send
4566 >+hide-from-header{block}</PRE
4579 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
4594 NAME="HIDE-REFERRER"
4596 >8.5.23. hide-referrer</H4
4603 CLASS="VARIABLELIST"
4609 >Conceal which link you followed to get to a particular site</P
4618 > (sic) HTTP header from the client request,
4619 or replaces it with a forged one.
4638 >"conditional-block"</SPAN
4639 > to delete the header completely if the host has changed.</P
4646 > to delete the header unconditionally.</P
4653 > to pretend to be coming from the homepage of the server we are talking to.</P
4657 >Any other string to set a user defined referrer.</P
4667 >conditional-block</TT
4668 > is the only parameter,
4669 that isn't easily detected in the server's log file. If it blocks the
4670 referrer, the request will look like the visitor used a bookmark or
4671 typed in the address directly.
4674 > Leaving the referrer unmodified for requests on the same host
4675 allows the server owner to see the visitor's <SPAN
4679 but in most cases she could also get that information by comparing
4680 other parts of the log file: for example the User-Agent if it isn't
4681 a very common one, or the user's IP address if it doesn't change between
4685 > Always blocking the referrer, or using a custom one, can lead to
4686 failures on servers that check the referrer before they answer any
4687 requests, in an attempt to prevent their valuable content from being
4688 embedded or linked to elsewhere.
4693 >conditional-block</TT
4698 will work with referrer checks, as long as content and valid referring page
4699 are on the same host. Most of the time that's the case.
4706 > is an alternate spelling of
4710 > and the two can be can be freely
4711 substituted with each other. (<SPAN
4715 correct English spelling, however the HTTP specification has a bug - it
4716 requires it to be spelled as <SPAN
4734 >+hide-referrer{forge}</PRE
4747 >+hide-referrer{http://www.yahoo.com/}</PRE
4762 NAME="HIDE-USER-AGENT"
4764 >8.5.24. hide-user-agent</H4
4768 CLASS="VARIABLELIST"
4774 >Conceal your type of browser and client operating system</P
4780 > Replaces the value of the <SPAN
4782 >"User-Agent:"</SPAN
4784 in client requests with the specified value.
4797 > Any user-defined string.
4822 > This can lead to problems on web sites that depend on looking at this header in
4823 order to customize their content for different browsers (which, by the
4830 > the right thing to do: good web sites
4831 work browser-independently).
4839 > Using this action in multi-user setups or wherever different types of
4840 browsers will access the same <SPAN
4850 >. In single-user, single-browser
4851 setups, you might use it to delete your OS version information from
4852 the headers, because it is an invitation to exploit known bugs for your
4853 OS. It is also occasionally useful to forge this in order to access
4854 sites that won't let you in otherwise (though there may be a good
4855 reason in some cases). Example of this: some MSN sites will not
4859 > enter, yet forging to a
4863 > user-agent works just fine.
4864 (Must be just a silly MS goof, I'm sure :-).
4867 > This action is scheduled for improvement.
4882 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
4897 NAME="INSPECT-JPEGS"
4899 >8.5.25. inspect-jpegs</H4
4903 CLASS="VARIABLELIST"
4909 >To protect against the MS buffer over-run in JPEG processing</P
4915 > Protect against a known exploit
4935 > See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
4936 common image types found across the Internet. The exploit as described can
4937 allow execution of code on the target system, giving an attacker access
4938 to the system in question by merely planting an altered JPEG image, which
4939 would have no obvious indications of what lurks inside. This action
4940 prevents unwanted intrusion.
4955 >+inspect-jpegs</PRE
4971 >8.5.26. kill-popups<A
4978 CLASS="VARIABLELIST"
4984 >Eliminate those annoying pop-up windows (deprecated)</P
4990 > While loading the document, replace JavaScript code that opens
4991 pop-up windows with (syntactically neutral) dummy code on the fly.
5011 > This action is basically a built-in, hardwired special-purpose filter
5012 action, but there are important differences: For <TT
5016 the document need not be buffered, so it can be incrementally rendered while
5017 downloading. But <TT
5020 > doesn't catch as many pop-ups as
5024 HREF="actions-file.html#FILTER-ALL-POPUPS"
5033 does and is not as smart as <TT
5036 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5040 >unsolicited-popups</I
5048 > Think of it as a fast and efficient replacement for a filter that you
5049 can use if you don't want any filtering at all. Note that it doesn't make
5050 sense to combine it with any <TT
5053 HREF="actions-file.html#FILTER"
5057 since as soon as one <TT
5060 HREF="actions-file.html#FILTER"
5064 the whole document needs to be buffered anyway, which destroys the advantage of
5068 > action over its filter equivalent.
5071 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
5072 pop-ups to display forms, shopping carts etc, and the <TT
5075 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5079 >unsolicited-popups</I
5084 > does a fairly good job of catching only the unwanted ones.
5087 > If the only kind of pop-ups that you want to kill are exit consoles (those
5094 > windows that appear when you close an other
5095 one), you might want to use
5099 HREF="actions-file.html#FILTER"
5137 NAME="LIMIT-CONNECT"
5139 >8.5.27. limit-connect</H4
5143 CLASS="VARIABLELIST"
5149 >Prevent abuse of <SPAN
5152 > as a TCP proxy relay or disable SSL for untrusted sites</P
5158 > Specifies to which ports HTTP CONNECT requests are allowable.
5171 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5172 defaulting to 0 and the maximum to 65K).
5179 > By default, i.e. if no <TT
5186 > only allows HTTP CONNECT
5187 requests to port 443 (the standard, secure HTTPS port). Use
5191 > if more fine-grained control is desired
5192 for some or all destinations.
5195 > The CONNECT methods exists in HTTP to allow access to secure websites
5199 > URLs) through proxies. It works very simply:
5200 the proxy connects to the server on the specified port, and then
5201 short-circuits its connections to the client and to the remote server.
5202 This can be a big security hole, since CONNECT-enabled proxies can be
5203 abused as TCP relays very easily.
5209 > relays HTTPS traffic without seeing
5210 the decoded content. Websites can leverage this limitation to circumvent Privoxy's
5211 filters. By specifying an invalid port range you can disable HTTPS entirely.
5212 If you plan to disable SSL by default, consider enabling
5216 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
5217 >treat-forbidden-connects-like-blocks</A
5220 as well, to be able to quickly create exceptions.
5224 >Example usages:</DT
5235 >+limit-connect{443} # This is the default and need not be specified.
5236 +limit-connect{80,443} # Ports 80 and 443 are OK.
5237 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5238 +limit-connect{-} # All ports are OK
5239 +limit-connect{,} # No HTTPS traffic is allowed</PRE
5254 NAME="PREVENT-COMPRESSION"
5256 >8.5.28. prevent-compression</H4
5260 CLASS="VARIABLELIST"
5266 > Ensure that servers send the content uncompressed, so it can be
5270 HREF="actions-file.html#FILTER"
5280 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5300 > More and more websites send their content compressed by default, which
5301 is generally a good idea and saves bandwidth. But for the <TT
5304 HREF="actions-file.html#FILTER"
5310 HREF="actions-file.html#DEANIMATE-GIFS"
5317 HREF="actions-file.html#KILL-POPUPS"
5324 > needs access to the uncompressed data.
5325 Unfortunately, <SPAN
5328 > can't yet(!) uncompress, filter, and
5329 re-compress the content on the fly. So if you want to ensure that all websites, including
5330 those that normally compress, can be filtered, you need to use this action.
5333 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
5334 actions, you will typically want to use <TT
5336 >prevent-compression</TT
5341 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5342 documents correctly (they send an empty document body). If you use <TT
5344 >prevent-compression</TT
5346 per default, you'll have to add exceptions for those sites. See the example for how to do that.
5350 >Example usage (sections):</DT
5363 {+prevent-compression}
5366 # Make exceptions for ill sites:
5368 {-prevent-compression}
5370 www.pclinuxonline.com</PRE
5385 NAME="OVERWRITE-LAST-MODIFIED"
5387 >8.5.29. overwrite-last-modified</H4
5391 CLASS="VARIABLELIST"
5397 >Prevent yet another way to track the user's steps between sessions.</P
5405 >"Last-Modified:"</SPAN
5406 > HTTP server header or modifies its value.
5419 > One of the keywords: <SPAN
5424 >"reset-to-request-time"</SPAN
5436 > Removing the <SPAN
5438 >"Last-Modified:"</SPAN
5439 > header is useful for filter
5440 testing, where you want to force a real reload instead of getting status
5444 >, which would cause the browser to reuse the old
5445 version of the page.
5451 > option overwrites the value of the
5454 >"Last-Modified:"</SPAN
5455 > header with a randomly chosen time
5456 between the original value and the current time. In theory the server
5457 could send each document with a different <SPAN
5459 >"Last-Modified:"</SPAN
5461 header to track visits without using cookies. <SPAN
5465 makes it impossible and the browser can still revalidate cached documents.
5470 >"reset-to-request-time"</SPAN
5471 > overwrites the value of the
5474 >"Last-Modified:"</SPAN
5475 > header with the current time. You could use
5476 this option together with
5480 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5481 >hided-if-modified-since</A
5484 to further customize your random range.
5487 > The preferred parameter here is <SPAN
5491 to use, as long as the time settings are more or less correct.
5492 If the server sets the <SPAN
5494 >"Last-Modified:"</SPAN
5495 > header to the time
5496 of the request, the random range becomes zero and the value stays the same.
5497 Therefore you should later randomize it a second time with
5501 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5502 >hided-if-modified-since</A
5508 > It is also recommended to use this action together with
5512 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5513 >crunch-if-none-match</A
5530 ># Let the browser revalidate without being tracked across sessions
5531 {+hide-if-modified-since {-1}\
5532 +overwrite-last-modified {randomize}\
5533 +crunch-if-none-match}
5551 >8.5.30. redirect</H4
5555 CLASS="VARIABLELIST"
5561 > Redirect requests to other sites.
5568 > Convinces the browser that the requested document has been moved
5569 to another location and the browser should get it from there.
5589 > This action is useful to replace whole documents with your own
5590 ones. For that to work, they have to be available on another server,
5591 and both should resolve.
5594 > You can do the same by combining the actions
5598 HREF="actions-file.html#BLOCK"
5605 HREF="actions-file.html#HANDLE-AS-IMAGE"
5612 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5613 >set-image-blocker{URL}</A
5616 It doesn't sound right for non-image documents, and that's why this action
5620 > This action will be ignored if you use it together with
5624 HREF="actions-file.html#BLOCK"
5642 ># Replace example.com's style sheet with another one
5643 {+redirect{http://localhost/css-replacements/example.com.css}}
5644 example.com/stylesheet.css</PRE
5659 NAME="SEND-VANILLA-WAFER"
5661 >8.5.31. send-vanilla-wafer</H4
5665 CLASS="VARIABLELIST"
5671 > Feed log analysis scripts with useless data.
5678 > Sends a cookie with each request stating that you do not accept any copyright
5679 on cookies sent to you, and asking the site operator not to track you.
5699 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
5702 > This action is rarely used and not enabled in the default configuration.
5717 >+send-vanilla-wafer</PRE
5734 >8.5.32. send-wafer</H4
5738 CLASS="VARIABLELIST"
5744 > Send custom cookies or feed log analysis scripts with even more useless data.
5751 > Sends a custom, user-defined cookie with each request.
5764 > A string of the form <SPAN
5784 > Being multi-valued, multiple instances of this action can apply to the same request,
5785 resulting in multiple cookies being sent.
5788 > This action is rarely used and not enabled in the default configuration.
5792 >Example usage (section):</DT
5803 >{+send-wafer{UsingPrivoxy=true}}
5804 my-internal-testing-server.void</PRE
5819 NAME="SESSION-COOKIES-ONLY"
5821 >8.5.33. session-cookies-only</H4
5825 CLASS="VARIABLELIST"
5831 > Allow only temporary <SPAN
5834 > cookies (for the current
5835 browser session <SPAN
5853 >"Set-Cookie:"</SPAN
5855 server headers. Most browsers will not store such cookies permanently and
5856 forget them in between sessions.
5876 > This is less strict than <TT
5879 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5880 >crunch-incoming-cookies</A
5886 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5887 >crunch-outgoing-cookies</A
5889 > and allows you to browse
5890 websites that insist or rely on setting cookies, without compromising your privacy too badly.
5893 > Most browsers will not permanently store cookies that have been processed by
5896 >session-cookies-only</TT
5897 > and will forget about them between sessions.
5898 This makes profiling cookies useless, but won't break sites which require cookies so
5899 that you can log in for transactions. This is generally turned on for all
5900 sites, and is the recommended setting.
5911 >session-cookies-only</TT
5916 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5917 >crunch-incoming-cookies</A
5923 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5924 >crunch-outgoing-cookies</A
5926 >. If you do, cookies
5927 will be plainly killed.
5930 > Note that it is up to the browser how it handles such cookies without an <SPAN
5934 field. If you use an exotic browser, you might want to try it out to be sure.
5937 > This setting also has no effect on cookies that may have been stored
5938 previously by the browser before starting <SPAN
5942 These would have to be removed manually.
5950 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
5951 >content-cookies filter</A
5953 to block some types of cookies. Content cookies are not effected by
5956 >session-cookies-only</TT
5972 >+session-cookies-only</PRE
5987 NAME="SET-IMAGE-BLOCKER"
5989 >8.5.34. set-image-blocker</H4
5993 CLASS="VARIABLELIST"
5999 >Choose the replacement for blocked images</P
6005 > This action alone doesn't do anything noticeable. If <SPAN
6015 HREF="actions-file.html#BLOCK"
6027 HREF="actions-file.html#HANDLE-AS-IMAGE"
6037 apply, i.e. if the request is to be blocked as an image,
6044 > the parameter of this action decides what will be
6045 sent as a replacement.
6065 > to send a built-in checkerboard pattern image. The image is visually
6066 decent, scales very well, and makes it obvious where banners were busted.
6074 > to send a built-in transparent image. This makes banners disappear
6075 completely, but makes it hard to detect where <SPAN
6079 images on a given page and complicates troubleshooting if <SPAN
6083 has blocked innocent images, like navigation icons.
6097 send a redirect to <TT
6103 to any image anywhere, even in your local filesystem via <SPAN
6107 (But note that not all browsers support redirecting to a local file system).
6110 > A good application of redirects is to use special <SPAN
6114 URLs, which send the built-in images, as <TT
6120 This has the same visual effect as specifying <SPAN
6127 the first place, but enables your browser to cache the replacement image, instead of requesting
6128 it over and over again.
6137 > The URLs for the built-in images are <SPAN
6139 >"http://config.privoxy.org/send-banner?type=<TT
6160 > There is a third (advanced) type, called <SPAN
6172 >set-image-blocker</TT
6173 >, but meant for use from <A
6174 HREF="filter-file.html"
6177 Auto will select the type of image that would have applied to the referring page, had it been an image.
6195 >+set-image-blocker{pattern}</PRE
6202 > Redirect to the BSD devil:
6213 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6220 > Redirect to the built-in pattern for better caching:
6231 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6246 NAME="TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
6248 >8.5.35. treat-forbidden-connects-like-blocks</H4
6252 CLASS="VARIABLELIST"
6258 >Block forbidden connects with an easy to find error message.</P
6264 > If this action is enabled, <SPAN
6268 makes a difference between forbidden connects and ordinary blocks.
6292 HREF="actions-file.html#LIMIT-CONNECT"
6298 with a short error message inside the headers. If the browser doesn't display
6299 headers (most don't), you just see an empty page.
6302 > With this action enabled, <SPAN
6306 the message that is used for ordinary blocks instead. If you decide
6307 to make an exception for the page in question, you can do so by
6317 > requests the clients tell
6321 > which host they are interested
6322 in, but not which document they plan to get later. As a result, the
6325 >"Go there anyway"</SPAN
6326 > link becomes rather useless:
6327 it lets the client request the home page of the forbidden host
6328 through unencrypted HTTP, still using the port of the last request.
6331 > If you previously configured <SPAN
6335 request through a SSL tunnel, everything will work. Most likely you haven't
6336 and the server will respond with an error message because it is expecting
6352 >+treat-forbidden-connects-like-blocks</PRE
6369 >8.5.36. Summary</H3
6371 > Note that many of these actions have the potential to cause a page to
6372 misbehave, possibly even not to display at all. There are many ways
6373 a site designer may choose to design his site, and what HTTP header
6374 content, and other criteria, he may depend on. There is no way to have hard
6375 and fast rules for all sites. See the <A
6376 HREF="appendix.html#ACTIONSANAT"
6378 > for a brief example on troubleshooting
6401 >, can be defined by combining other actions.
6402 These can in turn be invoked just like the built-in actions.
6403 Currently, an alias name can contain any character except space, tab,
6421 > that you only use <SPAN
6441 Alias names are not case sensitive, and are not required to start with a
6448 > sign, since they are merely textually
6451 > Aliases can be used throughout the actions file, but they <SPAN
6456 defined in a special section at the top of the file!</I
6459 And there can only be one such section per actions file. Each actions file may
6460 have its own alias section, and the aliases defined in it are only visible
6461 within that file.</P
6463 > There are two main reasons to use aliases: One is to save typing for frequently
6464 used combinations of actions, the other one is a gain in flexibility: If you
6465 decide once how you want to handle shops by defining an alias called
6469 >, you can later change your policy on shops in
6476 > place, and your changes will take effect everywhere
6477 in the actions file where the <SPAN
6480 > alias is used. Calling aliases
6481 by their purpose also makes your actions files more readable.</P
6483 > Currently, there is one big drawback to using aliases, though:
6487 >'s built-in web-based action file
6488 editor honors aliases when reading the actions files, but it expands
6489 them before writing. So the effects of your aliases are of course preserved,
6490 but the aliases themselves are lost when you edit sections that use aliases
6492 This is likely to change in future versions of <SPAN
6497 > Now let's define some aliases...</P
6507 > # Useful custom aliases we can use later.
6509 # Note the (required!) section header line and that this section
6510 # must be at the top of the actions file!
6514 # These aliases just save typing later:
6515 # (Note that some already use other aliases!)
6517 +crunch-all-cookies = +<A
6518 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6519 >crunch-incoming-cookies</A
6521 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6522 >crunch-outgoing-cookies</A
6524 -crunch-all-cookies = -<A
6525 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6526 >crunch-incoming-cookies</A
6528 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6529 >crunch-outgoing-cookies</A
6531 block-as-image = +block +handle-as-image
6532 mercy-for-cookies = -crunch-all-cookies -<A
6533 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6534 >session-cookies-only</A
6536 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6537 >filter{content-cookies}</A
6540 # These aliases define combinations of actions
6541 # that are useful for certain types of sites:
6544 HREF="actions-file.html#BLOCK"
6547 HREF="actions-file.html#FILTER"
6549 > -crunch-all-cookies -<A
6550 HREF="actions-file.html#FAST-REDIRECTS"
6553 HREF="actions-file.html#HIDE-REFERER"
6556 HREF="actions-file.html#KILL-POPUPS"
6559 shop = -crunch-all-cookies -<A
6560 HREF="actions-file.html#FILTER-ALL-POPUPS"
6561 >filter{all-popups}</A
6563 HREF="actions-file.html#KILL-POPUPS"
6567 # Short names for other aliases, for really lazy people ;-)
6569 c0 = +crunch-all-cookies
6570 c1 = -crunch-all-cookies</PRE
6576 > ...and put them to use. These sections would appear in the lower part of an
6577 actions file and define exceptions to the default actions (as specified further
6591 > # These sites are either very complex or very keen on
6592 # user data and require minimal interference to work:
6595 .office.microsoft.com
6596 .windowsupdate.microsoft.com
6600 # Allow cookies (for setting and retrieving your customer data)
6604 .worldpay.com # for quietpc.com
6607 # These shops require pop-ups:
6609 {shop -kill-popups -filter{all-popups}}
6611 .overclockers.co.uk</PRE
6617 > Aliases like <SPAN
6623 > are often used for
6627 > sites that require some actions to be disabled
6628 in order to function properly.</P
6637 >8.7. Actions Files Tutorial</H2
6639 > The above chapters have shown <A
6640 HREF="actions-file.html"
6641 >which actions files
6642 there are and how they are organized</A
6643 >, how actions are <A
6644 HREF="actions-file.html#ACTIONS"
6647 HREF="actions-file.html#ACTIONS-APPLY"
6651 HREF="actions-file.html#AF-PATTERNS"
6655 HREF="actions-file.html#ALIASES"
6657 >. Now, let's look at an
6665 file and see how all these pieces come together:</P
6673 >8.7.1. default.action</H3
6675 >Every config file should start with a short comment stating its purpose:</P
6685 ># Sample default.action file <ijbswa-developers@lists.sourceforge.net></PRE
6691 >Then, since this is the <TT
6695 first section is a special section for internal use that you needn't
6696 change or worry about:</P
6706 >##########################################################################
6707 # Settings -- Don't change! For internal Privoxy use ONLY.
6708 ##########################################################################
6711 for-privoxy-version=3.0</PRE
6717 >After that comes the (optional) alias section. We'll use the example
6718 section from the above <A
6719 HREF="actions-file.html#ALIASES"
6720 >chapter on aliases</A
6722 that also explains why and how aliases are used:</P
6732 >##########################################################################
6734 ##########################################################################
6737 # These aliases just save typing later:
6738 # (Note that some already use other aliases!)
6740 +crunch-all-cookies = +<A
6741 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6742 >crunch-incoming-cookies</A
6744 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6745 >crunch-outgoing-cookies</A
6747 -crunch-all-cookies = -<A
6748 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6749 >crunch-incoming-cookies</A
6751 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6752 >crunch-outgoing-cookies</A
6754 block-as-image = +block +handle-as-image
6755 mercy-for-cookies = -crunch-all-cookies -<A
6756 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6757 >session-cookies-only</A
6759 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6760 >filter{content-cookies}</A
6763 # These aliases define combinations of actions
6764 # that are useful for certain types of sites:
6767 HREF="actions-file.html#BLOCK"
6770 HREF="actions-file.html#FILTER"
6772 > -crunch-all-cookies -<A
6773 HREF="actions-file.html#FAST-REDIRECTS"
6776 HREF="actions-file.html#HIDE-REFERER"
6779 HREF="actions-file.html#KILL-POPUPS"
6782 shop = -crunch-all-cookies -<A
6783 HREF="actions-file.html#FILTER-ALL-POPUPS"
6784 >filter{all-popups}</A
6786 HREF="actions-file.html#KILL-POPUPS"
6794 > Now come the regular sections, i.e. sets of actions, accompanied
6795 by URL patterns to which they apply. Remember <SPAN
6800 are disabled when matching starts</I
6802 >, so we have to explicitly
6803 enable the ones we want.</P
6805 > The first regular section is probably the most important. It has only
6814 HREF="actions-file.html#AF-PATTERNS"
6815 >matches all URLs</A
6817 set of actions used in this <SPAN
6825 be applied to all requests as a start</I
6827 >. It can be partly or
6828 wholly overridden by later matches further down this file, or in user.action,
6829 but it will still be largely responsible for your overall browsing
6832 > Again, at the start of matching, all actions are disabled, so there is
6833 no real need to disable any actions here, but we will do that nonetheless,
6834 to have a complete listing for your reference. (Remember: a <SPAN
6838 preceding the action name enables the action, a <SPAN
6842 Also note how this long line has been made more readable by splitting it into
6843 multiple lines with line continuation.</P
6853 >##########################################################################
6854 # "Defaults" section:
6855 ##########################################################################
6858 HREF="actions-file.html#ADD-HEADER"
6862 HREF="actions-file.html#BLOCK"
6866 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
6867 >content-type-overwrite</A
6870 HREF="actions-file.html#CRUNCH-CLIENT-HEADER"
6871 >crunch-client-header</A
6874 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
6875 >crunch-if-none-match</A
6878 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6879 >crunch-incoming-cookies</A
6882 HREF="actions-file.html#CRUNCH-SERVER-HEADER"
6883 >crunch-server-header</A
6886 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6887 >crunch-outgoing-cookies</A
6890 HREF="actions-file.html#DEANIMATE-GIFS"
6894 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
6895 >downgrade-http-version</A
6898 HREF="actions-file.html#FAST-REDIRECTS"
6899 >fast-redirects{check-decoded-url}</A
6902 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
6903 >filter{js-annoyances}</A
6906 HREF="actions-file.html#FILTER-JS-EVENTS"
6907 >filter{js-events}</A
6910 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
6911 >filter{html-annoyances}</A
6914 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6915 >filter{content-cookies}</A
6918 HREF="actions-file.html#FILTER-REFRESH-TAGS"
6919 >filter{refresh-tags}</A
6922 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
6923 >filter{unsolicited-popups}</A
6926 HREF="actions-file.html#FILTER-ALL-POPUPS"
6927 >filter{all-popups}</A
6930 HREF="actions-file.html#FILTER-IMG-REORDER"
6931 >filter{img-reorder}</A
6934 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
6935 >filter{banners-by-size}</A
6938 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
6939 >filter{banners-by-link}</A
6942 HREF="actions-file.html#FILTER-WEBBUGS"
6946 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
6947 >filter{tiny-textforms}</A
6950 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
6951 >filter{jumping-windows}</A
6954 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
6955 >filter{frameset-borders}</A
6958 HREF="actions-file.html#FILTER-DEMORONIZER"
6959 >filter{demoronizer}</A
6962 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
6963 >filter{shockwave-flash}</A
6966 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
6967 >filter{quicktime-kioskmode}</A
6970 HREF="actions-file.html#FILTER-FUN"
6974 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
6975 >filter{crude-parental}</A
6978 HREF="actions-file.html#FILTER-IE-EXPLOITS"
6979 >filter{ie-exploits}</A
6982 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
6983 >filter-client-headers</A
6986 HREF="actions-file.html#FILTER-SERVER-HEADERS"
6987 >filter-server-headers</A
6990 HREF="actions-file.html#FORCE-TEXT-MODE"
6994 HREF="actions-file.html#HANDLE-AS-EMPTY-DOCUMENT"
6995 >handle-as-empty-document</A
6998 HREF="actions-file.html#HANDLE-AS-IMAGE"
7002 HREF="actions-file.html#HIDE-ACCEPT-LANGUAGE"
7003 >hide-accept-language</A
7006 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7007 >hide-content-disposition</A
7010 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
7011 >hide-if-modified-since</A
7014 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
7015 >hide-forwarded-for-headers</A
7018 HREF="actions-file.html#HIDE-FROM-HEADER"
7019 >hide-from-header{block}</A
7022 HREF="actions-file.html#HIDE-REFERER"
7023 >hide-referrer{forge}</A
7026 HREF="actions-file.html#HIDE-USER-AGENT"
7030 HREF="actions-file.html#INSPECT-JPEGS"
7034 HREF="actions-file.html#KILL-POPUPS"
7038 HREF="actions-file.html#LIMIT-CONNECT"
7042 HREF="actions-file.html#PREVENT-COMPRESSION"
7043 >prevent-compression</A
7046 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
7047 >overwrite-last-modified</A
7050 HREF="actions-file.html#REDIRECT"
7054 HREF="actions-file.html#SEND-VANILLA-WAFER"
7055 >send-vanilla-wafer</A
7058 HREF="actions-file.html#SEND-WAFER"
7062 HREF="actions-file.html#SESSION-COOKIES-ONLY"
7063 >session-cookies-only</A
7066 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7067 >set-image-blocker{pattern}</A
7070 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
7071 >treat-forbidden-connects-like-blocks</A
7074 / # forward slash will match *all* potential URL patterns.</PRE
7080 > The default behavior is now set. Note that some actions, like not hiding
7081 the user agent, are part of a <SPAN
7083 >"general policy"</SPAN
7085 universally and won't get any exceptions defined later. Other choices,
7086 like not blocking (which is <SPAN
7093 default!) need exceptions, i.e. we need to specify explicitly what we
7094 want to block in later sections.</P
7096 > The first of our specialized sections is concerned with <SPAN
7100 sites, i.e. sites that require minimum interference, because they are either
7101 very complex or very keen on tracking you (and have mechanisms in place that
7102 make them unusable for people who avoid being tracked). We will simply use
7106 > alias instead of stating the list
7107 of actions explicitly:</P
7117 >##########################################################################
7118 # Exceptions for sites that'll break under the default action set:
7119 ##########################################################################
7121 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7124 .office.microsoft.com # surprise, surprise!
7125 .windowsupdate.microsoft.com</PRE
7131 > Shopping sites are not as fragile, but they typically
7132 require cookies to log in, and pop-up windows for shopping
7133 carts or item details. Again, we'll use a pre-defined alias:</P
7147 .worldpay.com # for quietpc.com
7158 HREF="actions-file.html#FAST-REDIRECTS"
7162 action, which we enabled per default above, breaks some sites. So disable
7163 it for popular sites where we know it misbehaves:</P
7174 HREF="actions-file.html#FAST-REDIRECTS"
7180 .altavista.com/.*(like|url|link):http
7181 .altavista.com/trans.*urltext=http
7188 > It is important that <SPAN
7192 URLs belong to images, so that <SPAN
7199 be blocked, a substitute image can be sent, rather than an HTML page.
7200 Contacting the remote site to find out is not an option, since it
7201 would destroy the loading time advantage of banner blocking, and it
7202 would feed the advertisers (in terms of money <SPAN
7209 information). We can mark any URL as an image with the <TT
7212 HREF="actions-file.html#HANDLE-AS-IMAGE"
7216 and marking all URLs that end in a known image file extension is a
7227 >##########################################################################
7229 ##########################################################################
7231 # Define which file types will be treated as images, in case they get
7232 # blocked further down this file:
7235 HREF="actions-file.html#HANDLE-AS-IMAGE"
7238 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7244 > And then there are known banner sources. They often use scripts to
7245 generate the banners, so it won't be visible from the URL that the
7246 request is for an image. Hence we block them <SPAN
7253 mark them as images in one go, with the help of our
7257 > alias defined above. (We could of
7258 course just as well use <TT
7261 HREF="actions-file.html#BLOCK"
7265 HREF="actions-file.html#HANDLE-AS-IMAGE"
7269 Remember that the type of the replacement image is chosen by the
7273 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7274 >set-image-blocker</A
7277 action. Since all URLs have matched the default section with its
7281 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7282 >set-image-blocker</A
7285 action before, it still applies and needn't be repeated:</P
7295 ># Known ad generators:
7300 .ad.*.doubleclick.net
7301 .a.yimg.com/(?:(?!/i/).)*$
7302 .a[0-9].yimg.com/(?:(?!/i/).)*$
7311 > One of the most important jobs of <SPAN
7315 is to block banners. A huge bunch of them can be <SPAN
7322 HREF="actions-file.html#FILTER"
7324 >{banners-by-size}</TT
7326 action, which we enabled above, and which deletes the references to banner
7327 images from the pages while they are loaded, so the browser doesn't request
7328 them anymore, and hence they don't need to be blocked here. But this naturally
7329 doesn't catch all banners, and some people choose not to use filters, so we
7330 need a comprehensive list of patterns for banner URLs here, and apply the
7334 HREF="actions-file.html#BLOCK"
7337 > action to them.</P
7339 > First comes a bunch of generic patterns, which do most of the work, by
7340 matching typical domain and path name components of banners. Then comes
7341 a list of individual patterns for specific sites, which is omitted here
7342 to keep the example short:</P
7352 >##########################################################################
7353 # Block these fine banners:
7354 ##########################################################################
7356 HREF="actions-file.html#BLOCK"
7366 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7367 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7369 # Site-specific patterns (abbreviated):
7377 > You wouldn't believe how many advertisers actually call their banner
7383 >.com, or call the directory
7384 in which the banners are stored simply <SPAN
7388 generic patterns are surprisingly effective.</P
7390 > But being very generic, they necessarily also catch URLs that we don't want
7391 to block. The pattern <TT
7403 >.nasty-corp.com"</SPAN
7413 >.sourcefroge.net"</SPAN
7423 >l.some-provider.net."</SPAN
7425 well-known exceptions to the <TT
7428 HREF="actions-file.html#BLOCK"
7434 > Note that these are exceptions to exceptions from the default! Consider the URL
7437 >"downloads.sourcefroge.net"</SPAN
7438 >: Initially, all actions are deactivated,
7439 so it wouldn't get blocked. Then comes the defaults section, which matches the
7440 URL, but just deactivates the <TT
7443 HREF="actions-file.html#BLOCK"
7447 action once again. Then it matches <TT
7450 >, an exception to the
7451 general non-blocking policy, and suddenly
7455 HREF="actions-file.html#BLOCK"
7458 > applies. And now, it'll match
7465 HREF="actions-file.html#BLOCK"
7469 applies, so (unless it matches <SPAN
7475 > further down) it ends up
7479 HREF="actions-file.html#BLOCK"
7482 > action applying.</P
7492 >##########################################################################
7493 # Save some innocent victims of the above generic block patterns:
7494 ##########################################################################
7499 HREF="actions-file.html#BLOCK"
7502 adv[io]*. # (for advogato.org and advice.*)
7503 adsl. # (has nothing to do with ads)
7504 ad[ud]*. # (adult.* and add.*)
7505 .edu # (universities don't host banners (yet!))
7506 .*loads. # (downloads, uploads etc)
7514 www.globalintersec.com/adv # (adv = advanced)
7515 www.ugu.com/sui/ugu/adv</PRE
7521 > Filtering source code can have nasty side effects,
7522 so make an exception for our friends at sourceforge.net,
7523 and all paths with <SPAN
7526 > in them. Note that
7530 HREF="actions-file.html#FILTER"
7540 > filters in one fell swoop!</P
7550 ># Don't filter code!
7553 HREF="actions-file.html#FILTER"
7557 .sourceforge.net</PRE
7566 > is of course much more
7567 comprehensive, but we hope this example made clear how it works.</P
7576 >8.7.2. user.action</H3
7578 > So far we are painting with a broad brush by setting general policies,
7579 which would be a reasonable starting point for many people. Now,
7580 you might want to be more specific and have customized rules that
7581 are more suitable to your personal habits and preferences. These would
7582 be for narrowly defined situations like your ISP or your bank, and should
7586 >, which is parsed after all other
7587 actions files and hence has the last word, over-riding any previously
7588 defined actions. <TT
7598 > place for your personal settings, since
7602 > is actively maintained by the
7606 > developers and you'll probably want
7607 to install updated versions from time to time.</P
7609 > So let's look at a few examples of things that one might typically do in
7623 ># My user.action file. <fred@foobar.com></PRE
7630 HREF="actions-file.html#ALIASES"
7632 > are local to the actions
7633 file that they are defined in, you can't use the ones from
7637 >, unless you repeat them here:</P
7647 ># Aliases are local to the file they are defined in.
7648 # (Re-)define aliases for this file:
7652 # These aliases just save typing later, and the alias names should
7653 # be self explanatory.
7655 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7656 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7657 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7658 allow-popups = -filter{all-popups} -kill-popups
7659 +block-as-image = +block +handle-as-image
7660 -block-as-image = -block
7662 # These aliases define combinations of actions that are useful for
7663 # certain types of sites:
7665 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
7666 shop = -crunch-all-cookies allow-popups
7668 # Allow ads for selected useful free sites:
7670 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
7672 # Alias for specific file types that are text, but might have conflicting
7673 # MIME types. We want the browser to force these to be text documents.
7674 handle-as-text = -<A
7675 HREF="actions-file.html#FILTER"
7678 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
7679 >content-type-overwrite{text/plain}</A
7681 HREF="actions-file.html#FORCE-TEXT-MODE"
7684 HREF="actions-file.html#HIDE-CONTENT-DISPOSITION"
7685 >hide-content-disposition</A
7692 > Say you have accounts on some sites that you visit regularly, and
7693 you don't want to have to log in manually each time. So you'd like
7694 to allow persistent cookies for these sites. The
7697 >allow-all-cookies</TT
7698 > alias defined above does exactly
7699 that, i.e. it disables crunching of cookies in any direction, and the
7700 processing of cookies to make them only temporary.</P
7710 >{ allow-all-cookies }
7722 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7733 HREF="actions-file.html#FILTER"
7736 .your-home-banking-site.com</PRE
7742 > Some file types you may not want to filter for various reasons:</P
7752 ># Technical documentation is likely to contain strings that might
7753 # erroneously get altered by the JavaScript-oriented filters:
7758 # And this stupid host sends streaming video with a wrong MIME type,
7759 # so that Privoxy thinks it is getting HTML and starts filtering:
7761 stupid-server.example.com/</PRE
7767 > Example of a simple <A
7768 HREF="actions-file.html#BLOCK"
7770 > action. Say you've
7771 seen an ad on your favourite page on example.com that you want to get rid of.
7772 You have right-clicked the image, selected <SPAN
7774 >"copy image location"</SPAN
7776 and pasted the URL below while removing the leading http://, into a
7780 > section. Note that <TT
7784 > need not be specified, since all URLs ending in
7788 > will be tagged as images by the general rules as set
7789 in default.action anyway:</P
7800 HREF="actions-file.html#BLOCK"
7803 www.example.com/nasty-ads/sponsor.gif
7804 another.popular.site.net/more/junk/here/</PRE
7810 > The URLs of dynamically generated banners, especially from large banner
7811 farms, often don't use the well-known image file name extensions, which
7812 makes it impossible for <SPAN
7816 the file type just by looking at the URL.
7819 >+block-as-image</TT
7820 > alias defined above for
7822 Note that objects which match this rule but then turn out NOT to be an
7823 image are typically rendered as a <SPAN
7825 >"broken image"</SPAN
7827 browser. Use cautiously.</P
7837 >{ +block-as-image }
7846 > Now you noticed that the default configuration breaks Forbes Magazine,
7847 but you were too lazy to find out which action is the culprit, and you
7848 were again too lazy to give <A
7852 you just used the <TT
7855 > alias on the site, and
7862 > -- it worked. The <TT
7866 aliases disables those actions that are most likely to break a site. Also,
7867 good for testing purposes to see if it is <SPAN
7871 that is causing the problem or not.</P
7888 > You like the <SPAN
7891 > text replacements in <TT
7895 but it is disabled in the distributed actions file. (My colleagues on the team just
7896 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
7897 update-safe config, once and for all:</P
7908 HREF="actions-file.html#FILTER-FUN"
7911 / # For ALL sites!</PRE
7917 > Note that the above is not really a good idea: There are exceptions
7918 to the filters in <TT
7922 really shouldn't be filtered, like code on CVS->Web interfaces. Since
7926 > has the last word, these exceptions
7927 won't be valid for the <SPAN
7930 > filtering specified here.</P
7932 > You might also worry about how your favourite free websites are
7933 funded, and find that they rely on displaying banner advertisements
7934 to survive. So you might want to specifically allow banners for those
7935 sites that you feel provide value to you:</P
7957 > has been aliased to
7961 HREF="actions-file.html#BLOCK"
7968 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
7969 >filter{banners-by-size}</A
7975 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
7976 >filter{banners-by-link}</A
7980 > Invoke another alias here to force an over-ride of the MIME type <TT
7982 > application/x-sh</TT
7983 > which typically would open a download type
7984 dialog. In my case, I want to look at the shell script, and then I can save
7985 it should I choose to.</P
8005 > is generally the best place to define
8006 exceptions and additions to the default policies of
8010 >. Some actions are safe to have their
8011 default policies set here though. So let's set a default policy to have a
8015 > image as opposed to the checkerboard pattern for
8025 > of course matches all URL
8026 paths and patterns:</P
8037 HREF="actions-file.html#SET-IMAGE-BLOCKER"
8038 >set-image-blocker{blank}</A
8053 SUMMARY="Footer navigation table"
8082 HREF="filter-file.html"
8092 >The Main Configuration File</TD