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 actions
84 > takes for which URLs, and thus determine
85 how ad images, cookies and various other aspects of HTTP content and
86 transactions are handled, and on which sites (or even parts thereof). There
87 are three such files included with <SPAN
91 with differing purposes:
102 > - is the primary action file
103 that sets the initial values for all actions. It is intended to
104 provide a base level of functionality for
108 > array of features. So it is
109 a set of broad rules that should work reasonably well for users everywhere.
110 This is the file that the developers are keeping updated, and <A
111 HREF="installation.html#INSTALLATION-KEEPUPDATED"
112 >making available to users</A
121 > - is intended to be for local site
122 preferences and exceptions. As an example, if your ISP or your bank
123 has specific requirements, and need special handling, this kind of
124 thing should go here. This file will not be upgraded.
132 > - is used by the web based editor,
133 to set various pre-defined sets of rules for the default actions section
137 >. These have increasing levels of
142 >and have no influence on your browsing unless
143 you select them explicitly in the editor</I
145 >. It is not recommend
149 > The default profiles, and their associated actions, as pre-defined in
163 >Table 1. Default Configurations</B
198 >Ad-blocking by URL</TD
220 >Ad-filtering by size</TD
242 >GIF de-animation</TD
374 >JavaScript taming</TD
418 >Fun text replacements</TD
440 >Image tag reordering</TD
462 >Ad-filtering by link</TD
511 > The list of actions files to be used are defined in the main configuration
512 file, and are processed in the order they are defined (e.g.
516 > is typically process before
520 >). The content of these can all be viewed and
522 HREF="http://config.privoxy.org/show-status"
524 >http://config.privoxy.org/show-status</A
527 > An actions file typically has multiple sections. If you want to use
531 > in an actions file, you have to place the (optional)
533 HREF="actions-file.html#ALIASES"
535 > at the top of that file.
536 Then comes the default set of rules which will apply universally to all
537 sites and pages (be <SPAN
547 > or any other actions file after
551 >, because it will override the result
552 from consulting any previous file). And then below that,
553 exceptions to the defined universal policies. You can regard
557 > as an appendix to <TT
561 with the advantage that is a separate file, which makes preserving your
562 personal settings across <SPAN
565 > upgrades easier.</P
568 Actions can be used to block anything you want, including ads, banners, or
569 just some obnoxious URL that you would rather not see. Cookies can be accepted
570 or rejected, or accepted only during the current browser session (i.e. not
571 written to disk), content can be modified, JavaScripts tamed, user-tracking
572 fooled, and much more. See below for a <A
573 HREF="actions-file.html#ACTIONS"
584 >8.1. Finding the Right Mix</H2
587 HREF="actions-file.html#ACTIONS"
589 >, like cookie suppression
590 or script disabling, may render some sites unusable that rely on these
591 techniques to work properly. Finding the right mix of actions is not always easy and
592 certainly a matter of personal taste. In general, it can be said that the more
596 > your default settings (in the top section of the
597 actions file) are, the more exceptions for <SPAN
601 will have to make later. If, for example, you want to crunch all cookies per
602 default, you'll have to make exceptions from that rule for sites that you
603 regularly use and that require cookies for actually useful puposes, like maybe
604 your bank, favorite shop, or newspaper. </P
606 > We have tried to provide you with reasonable rules to start from in the
607 distribution actions files. But there is no general rule of thumb on these
608 things. There just are too many variables, and sites are constantly changing.
609 Sooner or later you will want to change the rules (and read this chapter again :).</P
618 >8.2. How to Edit</H2
620 > The easiest way to edit the actions files is with a browser by
621 using our browser-based editor, which can be reached from <A
622 HREF="http://config.privoxy.org/show-status"
624 >http://config.privoxy.org/show-status</A
626 The editor allows both fine-grained control over every single feature on a
627 per-URL basis, and easy choosing from wholesale sets of defaults like
636 >"Adventuresome"</SPAN
640 >"Adventuresome"</SPAN
641 > setting is not only more aggressive,
642 but includes settings that are fun and subversive, and which some may find of
645 > If you prefer plain text editing to GUIs, you can of course also directly edit the
646 the actions files. Look at <TT
659 >8.3. How Actions are Applied to URLs</H2
661 > Actions files are divided into sections. There are special sections,
665 HREF="actions-file.html#ALIASES"
668 > sections which will
669 be discussed later. For now let's concentrate on regular sections: They have a
670 heading line (often split up to multiple lines for readability) which consist
671 of a list of actions, separated by whitespace and enclosed in curly braces.
672 Below that, there is a list of URL patterns, each on a separate line.</P
674 > To determine which actions apply to a request, the URL of the request is
675 compared to all patterns in each <SPAN
678 > file. Every time it matches, the list of
679 applicable actions for the URL is incrementally updated, using the heading
680 of the section in which the pattern is located. If multiple matches for
681 the same URL set the same action differently, the last match wins. If not,
682 the effects are aggregated. E.g. a URL might match a regular section with
683 a heading line of <TT
687 HREF="actions-file.html#HANDLE-AS-IMAGE"
691 then later another one with just <TT
695 HREF="actions-file.html#BLOCK"
705 > actions to apply.</P
707 > You can trace this process for any given URL by visiting <A
708 HREF="http://config.privoxy.org/show-url-info"
710 >http://config.privoxy.org/show-url-info</A
713 > More detail on this is provided in the Appendix, <A
714 HREF="appendix.html#ACTIONSANAT"
715 > Anatomy of an Action</A
735 to determine what actions might apply to which sites and pages your browser
736 attempts to access. These <SPAN
746 > matching to achieve a high degree of
747 flexibility. This allows one expression to be expanded and potentially match
748 against many similar patterns.</P
753 > pattern has the form
756 ><domain>/<path></TT
760 ><domain></TT
765 optional. (This is why the special <TT
768 > pattern matches all
769 URLs). Note that the protocol portion of the URL pattern (e.g.
780 the pattern. This is assumed already!</P
789 >www.example.com/</TT
793 > is a domain-only pattern and will match any request to <TT
797 regardless of which document on that server is requested.
807 > means exactly the same. For domain-only patterns, the trailing <TT
817 >www.example.com/index.html</TT
821 > matches only the single document <TT
838 > matches the document <TT
841 >, regardless of the domain,
858 > matches nothing, since it would be interpreted as a domain name and
859 there is no top-level domain called <TT
874 >8.4.1. The Domain Pattern</H3
876 > The matching of the domain part offers some flexible options: if the
877 domain starts or ends with a dot, it becomes unanchored at that end.
891 > matches any domain that <SPAN
911 > matches any domain that <SPAN
931 > matches any domain that <SPAN
941 (Correctly speaking: It matches any FQDN that contains <TT
950 > Additionally, there are wild-cards that you can use in the domain names
951 themselves. They work pretty similar to shell wild-cards: <SPAN
955 stands for zero or more arbitrary characters, <SPAN
959 any single character, you can define character classes in square
960 brackets and all of that can be freely mixed:</P
975 >"adserver.example.com"</SPAN
979 >"ads.example.com"</SPAN
982 >"sfads.example.com"</SPAN
989 >*ad*.example.com</TT
993 > matches all of the above, and then some.
1009 >pictures.epix.com</TT
1012 >a.b.c.d.e.upix.com</TT
1019 >www[1-9a-ez].example.c*</TT
1025 >www1.example.com</TT
1029 >www4.example.cc</TT
1032 >wwwd.example.cy</TT
1036 >wwwz.example.com</TT
1046 >wwww.example.com</TT
1060 >8.4.2. The Path Pattern</H3
1065 > uses Perl compatible regular expressions
1067 HREF="http://www.pcre.org/"
1071 matching the path.</P
1074 HREF="appendix.html#REGEX"
1076 > with a brief quick-start into regular
1077 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
1079 HREF="http://www.pcre.org/man.txt"
1081 >http://www.pcre.org/man.txt</A
1083 You might also find the Perl man page on regular expressions (<TT
1087 useful, which is available on-line at <A
1088 HREF="http://www.perldoc.com/perl5.6/pod/perlre.html"
1090 >http://www.perldoc.com/perl5.6/pod/perlre.html</A
1093 > Note that the path pattern is automatically left-anchored at the <SPAN
1097 i.e. it matches as if it would start with a <SPAN
1100 > (regular expression speak
1101 for the beginning of a line).</P
1103 > Please also note that matching in the path is <SPAN
1107 >CASE INSENSITIVE</I
1110 by default, but you can switch to case sensitive at any point in the pattern by using the
1116 >www.example.com/(?-i)PaTtErN.*</TT
1118 only documents whose path starts with <TT
1128 > this capitalization.</P
1140 > All actions are disabled by default, until they are explicitly enabled
1141 somewhere in an actions file. Actions are turned on if preceded with a
1145 >, and turned off if preceded with a <SPAN
1154 >"do that action"</SPAN
1161 >"please block URLs that match the
1162 following patterns"</SPAN
1169 block URLs that match the following patterns, even if <TT
1173 previously applied."</SPAN
1177 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1178 separated by whitespace, like in
1181 >{+some-action -some-other-action{some-parameter}}</TT
1183 followed by a list of URL patterns, one per line, to which they apply.
1184 Together, the actions line and the following pattern lines make up a section
1185 of the actions file. </P
1188 There are three classes of actions:</P
1196 Boolean, i.e the action can only be <SPAN
1219 > # enable action <TT
1230 > # disable action <TT
1252 Parameterized, where some value is required in order to enable this type of action.
1274 >} # enable action and set parameter to <TT
1280 # overwriting parameter from previous match if necessary
1286 > # disable action. The parameter can be omitted</PRE
1293 > Note that if the URL matches multiple positive forms of a parameterized action,
1294 the last match wins, i.e. the params from earlier matches are simply ignored.
1300 >+hide-user-agent{ Mozilla 1.0 }</TT
1307 Multi-value. These look exactly like parameterized actions,
1308 but they behave differently: If the action applies multiple times to the
1309 same URL, but with different parameters, <SPAN
1322 > matches are remembered. This is used for actions
1323 that can be executed for the same request repeatedly, like adding multiple
1324 headers, or filtering through multiple filters. Syntax:
1345 >} # enable action and add <TT
1350 > to the list of parameters
1361 >} # remove the parameter <TT
1366 > from the list of parameters
1367 # If it was the last one left, disable the action.
1373 > # disable this action completely and remove all parameters from the list</PRE
1383 >+add-header{X-Fun-Header: Some text}</TT
1387 >+filter{html-annoyances}</TT
1394 > If nothing is specified in any actions file, no <SPAN
1398 taken. So in this case <SPAN
1402 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
1403 privacy and blocking features you need (although the provided default actions
1404 files will give a good starting point).</P
1406 > Later defined actions always over-ride earlier ones. So exceptions
1407 to any rules you make, should come in the latter part of the file (or
1408 in a file that is processed later when using multiple actions files). For
1409 multi-valued actions, the actions are applied in the order they are specified.
1410 Actions files are processed in the order they are defined in
1414 > (the default installation has three actions
1415 files). It also quite possible for any given URL pattern to match more than
1416 one pattern and thus more than one set of actions!</P
1418 > The list of valid <SPAN
1429 >8.5.1. add-header</H4
1433 CLASS="VARIABLELIST"
1439 >Confuse log analysis, custom applications</P
1445 > Sends a user defined HTTP header to the web server.
1458 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1459 It is recommended that you use the <SPAN
1473 > This action may be specified multiple times, in order to define multiple
1474 headers. This is rarely needed for the typical user. If you don't know what
1477 >"HTTP headers"</SPAN
1478 > are, you definitely don't need to worry about this
1494 >+add-header{X-User-Tracking: sucks}</PRE
1515 CLASS="VARIABLELIST"
1521 >Block ads or other obnoxious content</P
1527 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1528 forwarded to the remote server, but answered locally with a substitute page or image,
1529 as determined by the <TT
1532 HREF="actions-file.html#HANDLE-AS-IMAGE"
1539 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1540 >set-image-blocker</A
1564 > sends a special <SPAN
1568 for requests to blocked pages. This page contains links to find out why the request
1569 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1570 force feature enabled). The <SPAN
1573 > page adapts to the available
1574 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1575 if loaded into a small frame or window. If you are using <SPAN
1579 right now, you can take a look at the
1581 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1592 A very important exception occurs if <SPAN
1605 HREF="actions-file.html#HANDLE-AS-IMAGE"
1609 apply to the same request: it will then be replaced by an image. If
1613 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1614 >set-image-blocker</A
1617 (see below) also applies, the type of image will be determined by its parameter,
1618 if not, the standard checkerboard pattern is sent.
1621 > It is important to understand this process, in order
1622 to understand how <SPAN
1626 ads and other unwanted content.
1632 HREF="actions-file.html#FILTER"
1636 action can perform a very similar task, by <SPAN
1640 banner images and other content through rewriting the relevant URLs in the
1641 document's HTML source, so they don't get requested in the first place.
1642 Note that this is a totally different technique, and it's easy to confuse the two.
1646 >Example usage (section):</DT
1657 >{+block} # Block and replace with "blocked" page
1658 .nasty-stuff.example.com
1660 {+block +handle-as-image} # Block and replace with image
1677 NAME="CONTENT-TYPE-OVERWRITE"
1679 >8.5.3. content-type-overwrite</H4
1683 CLASS="VARIABLELIST"
1689 >Stop useless download menus from popping up, or change the browser's rendering mode</P
1695 > Replaces the <SPAN
1697 >"Content-Type:"</SPAN
1698 > HTTP server header.
1720 >"Content-Type:"</SPAN
1721 > HTTP server header is used by the
1722 browser to decide what to do with the document. The value of this
1723 header can cause the browser to open a download menu instead of
1724 displaying the document by itself, even if the document's format is
1725 supported by the browser.
1728 > The declared content type can also affect which rendering mode
1729 the browser chooses. If XHTML is delivered as <SPAN
1733 many browsers treat it as yet another broken HTML document.
1734 If it is send as <SPAN
1736 >"application/xml"</SPAN
1738 XHTML support will only display it, if the syntax is correct.
1741 > If you see a web site that proudly uses XHTML buttons, but sets
1744 >"Content-Type: text/html"</SPAN
1745 >, you can use Privoxy
1746 to overwrite it with <SPAN
1748 >"application/xml"</SPAN
1750 the web master's claim inside your XHTML-supporting browser.
1751 If the syntax is incorrect, the browser will complain loudly.
1754 > You can also go the opposite direction: if your browser prints
1755 error messages instead of rendering a document falsely declared
1756 as XHTML, you can overwrite the content type with
1760 > and have it rendered as broken HTML document.
1765 >content-type-overwrite</TT
1769 >"Content-Type:"</SPAN
1770 > headers that look like some kind of text.
1771 If you want to overwrite it unconditionally, you have to combine it with
1775 HREF="actions-file.html#FORCE-TEXT-MODE"
1779 This limitation exists for a reason, think twice before circumventing it.
1782 > Most of the time it's easier to enable
1786 HREF="actions-file.html#FILTER-SERVER-HEADERS"
1787 >filter-server-headers</A
1790 and replace this action with a custom regular expression. It allows you
1791 to activate it for every document of a certain site and it will still
1792 only replace the content types you aimed at.
1795 > Of course you can apply <TT
1797 >content-type-overwrite</TT
1799 to a whole site and then make URL based exceptions, but it's a lot
1800 more work to get the same precision.
1804 >Example usage (sections):</DT
1815 ># Check if www.example.net/ really uses valid XHTML
1816 {+content-type-overwrite {application/xml}}
1818 # but leave the content type unmodified if the URL looks like a style sheet
1819 {-content-type-overwrite}
1820 www.example.net/*.\.css$
1821 www.example.net/*.style</PRE
1836 NAME="CRUNCH-CLIENT-HEADER"
1838 >8.5.4. crunch-client-header</H4
1842 CLASS="VARIABLELIST"
1848 >Remove a client header <SPAN
1851 > has no dedicated action for.</P
1857 > Deletes every header send by the client that contains the string the user supplied as parameter.
1877 > This action allows you to block client headers for which no dedicated
1885 > will remove every client header that
1886 contains the string you supplied as parameter.
1889 > Regular expressions are <SPAN
1896 use this action to block different headers in the same request, unless
1897 they contain the same string.
1902 >crunch-client-header</TT
1903 > is only meant for quick tests.
1904 If you have to block several different headers, or only want to modify
1905 parts of them, you should enable
1909 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
1910 >filter-client-headers</A
1913 and create your own filter.
1934 > Don't block any header without understanding the consequences.
1942 >Example usage (section):</DT
1953 ># Block the non-existent "Privacy-Violation:" client header
1954 {+crunch-client-header {Privacy-Violation:}}
1971 NAME="CRUNCH-IF-NONE-MATCH"
1973 >8.5.5. crunch-if-none-match</H4
1977 CLASS="VARIABLELIST"
1983 >Prevent yet another way to track the user's steps between sessions.</P
1991 >"If-None-Match:"</SPAN
1992 > HTTP client header.
2012 > Removing the <SPAN
2014 >"If-None-Match:"</SPAN
2015 > HTTP client header
2016 is useful for filter testing, where you want to force a real
2017 reload instead of getting status code <SPAN
2021 would cause the browser to use a cached copy of the page.
2024 > It is also useful to make sure the header isn't used as a cookie
2028 > Blocking the <SPAN
2030 >"If-None-Match:"</SPAN
2031 > header shouldn't cause any
2032 caching problems, as long as the <SPAN
2034 >"If-Modified-Since:"</SPAN
2036 isn't blocked as well.
2039 > It is recommended to use this action together with
2043 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
2044 >hide-if-modified-since</A
2051 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
2052 >overwrite-last-modified</A
2058 >Example usage (section):</DT
2069 ># Let the browser revalidate cached documents without being tracked across sessions
2070 {+hide-if-modified-since {-1} \
2071 +overwrite-last-modified {randomize} \
2072 +crunch-if-none-match}
2088 NAME="CRUNCH-INCOMING-COOKIES"
2090 >8.5.6. crunch-incoming-cookies</H4
2094 CLASS="VARIABLELIST"
2100 > Prevent the web server from setting any cookies on your system
2109 >"Set-Cookie:"</SPAN
2110 > HTTP headers from server replies.
2130 > This action is only concerned with <SPAN
2147 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
2148 >crunch-outgoing-cookies</A
2157 > to disable cookies completely.
2166 > to use this action in conjunction
2170 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2171 >session-cookies-only</A
2174 since it would prevent the session cookies from being set. See also
2178 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
2179 >filter-content-cookies</A
2196 >+crunch-incoming-cookies</PRE
2211 NAME="CRUNCH-SERVER-HEADER"
2213 >8.5.7. crunch-server-header</H4
2217 CLASS="VARIABLELIST"
2223 >Remove a server header <SPAN
2226 > has no dedicated action for.</P
2232 > Deletes every header sent by the server that contains the string the user supplied as parameter.
2252 > This action allows you to block server headers for which no dedicated
2256 > action exists. <SPAN
2260 will remove every server header that contains the string you supplied as parameter.
2263 > Regular expressions are <SPAN
2270 use this action to block different headers in the same request, unless
2271 they contain the same string.
2276 >crunch-server-header</TT
2277 > is only meant for quick tests.
2278 If you have to block several different headers, or only want to modify
2279 parts of them, you should enable
2283 HREF="actions-file.html#FILTER-SERVER-HEADERS"
2284 >filter-server-headers</A
2287 and create your own filter.
2308 > Don't block any header without understanding the consequences.
2316 >Example usage (section):</DT
2327 ># Crunch server headers that try to prevent caching
2328 {+crunch-server-header {no-cache}}
2344 NAME="CRUNCH-OUTGOING-COOKIES"
2346 >8.5.8. crunch-outgoing-cookies</H4
2350 CLASS="VARIABLELIST"
2356 > Prevent the web server from reading any cookies from your system
2366 > HTTP headers from client requests.
2386 > This action is only concerned with <SPAN
2403 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
2404 >crunch-incoming-cookies</A
2413 > to disable cookies completely.
2422 > to use this action in conjunction
2426 HREF="actions-file.html#SESSION-COOKIES-ONLY"
2427 >session-cookies-only</A
2430 since it would prevent the session cookies from being read.
2445 >+crunch-outgoing-cookies</PRE
2460 NAME="DEANIMATE-GIFS"
2462 >8.5.9. deanimate-gifs</H4
2466 CLASS="VARIABLELIST"
2472 >Stop those annoying, distracting animated GIF images.</P
2478 > De-animate GIF animations, i.e. reduce them to their first or last image.
2504 > This will also shrink the images considerably (in bytes, not pixels!). If
2508 > is given, the first frame of the animation
2509 is used as the replacement. If <SPAN
2512 > is given, the last
2513 frame of the animation is used instead, which probably makes more sense for
2514 most banner animations, but also has the risk of not showing the entire
2515 last frame (if it is only a delta to an earlier frame).
2518 > You can safely use this action with patterns that will also match non-GIF
2519 objects, because no attempt will be made at anything that doesn't look like
2535 >+deanimate-gifs{last}</PRE
2550 NAME="DOWNGRADE-HTTP-VERSION"
2552 >8.5.10. downgrade-http-version</H4
2556 CLASS="VARIABLELIST"
2562 >Work around (very rare) problems with HTTP/1.1</P
2568 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
2588 > This is a left-over from the time when <SPAN
2592 didn't support important HTTP/1.1 features well. It is left here for the
2593 unlikely case that you experience HTTP/1.1 related problems with some server
2594 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
2595 is a chance you might need this action.
2599 >Example usage (section):</DT
2610 >{+downgrade-http-version}
2611 problem-host.example.com</PRE
2626 NAME="FAST-REDIRECTS"
2628 >8.5.11. fast-redirects</H4
2632 CLASS="VARIABLELIST"
2638 >Fool some click-tracking scripts and speed up indirect links.</P
2644 > Detects redirection URLs and redirects the browser without contacting
2645 the redirection server first.
2664 >"simple-check"</SPAN
2665 > to just search for the string <SPAN
2669 to detect redirection URLs.
2676 >"check-decoded-url"</SPAN
2677 > to decode URLs (if necessary) before searching
2678 for redirection URLs.
2688 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2689 will link to some script on their own servers, giving the destination as a
2690 parameter, which will then redirect you to the final target. URLs
2691 resulting from this scheme typically look like:
2694 >"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</SPAN
2698 > Sometimes, there are even multiple consecutive redirects encoded in the
2699 URL. These redirections via scripts make your web browsing more traceable,
2700 since the server from which you follow such a link can see where you go
2701 to. Apart from that, valuable bandwidth and time is wasted, while your
2702 browser asks the server for one redirect after the other. Plus, it feeds
2706 > This feature is currently not very smart and is scheduled for improvement.
2707 If it is enabled by default, you will have to create some exceptions to
2708 this action. It can lead to failures in several ways:
2711 > Not every URLs with other URLs as parameters is evil.
2712 Some sites offer a real service that requires this information to work.
2713 For example a validation service needs to know, which document to validate.
2717 > assumes that every URL parameter that
2718 looks like another URL is a redirection target, and will always redirect to
2719 the last one. Most of the time the assumption is correct, but if it isn't,
2720 the user gets redirected anyway.
2723 > Another failure occurs if the URL contains other parameters after the URL parameter.
2727 >"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</SPAN
2729 contains the redirection URL <SPAN
2731 >"http://www.example.net/"</SPAN
2733 followed by another parameter. <TT
2737 and will cause a redirect to <SPAN
2739 >"http://www.example.net/&foo=bar"</SPAN
2741 Depending on the target server configuration, the parameter will be silently ignored
2744 >"page not found"</SPAN
2745 > error. It is possible to fix these redirected
2749 HREF="actions-file.html#FILTER-CLIENT-HEADERS"
2750 >filter-client-headers</A
2753 but it requires a little effort.
2756 > To detect a redirection URL, <TT
2760 looks for the string <SPAN
2763 >, either in plain text
2764 (invalid but often used) or encoded as <SPAN
2768 Some sites use their own URL encoding scheme, encrypt the address
2769 of the target server or replace it with a database id. In theses cases
2773 > is fooled and the request reaches the
2774 redirection server where it probably gets logged.
2789 >+fast-redirects{simple-check}</PRE
2804 >+fast-redirects{check-decoded-url}</PRE
2825 CLASS="VARIABLELIST"
2831 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
2837 > All files of text-based type, most notably HTML and JavaScript, to which this
2838 action applies, are filtered on-the-fly through the specified regular expression
2839 based substitutions. (Note: as of version 3.0.3 plain text documents
2840 are exempted from filtering, because web servers often use the
2844 > MIME type for all files whose type they
2845 don't know.) By default, filtering works only on the document content
2846 itself, not the headers.
2859 > The name of a filter, as defined in the <A
2860 HREF="filter-file.html"
2863 Filters can be defined in one or more files as defined by the
2867 HREF="config.html#FILTERFILE"
2878 > is the collection of filters
2879 supplied by the developers. Locally defined filters should go
2880 in their own file, such as <TT
2886 > When used in its negative form,
2887 and without parameters, filtering is completely disabled.
2894 > For your convenience, there are a number of pre-defined filters available
2895 in the distribution filter file that you can use. See the examples below for
2899 > Filtering requires buffering the page content, which may appear to
2900 slow down page rendering since nothing is displayed until all content has
2901 passed the filters. (It does not really take longer, but seems that way
2902 since the page is not incrementally displayed.) This effect will be more
2903 noticeable on slower connections.
2906 > This is very powerful feature, and <SPAN
2908 >"rolling your own"</SPAN
2910 filters requires a knowledge of regular expressions and HTML.
2913 > The amount of data that can be filtered is limited to the
2917 HREF="config.html#BUFFER-LIMIT"
2921 option in the main <A
2925 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2926 data, and all pending data, is passed through unfiltered.
2929 > Inadequate MIME types, such as zipped files, are not filtered at all.
2930 (Again, only text-based types except plain text). Encrypted SSL data
2931 (from HTTPS servers) cannot be filtered either, since this would violate
2932 the integrity of the secure transaction. In some situations it might
2933 be necessary to protect certain text, like source code, from filtering
2934 by defining appropriate <TT
2940 > At this time, <SPAN
2943 > cannot (yet!) uncompress compressed
2944 documents. If you want filtering to work on all documents, even those that
2945 would normally be sent compressed, use the
2949 HREF="actions-file.html#PREVENT-COMPRESSION"
2950 >prevent-compression</A
2953 action in conjunction with <TT
2959 > Filtering can achieve some of the same effects as the
2963 HREF="actions-file.html#BLOCK"
2967 action, i.e. it can be used to block ads and banners. But the mechanism
2968 works quite differently. One effective use, is to block ad banners
2969 based on their size (see below), since many of these seem to be somewhat
2976 > with suggestions for new or
2977 improved filters is particularly welcome!
2980 > The below list has only the names and a one-line description of each
2981 predefined filter. There are <A
2982 HREF="filter-file.html#PREDEFINED-FILTERS"
2984 verbose explanations</A
2985 > of what these filters do in the <A
2986 HREF="filter-file.html"
2987 >filter file chapter</A
2992 >Example usage (with filters from the distribution <TT
2997 HREF="filter-file.html#PREDEFINED-FILTERS"
2998 >the Predefined Filters section</A
3000 more explanation on each:</DT
3004 NAME="FILTER-JS-ANNOYANCES"
3015 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
3023 NAME="FILTER-JS-EVENTS"
3034 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
3042 NAME="FILTER-HTML-ANNOYANCES"
3053 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
3061 NAME="FILTER-CONTENT-COOKIES"
3072 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
3080 NAME="FILTER-REFRESH-TAGS"
3091 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
3099 NAME="FILTER-UNSOLICITED-POPUPS"
3110 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
3118 NAME="FILTER-ALL-POPUPS"
3129 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
3137 NAME="FILTER-IMG-REORDER"
3148 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
3156 NAME="FILTER-BANNERS-BY-SIZE"
3167 >+filter{banners-by-size} # Kill banners by size</PRE
3175 NAME="FILTER-BANNERS-BY-LINK"
3186 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
3194 NAME="FILTER-WEBBUGS"
3205 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
3213 NAME="FILTER-TINY-TEXTFORMS"
3224 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
3232 NAME="FILTER-JUMPING-WINDOWS"
3243 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
3251 NAME="FILTER-FRAMESET-BORDERS"
3262 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
3270 NAME="FILTER-DEMORONIZER"
3281 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
3289 NAME="FILTER-SHOCKWAVE-FLASH"
3300 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
3308 NAME="FILTER-QUICKTIME-KIOSKMODE"
3319 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
3338 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
3346 NAME="FILTER-CRUDE-PARENTAL"
3357 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
3365 NAME="FILTER-IE-EXPLOITS"
3376 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
3391 NAME="FILTER-CLIENT-HEADERS"
3393 >8.5.13. filter-client-headers</H4
3397 CLASS="VARIABLELIST"
3403 > To apply filtering to the client's (browser's) headers
3410 >Extend filtering capabilities to the client's headers, which
3411 by default applies only to the document itself.
3431 > Regular expressions can be used to filter headers as well. Check your
3432 filters closely before activating this action, as it can easily lead to broken
3437 These filters are applied to each header on its own, not to them
3438 all at once. This makes it easier to diagnose problems, but on the downside
3439 you can't write filters that only change header x if header y's value is
3443 > The filters are used after the other header actions have finished and can
3444 use their output as input.
3447 > Whenever possible one should specify <TT
3454 >, the whole header name and the colon, to make sure
3455 the filter doesn't cause havoc to other headers or the
3456 page itself. For example if you want to transform
3475 >s@Galeon/\d\.\d\.\d @@</PRE
3491 >s@^(User-Agent:.*) Galeon/\d\.\d\.\d (Firefox/\d\.\d\.\d\.\d)$@$1 $2@</PRE
3498 >Example usage (section):</DT
3509 >{+filter-client-headers +filter{test_filter}}
3510 problem-host.example.com
3526 NAME="FILTER-SERVER-HEADERS"
3528 >8.5.14. filter-server-headers</H4
3532 CLASS="VARIABLELIST"
3538 > To apply filtering to the server's headers
3545 >Extend filtering capabilities to the server's headers, which
3546 by default applies only to the document itself.
3568 >filter-client-headers</TT
3570 the server instead. To filter both server and client, use both.
3575 >filter-client-headers</TT
3577 filters before activating this action, as it can easily lead to broken
3582 These filters are applied to each header on its own, not to them
3583 all at once. This makes it easier to diagnose problems, but on the downside
3584 you can't write filters that only change header x if header y's value is
3588 > The filters are used after the other header actions have finished and can
3589 use their output as input.
3592 > Remember too, whenever possible one should specify <TT
3599 >, the whole header name and the colon, to make sure
3600 the filter doesn't cause havoc to other headers or the
3601 page itself. See above for example.
3605 >Example usage (section):</DT
3616 >{+filter-server-headers +filter{test_filter}}
3617 problem-host.example.com
3633 NAME="FORCE-TEXT-MODE"
3635 >8.5.15. force-text-mode</H4
3639 CLASS="VARIABLELIST"
3648 > to treat a document as if it was in some kind of <SPAN
3660 > Declares a document as text, even if the <SPAN
3662 >"Content-Type:"</SPAN
3663 > isn't detected as such.
3686 HREF="actions-file.html#FILTER"
3693 > tries to only filter files that are
3694 in some kind of text format. The same restrictions apply to
3698 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3699 >content-type-overwrite</A
3704 >force-text-mode</TT
3705 > declares a document as text,
3706 without looking at the <SPAN
3708 >"Content-Type:"</SPAN
3730 > Think twice before activating this action. Filtering binary data
3731 with regular expressions can cause file damage.
3766 NAME="HANDLE-AS-EMPTY-DOCUMENT"
3768 >8.5.16. handle-as-empty-document</H4
3772 CLASS="VARIABLELIST"
3778 >Mark URLs that should be replaced by empty documents <SPAN
3782 >if they get blocked</I
3790 > This action alone doesn't do anything noticeable. It just marks URLs.
3794 HREF="actions-file.html#BLOCK"
3804 the presence or absence of this mark decides whether an HTML <SPAN
3808 page, or an empty document will be sent to the client as a substitute for the blocked content.
3815 > document isn't literally empty, but actually contains a single space.
3835 > Some browsers complain about syntax errors if JavaScript documents
3836 are blocked with <SPAN
3840 default HTML page; this option can be used to silence them.
3843 > The content type for the empty document can be specified with
3847 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3848 >content-type-overwrite{}</A
3851 but usually this isn't necessary.
3866 ># Block all documents on example.org that end with ".js",
3867 # but send an empty document instead of the usual HTML message.
3868 {+block +handle-as-empty-document}
3885 NAME="HANDLE-AS-IMAGE"
3887 >8.5.17. handle-as-image</H4
3891 CLASS="VARIABLELIST"
3897 >Mark URLs as belonging to images (so they'll be replaced by imagee <SPAN
3901 >if they get blocked</I
3909 > This action alone doesn't do anything noticeable. It just marks URLs as images.
3913 HREF="actions-file.html#BLOCK"
3923 the presence or absence of this mark decides whether an HTML <SPAN
3927 page, or a replacement image (as determined by the <TT
3930 HREF="actions-file.html#SET-IMAGE-BLOCKER"
3931 >set-image-blocker</A
3933 > action) will be sent to the
3934 client as a substitute for the blocked content.
3954 > The below generic example section is actually part of <TT
3958 It marks all URLs with well-known image file name extensions as images and should
3962 > Users will probably only want to use the handle-as-image action in conjunction with
3966 HREF="actions-file.html#BLOCK"
3969 >, to block sources of banners, whose URLs don't
3970 reflect the file type, like in the second example section.
3973 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
3974 frames require an HTML page to be sent, or they won't display properly.
3977 >handle-as-image</TT
3978 > in this situation will not replace the
3979 ad frame with an image, but lead to error messages.
3983 >Example usage (sections):</DT
3994 ># Generic image extensions:
3997 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
3999 # These don't look like images, but they're banners and should be
4000 # blocked as images:
4002 {+block +handle-as-image}
4003 some.nasty-banner-server.com/junk.cgi?output=trash
4005 # Banner source! Who cares if they also have non-image content?
4006 ad.doubleclick.net </PRE
4021 NAME="HIDE-ACCEPT-LANGUAGE"
4023 >8.5.18. hide-accept-language</H4
4027 CLASS="VARIABLELIST"
4033 >Pretend to use different language settings.</P
4039 > Deletes or replaces the <SPAN
4041 >"Accept-Language:"</SPAN
4042 > HTTP header in client requests.
4058 >, or any user defined value.
4065 > Faking the browser's language settings can be useful to make a
4066 foreign User-Agent set with
4070 HREF="actions-file.html#HIDE-USER-AGENT"
4077 > However some sites with content in different languages check the
4080 >"Accept-Language:"</SPAN
4081 > to decide which one to take by default.
4082 Sometimes it isn't possible to later switch to another language without
4085 >"Accept-Language:"</SPAN
4089 > Therefore it's a good idea to either only change the
4092 >"Accept-Language:"</SPAN
4093 > header to languages you understand,
4094 or to languages that aren't wide spread.
4097 > Before setting the <SPAN
4099 >"Accept-Language:"</SPAN
4101 to a rare language, you should consider that it helps to
4102 make your requests unique and thus easier to trace.
4103 If you don't plan to change this header frequently,
4104 you should stick to a common language.
4108 >Example usage (section):</DT
4119 ># Pretend to use Canadian language settings.
4120 {+hide-accept-language{en-ca} \
4121 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4138 NAME="HIDE-CONTENT-DISPOSITION"
4140 >8.5.19. hide-content-disposition</H4
4144 CLASS="VARIABLELIST"
4150 >Prevent download menus for content you prefer to view inside the browser.</P
4156 > Deletes or replaces the <SPAN
4158 >"Content-Disposition:"</SPAN
4159 > HTTP header set by some servers.
4175 >, or any user defined value.
4182 > Some servers set the <SPAN
4184 >"Content-Disposition:"</SPAN
4186 documents they assume you want to save locally before viewing them.
4189 >"Content-Disposition:"</SPAN
4190 > header contains the file name
4191 the browser is supposed to use by default.
4194 > In most browsers that understand this header, it makes it impossible to
4201 > the document, without downloading it first,
4202 even if it's just a simple text file or an image.
4205 > Removing the <SPAN
4207 >"Content-Disposition:"</SPAN
4209 to prevent this annoyance, but some browsers additionally check the
4212 >"Content-Type:"</SPAN
4213 > header, before they decide if they can
4214 display a document without saving it first. In these cases, you have
4215 to change this header as well, before the browser stops displaying
4219 > It is also possible to change the server's file name suggestion
4220 to another one, but in most cases it isn't worth the time to set
4236 ># Disarm the download link in Sourceforge's patch tracker
4238 +content-type-overwrite {text/plain}\
4239 +hide-content-disposition {block} }
4240 .sourceforge.net/tracker/download.php</PRE
4255 NAME="HIDE-IF-MODIFIED-SINCE"
4257 >8.5.20. hide-if-modified-since</H4
4261 CLASS="VARIABLELIST"
4267 >Prevent yet another way to track the user's steps between sessions.</P
4275 >"If-Modified-Since:"</SPAN
4276 > HTTP client header or modifies its value.
4292 >, or a user defined value that specifies a range of hours.
4299 > Removing this header is useful for filter testing, where you want to force a real
4300 reload instead of getting status code <SPAN
4303 >, which would cause the
4304 browser to use a cached copy of the page.
4307 > Instead of removing the header, <TT
4309 >hide-if-modified-since</TT
4311 also add or substract a random amount of time to/from the headers value.
4312 You specify a range of hours were the random factor should be chosen from and
4316 > does the rest. A negative value means
4317 subtracting, a positive value adding.
4320 > Randomizing the value of the <SPAN
4322 >"If-Modified-Since:"</SPAN
4324 sure it isn't used as a cookie replacement, but you will run into
4325 caching problems if the random range is too high.
4328 > It is a good idea to only use a small negative value and let
4332 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
4333 >overwrite-last-modified</A
4336 handle the greater changes.
4339 > It is also recommended to use this action together with
4343 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
4344 >crunch-if-none-match</A
4350 >Example usage (section):</DT
4361 ># Let the browser revalidate without being tracked across sessions
4362 {+hide-if-modified-since {-1}\
4363 +overwrite-last-modified {randomize}\
4364 +crunch-if-none-match}
4380 NAME="HIDE-FORWARDED-FOR-HEADERS"
4382 >8.5.21. hide-forwarded-for-headers</H4
4386 CLASS="VARIABLELIST"
4392 >Improve privacy by hiding the true source of the request</P
4398 > Deletes any existing <SPAN
4400 >"X-Forwarded-for:"</SPAN
4401 > HTTP header from client requests,
4402 and prevents adding a new one.
4422 > It is fairly safe to leave this on.
4425 > This action is scheduled for improvement: It should be able to generate forged
4428 >"X-Forwarded-for:"</SPAN
4429 > headers using random IP addresses from a specified network,
4430 to make successive requests from the same client look like requests from a pool of different
4431 users sharing the same proxy.
4446 >+hide-forwarded-for-headers</PRE
4461 NAME="HIDE-FROM-HEADER"
4463 >8.5.22. hide-from-header</H4
4467 CLASS="VARIABLELIST"
4473 >Keep your (old and ill) browser from telling web servers your email address</P
4479 > Deletes any existing <SPAN
4482 > HTTP header, or replaces it with the
4499 >, or any user defined value.
4509 > will completely remove the header
4510 (not to be confused with the <TT
4513 HREF="actions-file.html#BLOCK"
4520 > Alternately, you can specify any value you prefer to be sent to the web
4521 server. If you do, it is a matter of fairness not to use any address that
4522 is actually used by a real person.
4525 > This action is rarely needed, as modern web browsers don't send
4544 >+hide-from-header{block}</PRE
4557 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
4572 NAME="HIDE-REFERRER"
4574 >8.5.23. hide-referrer</H4
4581 CLASS="VARIABLELIST"
4587 >Conceal which link you followed to get to a particular site</P
4596 > (sic) HTTP header from the client request,
4597 or replaces it with a forged one.
4616 >"conditional-block"</SPAN
4617 > to delete the header completely if the host has changed.</P
4624 > to delete the header unconditionally.</P
4631 > to pretend to be coming from the homepage of the server we are talking to.</P
4635 >Any other string to set a user defined referrer.</P
4645 >conditional-block</TT
4646 > is the only parameter,
4647 that isn't easily detected in the server's log file. If it blocks the
4648 referrer, the request will look like the visitor used a bookmark or
4649 typed in the address directly.
4652 > Leaving the referrer unmodified for requests on the same host
4653 allows the server owner to see the visitor's <SPAN
4657 but in most cases she could also get that information by comparing
4658 other parts of the log file: for example the User-Agent if it isn't
4659 a very common one, or the user's IP address if it doesn't change between
4663 > Always blocking the referrer, or using a custom one, can lead to
4664 failures on servers that check the referrer before they answer any
4665 requests, in an attempt to prevent their valuable content from being
4666 embedded or linked to elsewhere.
4671 >conditional-block</TT
4676 will work with referrer checks, as long as content and valid referring page
4677 are on the same host. Most of the time that's the case.
4684 > is an alternate spelling of
4688 > and the two can be can be freely
4689 substituted with each other. (<SPAN
4693 correct English spelling, however the HTTP specification has a bug - it
4694 requires it to be spelled as <SPAN
4712 >+hide-referrer{forge}</PRE
4725 >+hide-referrer{http://www.yahoo.com/}</PRE
4740 NAME="HIDE-USER-AGENT"
4742 >8.5.24. hide-user-agent</H4
4746 CLASS="VARIABLELIST"
4752 >Conceal your type of browser and client operating system</P
4758 > Replaces the value of the <SPAN
4760 >"User-Agent:"</SPAN
4762 in client requests with the specified value.
4775 > Any user-defined string.
4800 > This can lead to problems on web sites that depend on looking at this header in
4801 order to customize their content for different browsers (which, by the
4808 > the right thing to do: good web sites
4809 work browser-independently).
4817 > Using this action in multi-user setups or wherever different types of
4818 browsers will access the same <SPAN
4828 >. In single-user, single-browser
4829 setups, you might use it to delete your OS version information from
4830 the headers, because it is an invitation to exploit known bugs for your
4831 OS. It is also occasionally useful to forge this in order to access
4832 sites that won't let you in otherwise (though there may be a good
4833 reason in some cases). Example of this: some MSN sites will not
4837 > enter, yet forging to a
4841 > user-agent works just fine.
4842 (Must be just a silly MS goof, I'm sure :-).
4845 > This action is scheduled for improvement.
4860 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
4875 NAME="INSPECT-JPEGS"
4877 >8.5.25. inspect-jpegs</H4
4881 CLASS="VARIABLELIST"
4887 >To protect against the MS buffer over-run in JPEG processing</P
4893 > To protect against a known exploit
4913 > See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
4914 common image types found across the Internet. The exploit as described can
4915 allow execution of code on the target system, giving an attacker access
4916 to the system in question by merely planting an altered JPEG image, which
4917 would have no obvious indications of what lurks inside. This action
4918 prevents unwanted intrusion.
4933 >+inspect-jpegs</PRE
4949 >8.5.26. kill-popups<A
4956 CLASS="VARIABLELIST"
4962 >Eliminate those annoying pop-up windows (deprecated)</P
4968 > While loading the document, replace JavaScript code that opens
4969 pop-up windows with (syntactically neutral) dummy code on the fly.
4989 > This action is basically a built-in, hardwired special-purpose filter
4990 action, but there are important differences: For <TT
4994 the document need not be buffered, so it can be incrementally rendered while
4995 downloading. But <TT
4998 > doesn't catch as many pop-ups as
5002 HREF="actions-file.html#FILTER-ALL-POPUPS"
5011 does and is not as smart as <TT
5014 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5018 >unsolicited-popups</I
5026 > Think of it as a fast and efficient replacement for a filter that you
5027 can use if you don't want any filtering at all. Note that it doesn't make
5028 sense to combine it with any <TT
5031 HREF="actions-file.html#FILTER"
5035 since as soon as one <TT
5038 HREF="actions-file.html#FILTER"
5042 the whole document needs to be buffered anyway, which destroys the advantage of
5046 > action over its filter equivalent.
5049 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
5050 pop-ups to display forms, shopping carts etc, and the <TT
5053 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
5057 >unsolicited-popups</I
5062 > does a fairly good job of catching only the unwanted ones.
5065 > If the only kind of pop-ups that you want to kill are exit consoles (those
5072 > windows that appear when you close an other
5073 one), you might want to use
5077 HREF="actions-file.html#FILTER"
5115 NAME="LIMIT-CONNECT"
5117 >8.5.27. limit-connect</H4
5121 CLASS="VARIABLELIST"
5127 >Prevent abuse of <SPAN
5130 > as a TCP proxy relay or disable SSL for untrusted sites</P
5136 > Specifies to which ports HTTP CONNECT requests are allowable.
5149 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
5150 defaulting to 0 and the maximum to 65K).
5157 > By default, i.e. if no <TT
5164 > only allows HTTP CONNECT
5165 requests to port 443 (the standard, secure HTTPS port). Use
5169 > if more fine-grained control is desired
5170 for some or all destinations.
5173 > The CONNECT methods exists in HTTP to allow access to secure websites
5177 > URLs) through proxies. It works very simply:
5178 the proxy connects to the server on the specified port, and then
5179 short-circuits its connections to the client and to the remote server.
5180 This can be a big security hole, since CONNECT-enabled proxies can be
5181 abused as TCP relays very easily.
5187 > relays HTTPS traffic without seeing
5188 the decoded content. Websites can leverage this limitation to circumvent Privoxy's
5189 filters. By specifying an invalid port range you can disable HTTPS entirely.
5190 If you plan to disable SSL by default, consider enabling
5194 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
5195 >treat-forbidden-connects-like-blocks</A
5198 as well, to be able to quickly create exceptions.
5202 >Example usages:</DT
5213 >+limit-connect{443} # This is the default and need not be specified.
5214 +limit-connect{80,443} # Ports 80 and 443 are OK.
5215 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
5216 +limit-connect{-} # All ports are OK
5217 +limit-connect{,} # No HTTPS traffic is allowed</PRE
5232 NAME="PREVENT-COMPRESSION"
5234 >8.5.28. prevent-compression</H4
5238 CLASS="VARIABLELIST"
5244 > Ensure that servers send the content uncompressed, so it can be
5248 HREF="actions-file.html#FILTER"
5258 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5278 > More and more websites send their content compressed by default, which
5279 is generally a good idea and saves bandwidth. But for the <TT
5282 HREF="actions-file.html#FILTER"
5288 HREF="actions-file.html#DEANIMATE-GIFS"
5295 HREF="actions-file.html#KILL-POPUPS"
5302 > needs access to the uncompressed data.
5303 Unfortunately, <SPAN
5306 > can't yet(!) uncompress, filter, and
5307 re-compress the content on the fly. So if you want to ensure that all websites, including
5308 those that normally compress, can be filtered, you need to use this action.
5311 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
5312 actions, you will typically want to use <TT
5314 >prevent-compression</TT
5319 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5320 documents correctly (they send an empty document body). If you use <TT
5322 >prevent-compression</TT
5324 per default, you'll have to add exceptions for those sites. See the example for how to do that.
5328 >Example usage (sections):</DT
5341 {+prevent-compression}
5344 # Make exceptions for ill sites:
5346 {-prevent-compression}
5348 www.pclinuxonline.com</PRE
5363 NAME="OVERWRITE-LAST-MODIFIED"
5365 >8.5.29. overwrite-last-modified</H4
5369 CLASS="VARIABLELIST"
5375 >Prevent yet another way to track the user's steps between sessions.</P
5383 >"Last-Modified:"</SPAN
5384 > HTTP server header or modifies its value.
5397 > One of the keywords: <SPAN
5402 >"reset-to-request-time"</SPAN
5414 > Removing the <SPAN
5416 >"Last-Modified:"</SPAN
5417 > header is useful for filter
5418 testing, where you want to force a real reload instead of getting status
5422 >, which would cause the browser to reuse the old
5423 version of the page.
5429 > option overwrites the value of the
5432 >"Last-Modified:"</SPAN
5433 > header with a randomly chosen time
5434 between the original value and the current time. In theory the server
5435 could send each document with a different <SPAN
5437 >"Last-Modified:"</SPAN
5439 header to track visits without using cookies. <SPAN
5443 makes it impossible and the browser can still revalidate cached documents.
5448 >"reset-to-request-time"</SPAN
5449 > overwrites the value of the
5452 >"Last-Modified:"</SPAN
5453 > header with the current time. You could use
5454 this option together with
5458 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5459 >hided-if-modified-since</A
5462 to further customize your random range.
5465 > The preferred parameter here is <SPAN
5469 to use, as long as the time settings are more or less correct.
5470 If the server sets the <SPAN
5472 >"Last-Modified:"</SPAN
5473 > header to the time
5474 of the request, the random range becomes zero and the value stays the same.
5475 Therefore you should later randomize it a second time with
5479 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5480 >hided-if-modified-since</A
5486 > It is also recommended to use this action together with
5490 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5491 >crunch-if-none-match</A
5508 ># Let the browser revalidate without being tracked across sessions
5509 {+hide-if-modified-since {-1}\
5510 +overwrite-last-modified {randomize}\
5511 +crunch-if-none-match}
5529 >8.5.30. redirect</H4
5533 CLASS="VARIABLELIST"
5539 > Redirect requests to other sites.
5546 > Convinces the browser that the requested document has been moved
5547 to another location and the browser should get it from there.
5567 > This action is useful to replace whole documents with your own
5568 ones. For that to work, they have to be available on another server.
5571 > You can do the same by combining the actions
5575 HREF="actions-file.html#BLOCK"
5582 HREF="actions-file.html#HANDLE-AS-IMAGE"
5589 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5590 >set-image-blocker{URL}</A
5593 It doesn't sound right for non-image documents, and that's why this action
5597 > This action will be ignored if you use it together with
5601 HREF="actions-file.html#BLOCK"
5619 ># Replace example.com's style sheet with another one
5620 {+redirect{http://localhost/css-replacements/example.com.css}}
5621 example.com/stylesheet.css</PRE
5636 NAME="SEND-VANILLA-WAFER"
5638 >8.5.31. send-vanilla-wafer</H4
5642 CLASS="VARIABLELIST"
5648 > Feed log analysis scripts with useless data.
5655 > Sends a cookie with each request stating that you do not accept any copyright
5656 on cookies sent to you, and asking the site operator not to track you.
5676 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
5679 > This action is rarely used and not enabled in the default configuration.
5694 >+send-vanilla-wafer</PRE
5711 >8.5.32. send-wafer</H4
5715 CLASS="VARIABLELIST"
5721 > Send custom cookies or feed log analysis scripts with even more useless data.
5728 > Sends a custom, user-defined cookie with each request.
5741 > A string of the form <SPAN
5761 > Being multi-valued, multiple instances of this action can apply to the same request,
5762 resulting in multiple cookies being sent.
5765 > This action is rarely used and not enabled in the default configuration.
5769 >Example usage (section):</DT
5780 >{+send-wafer{UsingPrivoxy=true}}
5781 my-internal-testing-server.void</PRE
5796 NAME="SESSION-COOKIES-ONLY"
5798 >8.5.33. session-cookies-only</H4
5802 CLASS="VARIABLELIST"
5808 > Allow only temporary <SPAN
5811 > cookies (for the current
5812 browser session <SPAN
5830 >"Set-Cookie:"</SPAN
5832 server headers. Most browsers will not store such cookies permanently and
5833 forget them in between sessions.
5853 > This is less strict than <TT
5856 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5857 >crunch-incoming-cookies</A
5863 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5864 >crunch-outgoing-cookies</A
5866 > and allows you to browse
5867 websites that insist or rely on setting cookies, without compromising your privacy too badly.
5870 > Most browsers will not permanently store cookies that have been processed by
5873 >session-cookies-only</TT
5874 > and will forget about them between sessions.
5875 This makes profiling cookies useless, but won't break sites which require cookies so
5876 that you can log in for transactions. This is generally turned on for all
5877 sites, and is the recommended setting.
5888 >session-cookies-only</TT
5893 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5894 >crunch-incoming-cookies</A
5900 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5901 >crunch-outgoing-cookies</A
5903 >. If you do, cookies
5904 will be plainly killed.
5907 > Note that it is up to the browser how it handles such cookies without an <SPAN
5911 field. If you use an exotic browser, you might want to try it out to be sure.
5914 > This setting also has no effect on cookies that may have been stored
5915 previously by the browser before starting <SPAN
5919 These would have to be removed manually.
5927 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
5928 >content-cookies filter</A
5930 to block some types of cookies. Content cookies are not effected by
5933 >session-cookies-only</TT
5949 >+session-cookies-only</PRE
5964 NAME="SET-IMAGE-BLOCKER"
5966 >8.5.34. set-image-blocker</H4
5970 CLASS="VARIABLELIST"
5976 >Choose the replacement for blocked images</P
5982 > This action alone doesn't do anything noticeable. If <SPAN
5992 HREF="actions-file.html#BLOCK"
6004 HREF="actions-file.html#HANDLE-AS-IMAGE"
6014 apply, i.e. if the request is to be blocked as an image,
6021 > the parameter of this action decides what will be
6022 sent as a replacement.
6042 > to send a built-in checkerboard pattern image. The image is visually
6043 decent, scales very well, and makes it obvious where banners were busted.
6051 > to send a built-in transparent image. This makes banners disappear
6052 completely, but makes it hard to detect where <SPAN
6056 images on a given page and complicates troubleshooting if <SPAN
6060 has blocked innocent images, like navigation icons.
6074 send a redirect to <TT
6080 to any image anywhere, even in your local filesystem via <SPAN
6084 (But note that not all browsers support redirecting to a local file system).
6087 > A good application of redirects is to use special <SPAN
6091 URLs, which send the built-in images, as <TT
6097 This has the same visual effect as specifying <SPAN
6104 the first place, but enables your browser to cache the replacement image, instead of requesting
6105 it over and over again.
6114 > The URLs for the built-in images are <SPAN
6116 >"http://config.privoxy.org/send-banner?type=<TT
6137 > There is a third (advanced) type, called <SPAN
6149 >set-image-blocker</TT
6150 >, but meant for use from <A
6151 HREF="filter-file.html"
6154 Auto will select the type of image that would have applied to the referring page, had it been an image.
6172 >+set-image-blocker{pattern}</PRE
6179 > Redirect to the BSD devil:
6190 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
6197 > Redirect to the built-in pattern for better caching:
6208 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
6223 NAME="TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
6225 >8.5.35. treat-forbidden-connects-like-blocks</H4
6229 CLASS="VARIABLELIST"
6235 >Block forbidden connects with an easy to find error message.</P
6241 > If this action is enabled, <SPAN
6245 makes a difference between forbidden connects and ordinary blocks.
6269 HREF="actions-file.html#LIMIT-CONNECT"
6275 with a short error message inside the headers. If the browser doesn't display
6276 headers (most don't), you just see an empty page.
6279 > With this action enabled, <SPAN
6283 the message that is used for ordinary blocks instead. If you decide
6284 to make an exception for the page in question, you can do so by
6294 > requests the clients tell
6298 > which host they are interested
6299 in, but not which document they plan to get later. As a result, the
6302 >"Go there anyway"</SPAN
6303 > link becomes rather useless:
6304 it lets the client request the home page of the forbidden host
6305 through unencrypted HTTP, still using the port of the last request.
6308 > If you previously configured <SPAN
6312 request through a SSL tunnel, everything will work. Most likely you haven't
6313 and the server will responds with an error message because it is expecting
6329 >+treat-forbidden-connects-like-blocks</PRE
6346 >8.5.36. Summary</H3
6348 > Note that many of these actions have the potential to cause a page to
6349 misbehave, possibly even not to display at all. There are many ways
6350 a site designer may choose to design his site, and what HTTP header
6351 content, and other criteria, he may depend on. There is no way to have hard
6352 and fast rules for all sites. See the <A
6353 HREF="appendix.html#ACTIONSANAT"
6355 > for a brief example on troubleshooting
6378 >, can be defined by combining other actions.
6379 These can in turn be invoked just like the built-in actions.
6380 Currently, an alias name can contain any character except space, tab,
6398 > that you only use <SPAN
6418 Alias names are not case sensitive, and are not required to start with a
6425 > sign, since they are merely textually
6428 > Aliases can be used throughout the actions file, but they <SPAN
6433 defined in a special section at the top of the file!</I
6436 And there can only be one such section per actions file. Each actions file may
6437 have its own alias section, and the aliases defined in it are only visible
6438 within that file.</P
6440 > There are two main reasons to use aliases: One is to save typing for frequently
6441 used combinations of actions, the other one is a gain in flexibility: If you
6442 decide once how you want to handle shops by defining an alias called
6446 >, you can later change your policy on shops in
6453 > place, and your changes will take effect everywhere
6454 in the actions file where the <SPAN
6457 > alias is used. Calling aliases
6458 by their purpose also makes your actions files more readable.</P
6460 > Currently, there is one big drawback to using aliases, though:
6464 >'s built-in web-based action file
6465 editor honors aliases when reading the actions files, but it expands
6466 them before writing. So the effects of your aliases are of course preserved,
6467 but the aliases themselves are lost when you edit sections that use aliases
6469 This is likely to change in future versions of <SPAN
6474 > Now let's define some aliases...</P
6484 > # Useful custom aliases we can use later.
6486 # Note the (required!) section header line and that this section
6487 # must be at the top of the actions file!
6491 # These aliases just save typing later:
6492 # (Note that some already use other aliases!)
6494 +crunch-all-cookies = +<A
6495 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6496 >crunch-incoming-cookies</A
6498 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6499 >crunch-outgoing-cookies</A
6501 -crunch-all-cookies = -<A
6502 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6503 >crunch-incoming-cookies</A
6505 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6506 >crunch-outgoing-cookies</A
6508 block-as-image = +block +handle-as-image
6509 mercy-for-cookies = -crunch-all-cookies -<A
6510 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6511 >session-cookies-only</A
6513 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6514 >filter{content-cookies}</A
6517 # These aliases define combinations of actions
6518 # that are useful for certain types of sites:
6521 HREF="actions-file.html#BLOCK"
6524 HREF="actions-file.html#FILTER"
6526 > -crunch-all-cookies -<A
6527 HREF="actions-file.html#FAST-REDIRECTS"
6530 HREF="actions-file.html#HIDE-REFERER"
6533 HREF="actions-file.html#KILL-POPUPS"
6536 shop = -crunch-all-cookies -<A
6537 HREF="actions-file.html#FILTER-ALL-POPUPS"
6538 >filter{all-popups}</A
6540 HREF="actions-file.html#KILL-POPUPS"
6544 # Short names for other aliases, for really lazy people ;-)
6546 c0 = +crunch-all-cookies
6547 c1 = -crunch-all-cookies</PRE
6553 > ...and put them to use. These sections would appear in the lower part of an
6554 actions file and define exceptions to the default actions (as specified further
6568 > # These sites are either very complex or very keen on
6569 # user data and require minimal interference to work:
6572 .office.microsoft.com
6573 .windowsupdate.microsoft.com
6577 # Allow cookies (for setting and retrieving your customer data)
6581 .worldpay.com # for quietpc.com
6584 # These shops require pop-ups:
6586 {shop -kill-popups -filter{all-popups}}
6588 .overclockers.co.uk</PRE
6594 > Aliases like <SPAN
6600 > are often used for
6604 > sites that require some actions to be disabled
6605 in order to function properly.</P
6614 >8.7. Actions Files Tutorial</H2
6616 > The above chapters have shown <A
6617 HREF="actions-file.html"
6618 >which actions files
6619 there are and how they are organized</A
6620 >, how actions are <A
6621 HREF="actions-file.html#ACTIONS"
6624 HREF="actions-file.html#ACTIONS-APPLY"
6628 HREF="actions-file.html#AF-PATTERNS"
6632 HREF="actions-file.html#ALIASES"
6634 >. Now, let's look at an
6642 file and see how all these pieces come together:</P
6650 >8.7.1. default.action</H3
6652 >Every config file should start with a short comment stating its purpose:</P
6662 ># Sample default.action file <ijbswa-developers@lists.sourceforge.net></PRE
6668 >Then, since this is the <TT
6672 first section is a special section for internal use that you needn't
6673 change or worry about:</P
6683 >##########################################################################
6684 # Settings -- Don't change! For internal Privoxy use ONLY.
6685 ##########################################################################
6688 for-privoxy-version=3.0</PRE
6694 >After that comes the (optional) alias section. We'll use the example
6695 section from the above <A
6696 HREF="actions-file.html#ALIASES"
6697 >chapter on aliases</A
6699 that also explains why and how aliases are used:</P
6709 >##########################################################################
6711 ##########################################################################
6714 # These aliases just save typing later:
6715 # (Note that some already use other aliases!)
6717 +crunch-all-cookies = +<A
6718 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6719 >crunch-incoming-cookies</A
6721 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6722 >crunch-outgoing-cookies</A
6724 -crunch-all-cookies = -<A
6725 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6726 >crunch-incoming-cookies</A
6728 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6729 >crunch-outgoing-cookies</A
6731 block-as-image = +block +handle-as-image
6732 mercy-for-cookies = -crunch-all-cookies -<A
6733 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6734 >session-cookies-only</A
6736 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6737 >filter{content-cookies}</A
6740 # These aliases define combinations of actions
6741 # that are useful for certain types of sites:
6744 HREF="actions-file.html#BLOCK"
6747 HREF="actions-file.html#FILTER"
6749 > -crunch-all-cookies -<A
6750 HREF="actions-file.html#FAST-REDIRECTS"
6753 HREF="actions-file.html#HIDE-REFERER"
6756 HREF="actions-file.html#KILL-POPUPS"
6759 shop = -crunch-all-cookies -<A
6760 HREF="actions-file.html#FILTER-ALL-POPUPS"
6761 >filter{all-popups}</A
6763 HREF="actions-file.html#KILL-POPUPS"
6771 > Now come the regular sections, i.e. sets of actions, accompanied
6772 by URL patterns to which they apply. Remember <SPAN
6777 are disabled when matching starts</I
6779 >, so we have to explicitly
6780 enable the ones we want.</P
6782 > The first regular section is probably the most important. It has only
6791 HREF="actions-file.html#AF-PATTERNS"
6792 >matches all URLs</A
6794 set of actions used in this <SPAN
6802 be applied to all requests as a start</I
6804 >. It can be partly or
6805 wholly overridden by later matches further down this file, or in user.action,
6806 but it will still be largely responsible for your overall browsing
6809 > Again, at the start of matching, all actions are disabled, so there is
6810 no real need to disable any actions here, but we will do that nonetheless,
6811 to have a complete listing for your reference. (Remember: a <SPAN
6815 preceding the action name enables the action, a <SPAN
6819 Also note how this long line has been made more readable by splitting it into
6820 multiple lines with line continuation.</P
6830 >##########################################################################
6831 # "Defaults" section:
6832 ##########################################################################
6835 HREF="actions-file.html#ADD-HEADER"
6839 HREF="actions-file.html#BLOCK"
6843 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6844 >crunch-incoming-cookies</A
6847 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6848 >crunch-outgoing-cookies</A
6851 HREF="actions-file.html#DEANIMATE-GIFS"
6855 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
6856 >downgrade-http-version</A
6859 HREF="actions-file.html#FAST-REDIRECTS"
6863 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
6864 >filter{js-annoyances}</A
6867 HREF="actions-file.html#FILTER-JS-EVENTS"
6868 >filter{js-events}</A
6871 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
6872 >filter{html-annoyances}</A
6875 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6876 >filter{content-cookies}</A
6879 HREF="actions-file.html#FILTER-REFRESH-TAGS"
6880 >filter{refresh-tags}</A
6883 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
6884 >filter{unsolicited-popups}</A
6887 HREF="actions-file.html#FILTER-ALL-POPUPS"
6888 >filter{all-popups}</A
6891 HREF="actions-file.html#FILTER-IMG-REORDER"
6892 >filter{img-reorder}</A
6895 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
6896 >filter{banners-by-size}</A
6899 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
6900 >filter{banners-by-link}</A
6903 HREF="actions-file.html#FILTER-WEBBUGS"
6907 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
6908 >filter{tiny-textforms}</A
6911 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
6912 >filter{jumping-windows}</A
6915 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
6916 >filter{frameset-borders}</A
6919 HREF="actions-file.html#FILTER-DEMORONIZER"
6920 >filter{demoronizer}</A
6923 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
6924 >filter{shockwave-flash}</A
6927 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
6928 >filter{quicktime-kioskmode}</A
6931 HREF="actions-file.html#FILTER-FUN"
6935 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
6936 >filter{crude-parental}</A
6939 HREF="actions-file.html#FILTER-IE-EXPLOITS"
6940 >filter{ie-exploits}</A
6943 HREF="actions-file.html#HANDLE-AS-IMAGE"
6947 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
6948 >hide-forwarded-for-headers</A
6951 HREF="actions-file.html#HIDE-FROM-HEADER"
6952 >hide-from-header{block}</A
6955 HREF="actions-file.html#HIDE-REFERER"
6956 >hide-referrer{forge}</A
6959 HREF="actions-file.html#HIDE-USER-AGENT"
6963 HREF="actions-file.html#KILL-POPUPS"
6967 HREF="actions-file.html#LIMIT-CONNECT"
6971 HREF="actions-file.html#PREVENT-COMPRESSION"
6972 >prevent-compression</A
6975 HREF="actions-file.html#SEND-VANILLA-WAFER"
6976 >send-vanilla-wafer</A
6979 HREF="actions-file.html#SEND-WAFER"
6983 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6984 >session-cookies-only</A
6987 HREF="actions-file.html#SET-IMAGE-BLOCKER"
6988 >set-image-blocker{pattern}</A
6991 / # forward slash will match *all* potential URL patterns.</PRE
6997 > The default behavior is now set. Note that some actions, like not hiding
6998 the user agent, are part of a <SPAN
7000 >"general policy"</SPAN
7002 universally and won't get any exceptions defined later. Other choices,
7003 like not blocking (which is <SPAN
7010 default!) need exceptions, i.e. we need to specify explicitly what we
7011 want to block in later sections.</P
7013 > The first of our specialized sections is concerned with <SPAN
7017 sites, i.e. sites that require minimum interference, because they are either
7018 very complex or very keen on tracking you (and have mechanisms in place that
7019 make them unusable for people who avoid being tracked). We will simply use
7023 > alias instead of stating the list
7024 of actions explicitly:</P
7034 >##########################################################################
7035 # Exceptions for sites that'll break under the default action set:
7036 ##########################################################################
7038 # "Fragile" Use a minimum set of actions for these sites (see alias above):
7041 .office.microsoft.com # surprise, surprise!
7042 .windowsupdate.microsoft.com</PRE
7048 > Shopping sites are not as fragile, but they typically
7049 require cookies to log in, and pop-up windows for shopping
7050 carts or item details. Again, we'll use a pre-defined alias:</P
7064 .worldpay.com # for quietpc.com
7075 HREF="actions-file.html#FAST-REDIRECTS"
7079 action, which we enabled per default above, breaks some sites. So disable
7080 it for popular sites where we know it misbehaves:</P
7091 HREF="actions-file.html#FAST-REDIRECTS"
7097 .altavista.com/.*(like|url|link):http
7098 .altavista.com/trans.*urltext=http
7105 > It is important that <SPAN
7109 URLs belong to images, so that <SPAN
7116 be blocked, a substitute image can be sent, rather than an HTML page.
7117 Contacting the remote site to find out is not an option, since it
7118 would destroy the loading time advantage of banner blocking, and it
7119 would feed the advertisers (in terms of money <SPAN
7126 information). We can mark any URL as an image with the <TT
7129 HREF="actions-file.html#HANDLE-AS-IMAGE"
7133 and marking all URLs that end in a known image file extension is a
7144 >##########################################################################
7146 ##########################################################################
7148 # Define which file types will be treated as images, in case they get
7149 # blocked further down this file:
7152 HREF="actions-file.html#HANDLE-AS-IMAGE"
7155 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
7161 > And then there are known banner sources. They often use scripts to
7162 generate the banners, so it won't be visible from the URL that the
7163 request is for an image. Hence we block them <SPAN
7170 mark them as images in one go, with the help of our
7174 > alias defined above. (We could of
7175 course just as well use <TT
7178 HREF="actions-file.html#BLOCK"
7182 HREF="actions-file.html#HANDLE-AS-IMAGE"
7186 Remember that the type of the replacement image is chosen by the
7190 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7191 >set-image-blocker</A
7194 action. Since all URLs have matched the default section with its
7198 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7199 >set-image-blocker</A
7202 action before, it still applies and needn't be repeated:</P
7212 ># Known ad generators:
7217 .ad.*.doubleclick.net
7218 .a.yimg.com/(?:(?!/i/).)*$
7219 .a[0-9].yimg.com/(?:(?!/i/).)*$
7228 > One of the most important jobs of <SPAN
7232 is to block banners. A huge bunch of them are already <SPAN
7239 HREF="actions-file.html#FILTER"
7241 >{banners-by-size}</TT
7243 action, which we enabled above, and which deletes the references to banner
7244 images from the pages while they are loaded, so the browser doesn't request
7245 them anymore, and hence they don't need to be blocked here. But this naturally
7246 doesn't catch all banners, and some people choose not to use filters, so we
7247 need a comprehensive list of patterns for banner URLs here, and apply the
7251 HREF="actions-file.html#BLOCK"
7254 > action to them.</P
7256 > First comes a bunch of generic patterns, which do most of the work, by
7257 matching typical domain and path name components of banners. Then comes
7258 a list of individual patterns for specific sites, which is omitted here
7259 to keep the example short:</P
7269 >##########################################################################
7270 # Block these fine banners:
7271 ##########################################################################
7273 HREF="actions-file.html#BLOCK"
7283 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7284 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7286 # Site-specific patterns (abbreviated):
7294 > You wouldn't believe how many advertisers actually call their banner
7300 >.com, or call the directory
7301 in which the banners are stored simply <SPAN
7305 generic patterns are surprisingly effective.</P
7307 > But being very generic, they necessarily also catch URLs that we don't want
7308 to block. The pattern <TT
7320 >.nasty-corp.com"</SPAN
7330 >.sourcefroge.net"</SPAN
7340 >l.some-provider.net."</SPAN
7342 well-known exceptions to the <TT
7345 HREF="actions-file.html#BLOCK"
7351 > Note that these are exceptions to exceptions from the default! Consider the URL
7354 >"downloads.sourcefroge.net"</SPAN
7355 >: Initially, all actions are deactivated,
7356 so it wouldn't get blocked. Then comes the defaults section, which matches the
7357 URL, but just deactivates the <TT
7360 HREF="actions-file.html#BLOCK"
7364 action once again. Then it matches <TT
7367 >, an exception to the
7368 general non-blocking policy, and suddenly
7372 HREF="actions-file.html#BLOCK"
7375 > applies. And now, it'll match
7382 HREF="actions-file.html#BLOCK"
7386 applies, so (unless it matches <SPAN
7392 > further down) it ends up
7396 HREF="actions-file.html#BLOCK"
7399 > action applying.</P
7409 >##########################################################################
7410 # Save some innocent victims of the above generic block patterns:
7411 ##########################################################################
7416 HREF="actions-file.html#BLOCK"
7419 adv[io]*. # (for advogato.org and advice.*)
7420 adsl. # (has nothing to do with ads)
7421 ad[ud]*. # (adult.* and add.*)
7422 .edu # (universities don't host banners (yet!))
7423 .*loads. # (downloads, uploads etc)
7431 www.globalintersec.com/adv # (adv = advanced)
7432 www.ugu.com/sui/ugu/adv</PRE
7438 > Filtering source code can have nasty side effects,
7439 so make an exception for our friends at sourceforge.net,
7440 and all paths with <SPAN
7443 > in them. Note that
7447 HREF="actions-file.html#FILTER"
7457 > filters in one fell swoop!</P
7467 ># Don't filter code!
7470 HREF="actions-file.html#FILTER"
7474 .sourceforge.net</PRE
7484 comprehensive, but we hope this example made clear how it works.</P
7493 >8.7.2. user.action</H3
7495 > So far we are painting with a broad brush by setting general policies,
7496 which would be a reasonable starting point for many people. Now,
7497 you might want to be more specific and have customized rules that
7498 are more suitable to your personal habits and preferences. These would
7499 be for narrowly defined situations like your ISP or your bank, and should
7503 >, which is parsed after all other
7504 actions files and hence has the last word, over-riding any previously
7505 defined actions. <TT
7515 > place for your personal settings, since
7519 > is actively maintained by the
7523 > developers and you'll probably want
7524 to install updated versions from time to time.</P
7526 > So let's look at a few examples of things that one might typically do in
7540 ># My user.action file. <fred@foobar.com></PRE
7547 HREF="actions-file.html#ALIASES"
7549 > are local to the actions
7550 file that they are defined in, you can't use the ones from
7554 >, unless you repeat them here:</P
7564 ># Aliases are local to the file they are defined in.
7565 # (Re-)define aliases for this file:
7569 # These aliases just save typing later, and the alias names should
7570 # be self explanatory.
7572 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7573 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7574 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7575 allow-popups = -filter{all-popups} -kill-popups
7576 +block-as-image = +block +handle-as-image
7577 -block-as-image = -block
7579 # These aliases define combinations of actions that are useful for
7580 # certain types of sites:
7582 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
7583 shop = -crunch-all-cookies allow-popups
7585 # Allow ads for selected useful free sites:
7587 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}</PRE
7595 > Say you have accounts on some sites that you visit regularly, and
7596 you don't want to have to log in manually each time. So you'd like
7597 to allow persistent cookies for these sites. The
7600 >allow-all-cookies</TT
7601 > alias defined above does exactly
7602 that, i.e. it disables crunching of cookies in any direction, and the
7603 processing of cookies to make them only temporary.</P
7613 >{ allow-all-cookies }
7625 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7636 HREF="actions-file.html#FILTER"
7639 .your-home-banking-site.com</PRE
7645 > Some file types you may not want to filter for various reasons:</P
7655 ># Technical documentation is likely to contain strings that might
7656 # erroneously get altered by the JavaScript-oriented filters:
7661 # And this stupid host sends streaming video with a wrong MIME type,
7662 # so that Privoxy thinks it is getting HTML and starts filtering:
7664 stupid-server.example.com/</PRE
7670 > Example of a simple <A
7671 HREF="actions-file.html#BLOCK"
7673 > action. Say you've
7674 seen an ad on your favourite page on example.com that you want to get rid of.
7675 You have right-clicked the image, selected <SPAN
7677 >"copy image location"</SPAN
7679 and pasted the URL below while removing the leading http://, into a
7683 > section. Note that <TT
7687 > need not be specified, since all URLs ending in
7691 > will be tagged as images by the general rules as set
7692 in default.action anyway:</P
7703 HREF="actions-file.html#BLOCK"
7706 www.example.com/nasty-ads/sponsor.gif
7707 another.popular.site.net/more/junk/here/</PRE
7713 > The URLs of dynamically generated banners, especially from large banner
7714 farms, often don't use the well-known image file name extensions, which
7715 makes it impossible for <SPAN
7719 the file type just by looking at the URL.
7722 >+block-as-image</TT
7723 > alias defined above for
7725 Note that objects which match this rule but then turn out NOT to be an
7726 image are typically rendered as a <SPAN
7728 >"broken image"</SPAN
7730 browser. Use cautiously.</P
7740 >{ +block-as-image }
7749 > Now you noticed that the default configuration breaks Forbes Magazine,
7750 but you were too lazy to find out which action is the culprit, and you
7751 were again too lazy to give <A
7755 you just used the <TT
7758 > alias on the site, and
7765 > -- it worked. The <TT
7769 aliases disables those actions that are most likely to break a site. Also,
7770 good for testing purposes to see if it is <SPAN
7774 that is causing the problem or not.</P
7791 > You like the <SPAN
7794 > text replacements in <TT
7798 but it is disabled in the distributed actions file. (My colleagues on the team just
7799 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
7800 update-safe config, once and for all:</P
7811 HREF="actions-file.html#FILTER-FUN"
7814 / # For ALL sites!</PRE
7820 > Note that the above is not really a good idea: There are exceptions
7821 to the filters in <TT
7825 really shouldn't be filtered, like code on CVS->Web interfaces. Since
7829 > has the last word, these exceptions
7830 won't be valid for the <SPAN
7833 > filtering specified here.</P
7835 > You might also worry about how your favourite free websites are
7836 funded, and find that they rely on displaying banner advertisements
7837 to survive. So you might want to specifically allow banners for those
7838 sites that you feel provide value to you:</P
7860 > has been aliased to
7864 HREF="actions-file.html#BLOCK"
7871 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
7872 >filter{banners-by-size}</A
7878 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
7879 >filter{banners-by-link}</A
7886 > is generally the best place to define
7887 exceptions and additions to the default policies of
7891 >. Some actions are safe to have their
7892 default policies set here though. So let's set a default policy to have a
7896 > image as opposed to the checkerboard pattern for
7906 > of course matches all URL
7907 paths and patterns:</P
7918 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7919 >set-image-blocker{blank}</A
7934 SUMMARY="Footer navigation table"
7963 HREF="filter-file.html"
7973 >The Main Configuration File</TD