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="filter-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-server-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="filter-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="filter-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="filter-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
2858 > The name of a filter, as defined in the <A
2859 HREF="filter-file.html"
2862 Filters can be defined in one or more files as defined by the
2866 HREF="config.html#FILTERFILE"
2877 > is the collection of filters
2878 supplied by the developers. Locally defined filters should go
2879 in their own file, such as <TT
2885 > When used in its negative form,
2886 and without parameters, filtering is completely disabled.
2893 > For your convenience, there are a number of pre-defined filters available
2894 in the distribution filter file that you can use. See the examples below for
2898 > Filtering requires buffering the page content, which may appear to
2899 slow down page rendering since nothing is displayed until all content has
2900 passed the filters. (It does not really take longer, but seems that way
2901 since the page is not incrementally displayed.) This effect will be more
2902 noticeable on slower connections.
2905 > This is very powerful feature, and <SPAN
2907 >"rolling your own"</SPAN
2909 filters requires a knowledge of regular expressions and HTML.
2912 > The amount of data that can be filtered is limited to the
2916 HREF="config.html#BUFFER-LIMIT"
2920 option in the main <A
2924 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2925 data, and all pending data, is passed through unfiltered.
2928 > Inadequate MIME types, such as zipped files, are not filtered at all.
2929 (Again, only text-based types except plain text). Encrypted SSL data
2930 (from HTTPS servers) cannot be filtered either, since this would violate
2931 the integrity of the secure transaction. In some situations it might
2932 be necessary to protect certain text, like source code, from filtering
2933 by defining appropriate <TT
2939 > At this time, <SPAN
2942 > cannot (yet!) uncompress compressed
2943 documents. If you want filtering to work on all documents, even those that
2944 would normally be sent compressed, use the
2948 HREF="actions-file.html#PREVENT-COMPRESSION"
2949 >prevent-compression</A
2952 action in conjunction with <TT
2958 > Filtering can achieve some of the same effects as the
2962 HREF="actions-file.html#BLOCK"
2966 action, i.e. it can be used to block ads and banners. But the mechanism
2967 works quite differently. One effective use, is to block ad banners
2968 based on their size (see below), since many of these seem to be somewhat
2975 > with suggestions for new or
2976 improved filters is particularly welcome!
2979 > The below list has only the names and a one-line description of each
2980 predefined filter. There are <A
2981 HREF="filter-file.html#PREDEFINED-FILTERS"
2983 verbose explanations</A
2984 > of what these filters do in the <A
2985 HREF="filter-file.html"
2986 >filter file chapter</A
2991 >Example usage (with filters from the distribution <TT
2996 HREF="filter-file.html#PREDEFINED-FILTERS"
2997 >the Predefined Filters section</A
2999 more explanation on each:</DT
3003 NAME="FILTER-JS-ANNOYANCES"
3014 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
3022 NAME="FILTER-JS-EVENTS"
3033 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
3041 NAME="FILTER-HTML-ANNOYANCES"
3052 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
3060 NAME="FILTER-CONTENT-COOKIES"
3071 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
3079 NAME="FILTER-REFRESH-TAGS"
3090 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
3098 NAME="FILTER-UNSOLICITED-POPUPS"
3109 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
3117 NAME="FILTER-ALL-POPUPS"
3128 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
3136 NAME="FILTER-IMG-REORDER"
3147 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
3155 NAME="FILTER-BANNERS-BY-SIZE"
3166 >+filter{banners-by-size} # Kill banners by size</PRE
3174 NAME="FILTER-BANNERS-BY-LINK"
3185 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
3193 NAME="FILTER-WEBBUGS"
3204 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
3212 NAME="FILTER-TINY-TEXTFORMS"
3223 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
3231 NAME="FILTER-JUMPING-WINDOWS"
3242 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
3250 NAME="FILTER-FRAMESET-BORDERS"
3261 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
3269 NAME="FILTER-DEMORONIZER"
3280 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
3288 NAME="FILTER-SHOCKWAVE-FLASH"
3299 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
3307 NAME="FILTER-QUICKTIME-KIOSKMODE"
3318 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
3337 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
3345 NAME="FILTER-CRUDE-PARENTAL"
3356 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
3364 NAME="FILTER-IE-EXPLOITS"
3375 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
3390 NAME="FORCE-TEXT-MODE"
3392 >8.5.13. force-text-mode</H4
3396 CLASS="VARIABLELIST"
3405 > to treat a document as if it was in some kind of <SPAN
3417 > Declares a document as text, even if the <SPAN
3419 >"Content-Type:"</SPAN
3420 > isn't detected as such.
3443 HREF="actions-file.html#FILTER"
3450 > tries to only filter files that are
3451 in some kind of text format. The same restrictions apply to
3455 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3456 >content-type-overwrite</A
3461 >force-text-mode</TT
3462 > declares a document as text,
3463 without looking at the <SPAN
3465 >"Content-Type:"</SPAN
3487 > Think twice before activating this action. Filtering binary data
3488 with regular expressions can cause file damage.
3523 NAME="HANDLE-AS-EMPTY-DOCUMENT"
3525 >8.5.14. handle-as-empty-document</H4
3529 CLASS="VARIABLELIST"
3535 >Mark URLs that should be replaced by empty documents <SPAN
3539 >if they get blocked</I
3547 > This action alone doesn't do anything noticeable. It just marks URLs.
3551 HREF="actions-file.html#BLOCK"
3561 the presence or absence of this mark decides whether an HTML <SPAN
3565 page, or an empty document will be sent to the client as a substitute for the blocked content.
3572 > document isn't literally empty, but actually contains a single space.
3592 > Some browsers complain about syntax errors if JavaScript documents
3593 are blocked with <SPAN
3597 default HTML page; this option can be used to silence them.
3600 > The content type for the empty document can be specified with
3604 HREF="actions-file.html#CONTENT-TYPE-OVERWRITE"
3605 >content-type-overwrite{}</A
3608 but usually this isn't necessary.
3623 ># Block all documents on example.org that end with ".js",
3624 # but send an empty document instead of the usual HTML message.
3625 {+block +handle-as-empty-document}
3642 NAME="HANDLE-AS-IMAGE"
3644 >8.5.15. handle-as-image</H4
3648 CLASS="VARIABLELIST"
3654 >Mark URLs as belonging to images (so they'll be replaced by imagee <SPAN
3658 >if they get blocked</I
3666 > This action alone doesn't do anything noticeable. It just marks URLs as images.
3670 HREF="actions-file.html#BLOCK"
3680 the presence or absence of this mark decides whether an HTML <SPAN
3684 page, or a replacement image (as determined by the <TT
3687 HREF="actions-file.html#SET-IMAGE-BLOCKER"
3688 >set-image-blocker</A
3690 > action) will be sent to the
3691 client as a substitute for the blocked content.
3711 > The below generic example section is actually part of <TT
3715 It marks all URLs with well-known image file name extensions as images and should
3719 > Users will probably only want to use the handle-as-image action in conjunction with
3723 HREF="actions-file.html#BLOCK"
3726 >, to block sources of banners, whose URLs don't
3727 reflect the file type, like in the second example section.
3730 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
3731 frames require an HTML page to be sent, or they won't display properly.
3734 >handle-as-image</TT
3735 > in this situation will not replace the
3736 ad frame with an image, but lead to error messages.
3740 >Example usage (sections):</DT
3751 ># Generic image extensions:
3754 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
3756 # These don't look like images, but they're banners and should be
3757 # blocked as images:
3759 {+block +handle-as-image}
3760 some.nasty-banner-server.com/junk.cgi?output=trash
3762 # Banner source! Who cares if they also have non-image content?
3763 ad.doubleclick.net </PRE
3778 NAME="HIDE-ACCEPT-LANGUAGE"
3780 >8.5.16. hide-accept-language</H4
3784 CLASS="VARIABLELIST"
3790 >Pretend to use different language settings.</P
3796 > Deletes or replaces the <SPAN
3798 >"Accept-Language:"</SPAN
3799 > HTTP header in client requests.
3815 >, or any user defined value.
3822 > Faking the browser's language settings can be useful to make a
3823 foreign User-Agent set with
3827 HREF="actions-file.html#HIDE-USER-AGENT"
3834 > However some sites with content in different languages check the
3837 >"Accept-Language:"</SPAN
3838 > to decide which one to take by default.
3839 Sometimes it isn't possible to later switch to another language without
3842 >"Accept-Language:"</SPAN
3846 > Therefore it's a good idea to either only change the
3849 >"Accept-Language:"</SPAN
3850 > header to languages you understand,
3851 or to languages that aren't wide spread.
3854 > Before setting the <SPAN
3856 >"Accept-Language:"</SPAN
3858 to a rare language, you should consider that it helps to
3859 make your requests unique and thus easier to trace.
3860 If you don't plan to change this header frequently,
3861 you should stick to a common language.
3865 >Example usage (section):</DT
3876 ># Pretend to use Canadian language settings.
3877 {+hide-accept-language{en-ca} \
3878 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
3895 NAME="HIDE-CONTENT-DISPOSITION"
3897 >8.5.17. hide-content-disposition</H4
3901 CLASS="VARIABLELIST"
3907 >Prevent download menus for content you prefer to view inside the browser.</P
3913 > Deletes or replaces the <SPAN
3915 >"Content-Disposition:"</SPAN
3916 > HTTP header set by some servers.
3932 >, or any user defined value.
3939 > Some servers set the <SPAN
3941 >"Content-Disposition:"</SPAN
3943 documents they assume you want to save locally before viewing them.
3946 >"Content-Disposition:"</SPAN
3947 > header contains the file name
3948 the browser is supposed to use by default.
3951 > In most browsers that understand this header, it makes it impossible to
3958 > the document, without downloading it first,
3959 even if it's just a simple text file or an image.
3962 > Removing the <SPAN
3964 >"Content-Disposition:"</SPAN
3966 to prevent this annoyance, but some browsers additionally check the
3969 >"Content-Type:"</SPAN
3970 > header, before they decide if they can
3971 display a document without saving it first. In these cases, you have
3972 to change this header as well, before the browser stops displaying
3976 > It is also possible to change the server's file name suggestion
3977 to another one, but in most cases it isn't worth the time to set
3993 ># Disarm the download link in Sourceforge's patch tracker
3995 +content-type-overwrite {text/plain}\
3996 +hide-content-disposition {block} }
3997 .sourceforge.net/tracker/download.php</PRE
4012 NAME="HIDE-IF-MODIFIED-SINCE"
4014 >8.5.18. hide-if-modified-since</H4
4018 CLASS="VARIABLELIST"
4024 >Prevent yet another way to track the user's steps between sessions.</P
4032 >"If-Modified-Since:"</SPAN
4033 > HTTP client header or modifies its value.
4049 >, or a user defined value that specifies a range of hours.
4056 > Removing this header is useful for filter testing, where you want to force a real
4057 reload instead of getting status code <SPAN
4060 >, which would cause the
4061 browser to use a cached copy of the page.
4064 > Instead of removing the header, <TT
4066 >hide-if-modified-since</TT
4068 also add or substract a random amount of time to/from the headers value.
4069 You specify a range of hours were the random factor should be chosen from and
4073 > does the rest. A negative value means
4074 subtracting, a positive value adding.
4077 > Randomizing the value of the <SPAN
4079 >"If-Modified-Since:"</SPAN
4081 sure it isn't used as a cookie replacement, but you will run into
4082 caching problems if the random range is too high.
4085 > It is a good idea to only use a small negative value and let
4089 HREF="actions-file.html#OVERWRITE-LAST-MODIFIED"
4090 >overwrite-last-modified</A
4093 handle the greater changes.
4096 > It is also recommended to use this action together with
4100 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
4101 >crunch-if-none-match</A
4107 >Example usage (section):</DT
4118 ># Let the browser revalidate without being tracked across sessions
4119 {+hide-if-modified-since {-1}\
4120 +overwrite-last-modified {randomize}\
4121 +crunch-if-none-match}
4137 NAME="HIDE-FORWARDED-FOR-HEADERS"
4139 >8.5.19. hide-forwarded-for-headers</H4
4143 CLASS="VARIABLELIST"
4149 >Improve privacy by hiding the true source of the request</P
4155 > Deletes any existing <SPAN
4157 >"X-Forwarded-for:"</SPAN
4158 > HTTP header from client requests,
4159 and prevents adding a new one.
4179 > It is fairly safe to leave this on.
4182 > This action is scheduled for improvement: It should be able to generate forged
4185 >"X-Forwarded-for:"</SPAN
4186 > headers using random IP addresses from a specified network,
4187 to make successive requests from the same client look like requests from a pool of different
4188 users sharing the same proxy.
4203 >+hide-forwarded-for-headers</PRE
4218 NAME="HIDE-FROM-HEADER"
4220 >8.5.20. hide-from-header</H4
4224 CLASS="VARIABLELIST"
4230 >Keep your (old and ill) browser from telling web servers your email address</P
4236 > Deletes any existing <SPAN
4239 > HTTP header, or replaces it with the
4256 >, or any user defined value.
4266 > will completely remove the header
4267 (not to be confused with the <TT
4270 HREF="actions-file.html#BLOCK"
4277 > Alternately, you can specify any value you prefer to be sent to the web
4278 server. If you do, it is a matter of fairness not to use any address that
4279 is actually used by a real person.
4282 > This action is rarely needed, as modern web browsers don't send
4301 >+hide-from-header{block}</PRE
4314 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
4329 NAME="HIDE-REFERRER"
4331 >8.5.21. hide-referrer</H4
4338 CLASS="VARIABLELIST"
4344 >Conceal which link you followed to get to a particular site</P
4353 > (sic) HTTP header from the client request,
4354 or replaces it with a forged one.
4373 >"conditional-block"</SPAN
4374 > to delete the header completely if the host has changed.</P
4381 > to delete the header unconditionally.</P
4388 > to pretend to be coming from the homepage of the server we are talking to.</P
4392 >Any other string to set a user defined referrer.</P
4402 >conditional-block</TT
4403 > is the only parameter,
4404 that isn't easily detected in the server's log file. If it blocks the
4405 referrer, the request will look like the visitor used a bookmark or
4406 typed in the address directly.
4409 > Leaving the referrer unmodified for requests on the same host
4410 allows the server owner to see the visitor's <SPAN
4414 but in most cases she could also get that information by comparing
4415 other parts of the log file: for example the User-Agent if it isn't
4416 a very common one, or the user's IP address if it doesn't change between
4420 > Always blocking the referrer, or using a custom one, can lead to
4421 failures on servers that check the referrer before they answer any
4422 requests, in an attempt to prevent their valuable content from being
4423 embedded or linked to elsewhere.
4428 >conditional-block</TT
4433 will work with referrer checks, as long as content and valid referring page
4434 are on the same host. Most of the time that's the case.
4441 > is an alternate spelling of
4445 > and the two can be can be freely
4446 substituted with each other. (<SPAN
4450 correct English spelling, however the HTTP specification has a bug - it
4451 requires it to be spelled as <SPAN
4469 >+hide-referrer{forge}</PRE
4482 >+hide-referrer{http://www.yahoo.com/}</PRE
4497 NAME="HIDE-USER-AGENT"
4499 >8.5.22. hide-user-agent</H4
4503 CLASS="VARIABLELIST"
4509 >Conceal your type of browser and client operating system</P
4515 > Replaces the value of the <SPAN
4517 >"User-Agent:"</SPAN
4519 in client requests with the specified value.
4532 > Any user-defined string.
4557 > This can lead to problems on web sites that depend on looking at this header in
4558 order to customize their content for different browsers (which, by the
4565 > the right thing to do: good web sites
4566 work browser-independently).
4574 > Using this action in multi-user setups or wherever different types of
4575 browsers will access the same <SPAN
4585 >. In single-user, single-browser
4586 setups, you might use it to delete your OS version information from
4587 the headers, because it is an invitation to exploit known bugs for your
4588 OS. It is also occasionally useful to forge this in order to access
4589 sites that won't let you in otherwise (though there may be a good
4590 reason in some cases). Example of this: some MSN sites will not
4594 > enter, yet forging to a
4598 > user-agent works just fine.
4599 (Must be just a silly MS goof, I'm sure :-).
4602 > This action is scheduled for improvement.
4617 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
4632 NAME="INSPECT-JPEGS"
4634 >8.5.23. inspect-jpegs</H4
4638 CLASS="VARIABLELIST"
4644 >To protect against the MS buffer over-run in JPEG processing</P
4650 > To protect against a known exploit
4670 > See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
4671 common image types found across the Internet. The exploit as described can
4672 allow execution of code on the target system, giving an attacker access
4673 to the system in question by merely planting an altered JPEG image, which
4674 would have no obvious indications of what lurks inside. This action
4675 prevents unwanted intrusion.
4690 >+inspect-jpegs</PRE
4706 >8.5.24. kill-popups<A
4713 CLASS="VARIABLELIST"
4719 >Eliminate those annoying pop-up windows (deprecated)</P
4725 > While loading the document, replace JavaScript code that opens
4726 pop-up windows with (syntactically neutral) dummy code on the fly.
4746 > This action is basically a built-in, hardwired special-purpose filter
4747 action, but there are important differences: For <TT
4751 the document need not be buffered, so it can be incrementally rendered while
4752 downloading. But <TT
4755 > doesn't catch as many pop-ups as
4759 HREF="actions-file.html#FILTER-ALL-POPUPS"
4768 does and is not as smart as <TT
4771 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
4775 >unsolicited-popups</I
4783 > Think of it as a fast and efficient replacement for a filter that you
4784 can use if you don't want any filtering at all. Note that it doesn't make
4785 sense to combine it with any <TT
4788 HREF="actions-file.html#FILTER"
4792 since as soon as one <TT
4795 HREF="actions-file.html#FILTER"
4799 the whole document needs to be buffered anyway, which destroys the advantage of
4803 > action over its filter equivalent.
4806 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
4807 pop-ups to display forms, shopping carts etc, and the <TT
4810 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
4814 >unsolicited-popups</I
4819 > does a fairly good job of catching only the unwanted ones.
4822 > If the only kind of pop-ups that you want to kill are exit consoles (those
4829 > windows that appear when you close an other
4830 one), you might want to use
4834 HREF="actions-file.html#FILTER"
4872 NAME="LIMIT-CONNECT"
4874 >8.5.25. limit-connect</H4
4878 CLASS="VARIABLELIST"
4884 >Prevent abuse of <SPAN
4887 > as a TCP proxy relay or disable SSL for untrusted sites</P
4893 > Specifies to which ports HTTP CONNECT requests are allowable.
4906 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
4907 defaulting to 0 and the maximum to 65K).
4914 > By default, i.e. if no <TT
4921 > only allows HTTP CONNECT
4922 requests to port 443 (the standard, secure HTTPS port). Use
4926 > if more fine-grained control is desired
4927 for some or all destinations.
4930 > The CONNECT methods exists in HTTP to allow access to secure websites
4934 > URLs) through proxies. It works very simply:
4935 the proxy connects to the server on the specified port, and then
4936 short-circuits its connections to the client and to the remote server.
4937 This can be a big security hole, since CONNECT-enabled proxies can be
4938 abused as TCP relays very easily.
4944 > relays HTTPS traffic without seeing
4945 the decoded content. Websites can leverage this limitation to circumvent Privoxy's
4946 filters. By specifying an invalid port range you can disable HTTPS entirely.
4947 If you plan to disable SSL by default, consider enabling
4951 HREF="actions-file.html#TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
4952 >treat-forbidden-connects-like-blocks</A
4955 as well, to be able to quickly create exceptions.
4959 >Example usages:</DT
4970 >+limit-connect{443} # This is the default and need not be specified.
4971 +limit-connect{80,443} # Ports 80 and 443 are OK.
4972 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
4973 +limit-connect{-} # All ports are OK
4974 +limit-connect{,} # No HTTPS traffic is allowed</PRE
4989 NAME="PREVENT-COMPRESSION"
4991 >8.5.26. prevent-compression</H4
4995 CLASS="VARIABLELIST"
5001 > Ensure that servers send the content uncompressed, so it can be
5005 HREF="actions-file.html#FILTER"
5015 > Removes the Accept-Encoding header which can be used to ask for compressed transfer.
5035 > More and more websites send their content compressed by default, which
5036 is generally a good idea and saves bandwidth. But for the <TT
5039 HREF="actions-file.html#FILTER"
5045 HREF="actions-file.html#DEANIMATE-GIFS"
5052 HREF="actions-file.html#KILL-POPUPS"
5059 > needs access to the uncompressed data.
5060 Unfortunately, <SPAN
5063 > can't yet(!) uncompress, filter, and
5064 re-compress the content on the fly. So if you want to ensure that all websites, including
5065 those that normally compress, can be filtered, you need to use this action.
5068 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
5069 actions, you will typically want to use <TT
5071 >prevent-compression</TT
5076 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
5077 documents correctly (they send an empty document body). If you use <TT
5079 >prevent-compression</TT
5081 per default, you'll have to add exceptions for those sites. See the example for how to do that.
5085 >Example usage (sections):</DT
5098 {+prevent-compression}
5101 # Make exceptions for ill sites:
5103 {-prevent-compression}
5105 www.pclinuxonline.com</PRE
5120 NAME="OVERWRITE-LAST-MODIFIED"
5122 >8.5.27. overwrite-last-modified</H4
5126 CLASS="VARIABLELIST"
5132 >Prevent yet another way to track the user's steps between sessions.</P
5140 >"Last-Modified:"</SPAN
5141 > HTTP server header or modifies its value.
5154 > One of the keywords: <SPAN
5159 >"reset-to-request-time"</SPAN
5171 > Removing the <SPAN
5173 >"Last-Modified:"</SPAN
5174 > header is useful for filter
5175 testing, where you want to force a real reload instead of getting status
5179 >, which would cause the browser to reuse the old
5180 version of the page.
5186 > option overwrites the value of the
5189 >"Last-Modified:"</SPAN
5190 > header with a randomly chosen time
5191 between the original value and the current time. In theory the server
5192 could send each document with a different <SPAN
5194 >"Last-Modified:"</SPAN
5196 header to track visits without using cookies. <SPAN
5200 makes it impossible and the browser can still revalidate cached documents.
5205 >"reset-to-request-time"</SPAN
5206 > overwrites the value of the
5209 >"Last-Modified:"</SPAN
5210 > header with the current time. You could use
5211 this option together with
5215 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5216 >hided-if-modified-since</A
5219 to further customize your random range.
5222 > The preferred parameter here is <SPAN
5226 to use, as long as the time settings are more or less correct.
5227 If the server sets the <SPAN
5229 >"Last-Modified:"</SPAN
5230 > header to the time
5231 of the request, the random range becomes zero and the value stays the same.
5232 Therefore you should later randomize it a second time with
5236 HREF="actions-file.html#HIDE-IF-MODIFIED-SINCE"
5237 >hided-if-modified-since</A
5243 > It is also recommended to use this action together with
5247 HREF="actions-file.html#CRUNCH-IF-NONE-MATCH"
5248 >crunch-if-none-match</A
5265 ># Let the browser revalidate without being tracked across sessions
5266 {+hide-if-modified-since {-1}\
5267 +overwrite-last-modified {randomize}\
5268 +crunch-if-none-match}
5286 >8.5.28. redirect</H4
5290 CLASS="VARIABLELIST"
5296 > Redirect requests to other sites.
5303 > Convinces the browser that the requested document has been moved
5304 to another location and the browser should get it from there.
5324 > This action is useful to replace whole documents with your own
5325 ones. For that to work, they have to be available on another server.
5328 > You can do the same by combining the actions
5332 HREF="actions-file.html#BLOCK"
5339 HREF="actions-file.html#HANDLE-AS-IMAGE"
5346 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5347 >set-image-blocker{URL}</A
5350 It doesn't sound right for non-image documents, and that's why this action
5354 > This action will be ignored if you use it together with
5358 HREF="actions-file.html#BLOCK"
5376 ># Replace example.com's style sheet with another one
5377 {+redirect{http://localhost/css-replacements/example.com.css}}
5378 example.com/stylesheet.css</PRE
5393 NAME="SEND-VANILLA-WAFER"
5395 >8.5.29. send-vanilla-wafer</H4
5399 CLASS="VARIABLELIST"
5405 > Feed log analysis scripts with useless data.
5412 > Sends a cookie with each request stating that you do not accept any copyright
5413 on cookies sent to you, and asking the site operator not to track you.
5433 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
5436 > This action is rarely used and not enabled in the default configuration.
5451 >+send-vanilla-wafer</PRE
5468 >8.5.30. send-wafer</H4
5472 CLASS="VARIABLELIST"
5478 > Send custom cookies or feed log analysis scripts with even more useless data.
5485 > Sends a custom, user-defined cookie with each request.
5498 > A string of the form <SPAN
5518 > Being multi-valued, multiple instances of this action can apply to the same request,
5519 resulting in multiple cookies being sent.
5522 > This action is rarely used and not enabled in the default configuration.
5526 >Example usage (section):</DT
5537 >{+send-wafer{UsingPrivoxy=true}}
5538 my-internal-testing-server.void</PRE
5553 NAME="SESSION-COOKIES-ONLY"
5555 >8.5.31. session-cookies-only</H4
5559 CLASS="VARIABLELIST"
5565 > Allow only temporary <SPAN
5568 > cookies (for the current
5569 browser session <SPAN
5587 >"Set-Cookie:"</SPAN
5589 server headers. Most browsers will not store such cookies permanently and
5590 forget them in between sessions.
5610 > This is less strict than <TT
5613 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5614 >crunch-incoming-cookies</A
5620 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5621 >crunch-outgoing-cookies</A
5623 > and allows you to browse
5624 websites that insist or rely on setting cookies, without compromising your privacy too badly.
5627 > Most browsers will not permanently store cookies that have been processed by
5630 >session-cookies-only</TT
5631 > and will forget about them between sessions.
5632 This makes profiling cookies useless, but won't break sites which require cookies so
5633 that you can log in for transactions. This is generally turned on for all
5634 sites, and is the recommended setting.
5645 >session-cookies-only</TT
5650 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
5651 >crunch-incoming-cookies</A
5657 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
5658 >crunch-outgoing-cookies</A
5660 >. If you do, cookies
5661 will be plainly killed.
5664 > Note that it is up to the browser how it handles such cookies without an <SPAN
5668 field. If you use an exotic browser, you might want to try it out to be sure.
5671 > This setting also has no effect on cookies that may have been stored
5672 previously by the browser before starting <SPAN
5676 These would have to be removed manually.
5684 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
5685 >content-cookies filter</A
5687 to block some types of cookies. Content cookies are not effected by
5690 >session-cookies-only</TT
5706 >+session-cookies-only</PRE
5721 NAME="SET-IMAGE-BLOCKER"
5723 >8.5.32. set-image-blocker</H4
5727 CLASS="VARIABLELIST"
5733 >Choose the replacement for blocked images</P
5739 > This action alone doesn't do anything noticeable. If <SPAN
5749 HREF="actions-file.html#BLOCK"
5761 HREF="actions-file.html#HANDLE-AS-IMAGE"
5771 apply, i.e. if the request is to be blocked as an image,
5778 > the parameter of this action decides what will be
5779 sent as a replacement.
5799 > to send a built-in checkerboard pattern image. The image is visually
5800 decent, scales very well, and makes it obvious where banners were busted.
5808 > to send a built-in transparent image. This makes banners disappear
5809 completely, but makes it hard to detect where <SPAN
5813 images on a given page and complicates troubleshooting if <SPAN
5817 has blocked innocent images, like navigation icons.
5831 send a redirect to <TT
5837 to any image anywhere, even in your local filesystem via <SPAN
5841 (But note that not all browsers support redirecting to a local file system).
5844 > A good application of redirects is to use special <SPAN
5848 URLs, which send the built-in images, as <TT
5854 This has the same visual effect as specifying <SPAN
5861 the first place, but enables your browser to cache the replacement image, instead of requesting
5862 it over and over again.
5871 > The URLs for the built-in images are <SPAN
5873 >"http://config.privoxy.org/send-banner?type=<TT
5894 > There is a third (advanced) type, called <SPAN
5906 >set-image-blocker</TT
5907 >, but meant for use from <A
5908 HREF="filter-file.html"
5911 Auto will select the type of image that would have applied to the referring page, had it been an image.
5929 >+set-image-blocker{pattern}</PRE
5936 > Redirect to the BSD devil:
5947 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
5954 > Redirect to the built-in pattern for better caching:
5965 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
5980 NAME="TREAT-FORBIDDEN-CONNECTS-LIKE-BLOCKS"
5982 >8.5.33. treat-forbidden-connects-like-blocks</H4
5986 CLASS="VARIABLELIST"
5992 >Block forbidden connects with an easy to find error message.</P
5998 > If this action is enabled, <SPAN
6002 makes a difference between forbidden connects and ordinary blocks.
6026 HREF="actions-file.html#LIMIT-CONNECT"
6032 with a short error message inside the headers. If the browser doesn't display
6033 headers (most don't), you just see an empty page.
6036 > With this action enabled, <SPAN
6040 the message that is used for ordinary blocks instead. If you decide
6041 to make an exception for the page in question, you can do so by
6051 > requests the clients tell
6055 > which host they are interested
6056 in, but not which document they plan to get later. As a result, the
6059 >"Go there anyway"</SPAN
6060 > link becomes rather useless:
6061 it lets the client request the home page of the forbidden host
6062 through unencrypted HTTP, still using the port of the last request.
6065 > If you previously configured <SPAN
6069 request through a SSL tunnel, everything will work. Most likely you haven't
6070 and the server will responds with an error message because it is expecting
6086 >+treat-forbidden-connects-like-blocks</PRE
6103 >8.5.34. Summary</H3
6105 > Note that many of these actions have the potential to cause a page to
6106 misbehave, possibly even not to display at all. There are many ways
6107 a site designer may choose to design his site, and what HTTP header
6108 content, and other criteria, he may depend on. There is no way to have hard
6109 and fast rules for all sites. See the <A
6110 HREF="appendix.html#ACTIONSANAT"
6112 > for a brief example on troubleshooting
6135 >, can be defined by combining other actions.
6136 These can in turn be invoked just like the built-in actions.
6137 Currently, an alias name can contain any character except space, tab,
6155 > that you only use <SPAN
6175 Alias names are not case sensitive, and are not required to start with a
6182 > sign, since they are merely textually
6185 > Aliases can be used throughout the actions file, but they <SPAN
6190 defined in a special section at the top of the file!</I
6193 And there can only be one such section per actions file. Each actions file may
6194 have its own alias section, and the aliases defined in it are only visible
6195 within that file.</P
6197 > There are two main reasons to use aliases: One is to save typing for frequently
6198 used combinations of actions, the other one is a gain in flexibility: If you
6199 decide once how you want to handle shops by defining an alias called
6203 >, you can later change your policy on shops in
6210 > place, and your changes will take effect everywhere
6211 in the actions file where the <SPAN
6214 > alias is used. Calling aliases
6215 by their purpose also makes your actions files more readable.</P
6217 > Currently, there is one big drawback to using aliases, though:
6221 >'s built-in web-based action file
6222 editor honors aliases when reading the actions files, but it expands
6223 them before writing. So the effects of your aliases are of course preserved,
6224 but the aliases themselves are lost when you edit sections that use aliases
6226 This is likely to change in future versions of <SPAN
6231 > Now let's define some aliases...</P
6241 > # Useful custom aliases we can use later.
6243 # Note the (required!) section header line and that this section
6244 # must be at the top of the actions file!
6248 # These aliases just save typing later:
6249 # (Note that some already use other aliases!)
6251 +crunch-all-cookies = +<A
6252 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6253 >crunch-incoming-cookies</A
6255 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6256 >crunch-outgoing-cookies</A
6258 -crunch-all-cookies = -<A
6259 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6260 >crunch-incoming-cookies</A
6262 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6263 >crunch-outgoing-cookies</A
6265 block-as-image = +block +handle-as-image
6266 mercy-for-cookies = -crunch-all-cookies -<A
6267 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6268 >session-cookies-only</A
6270 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6271 >filter{content-cookies}</A
6274 # These aliases define combinations of actions
6275 # that are useful for certain types of sites:
6278 HREF="actions-file.html#BLOCK"
6281 HREF="actions-file.html#FILTER"
6283 > -crunch-all-cookies -<A
6284 HREF="actions-file.html#FAST-REDIRECTS"
6287 HREF="actions-file.html#HIDE-REFERER"
6290 HREF="actions-file.html#KILL-POPUPS"
6293 shop = -crunch-all-cookies -<A
6294 HREF="actions-file.html#FILTER-ALL-POPUPS"
6295 >filter{all-popups}</A
6297 HREF="actions-file.html#KILL-POPUPS"
6301 # Short names for other aliases, for really lazy people ;-)
6303 c0 = +crunch-all-cookies
6304 c1 = -crunch-all-cookies</PRE
6310 > ...and put them to use. These sections would appear in the lower part of an
6311 actions file and define exceptions to the default actions (as specified further
6325 > # These sites are either very complex or very keen on
6326 # user data and require minimal interference to work:
6329 .office.microsoft.com
6330 .windowsupdate.microsoft.com
6334 # Allow cookies (for setting and retrieving your customer data)
6338 .worldpay.com # for quietpc.com
6341 # These shops require pop-ups:
6343 {shop -kill-popups -filter{all-popups}}
6345 .overclockers.co.uk</PRE
6351 > Aliases like <SPAN
6357 > are often used for
6361 > sites that require some actions to be disabled
6362 in order to function properly.</P
6371 >8.7. Actions Files Tutorial</H2
6373 > The above chapters have shown <A
6374 HREF="actions-file.html"
6375 >which actions files
6376 there are and how they are organized</A
6377 >, how actions are <A
6378 HREF="actions-file.html#ACTIONS"
6381 HREF="actions-file.html#ACTIONS-APPLY"
6385 HREF="actions-file.html#AF-PATTERNS"
6389 HREF="actions-file.html#ALIASES"
6391 >. Now, let's look at an
6399 file and see how all these pieces come together:</P
6407 >8.7.1. default.action</H3
6409 >Every config file should start with a short comment stating its purpose:</P
6419 ># Sample default.action file <ijbswa-developers@lists.sourceforge.net></PRE
6425 >Then, since this is the <TT
6429 first section is a special section for internal use that you needn't
6430 change or worry about:</P
6440 >##########################################################################
6441 # Settings -- Don't change! For internal Privoxy use ONLY.
6442 ##########################################################################
6445 for-privoxy-version=3.0</PRE
6451 >After that comes the (optional) alias section. We'll use the example
6452 section from the above <A
6453 HREF="actions-file.html#ALIASES"
6454 >chapter on aliases</A
6456 that also explains why and how aliases are used:</P
6466 >##########################################################################
6468 ##########################################################################
6471 # These aliases just save typing later:
6472 # (Note that some already use other aliases!)
6474 +crunch-all-cookies = +<A
6475 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6476 >crunch-incoming-cookies</A
6478 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6479 >crunch-outgoing-cookies</A
6481 -crunch-all-cookies = -<A
6482 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6483 >crunch-incoming-cookies</A
6485 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6486 >crunch-outgoing-cookies</A
6488 block-as-image = +block +handle-as-image
6489 mercy-for-cookies = -crunch-all-cookies -<A
6490 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6491 >session-cookies-only</A
6493 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6494 >filter{content-cookies}</A
6497 # These aliases define combinations of actions
6498 # that are useful for certain types of sites:
6501 HREF="actions-file.html#BLOCK"
6504 HREF="actions-file.html#FILTER"
6506 > -crunch-all-cookies -<A
6507 HREF="actions-file.html#FAST-REDIRECTS"
6510 HREF="actions-file.html#HIDE-REFERER"
6513 HREF="actions-file.html#KILL-POPUPS"
6516 shop = -crunch-all-cookies -<A
6517 HREF="actions-file.html#FILTER-ALL-POPUPS"
6518 >filter{all-popups}</A
6520 HREF="actions-file.html#KILL-POPUPS"
6528 > Now come the regular sections, i.e. sets of actions, accompanied
6529 by URL patterns to which they apply. Remember <SPAN
6534 are disabled when matching starts</I
6536 >, so we have to explicitly
6537 enable the ones we want.</P
6539 > The first regular section is probably the most important. It has only
6548 HREF="actions-file.html#AF-PATTERNS"
6549 >matches all URLs</A
6551 set of actions used in this <SPAN
6559 be applied to all requests as a start</I
6561 >. It can be partly or
6562 wholly overridden by later matches further down this file, or in user.action,
6563 but it will still be largely responsible for your overall browsing
6566 > Again, at the start of matching, all actions are disabled, so there is
6567 no real need to disable any actions here, but we will do that nonetheless,
6568 to have a complete listing for your reference. (Remember: a <SPAN
6572 preceding the action name enables the action, a <SPAN
6576 Also note how this long line has been made more readable by splitting it into
6577 multiple lines with line continuation.</P
6587 >##########################################################################
6588 # "Defaults" section:
6589 ##########################################################################
6592 HREF="actions-file.html#ADD-HEADER"
6596 HREF="actions-file.html#BLOCK"
6600 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
6601 >crunch-incoming-cookies</A
6604 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
6605 >crunch-outgoing-cookies</A
6608 HREF="actions-file.html#DEANIMATE-GIFS"
6612 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
6613 >downgrade-http-version</A
6616 HREF="actions-file.html#FAST-REDIRECTS"
6620 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
6621 >filter{js-annoyances}</A
6624 HREF="actions-file.html#FILTER-JS-EVENTS"
6625 >filter{js-events}</A
6628 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
6629 >filter{html-annoyances}</A
6632 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
6633 >filter{content-cookies}</A
6636 HREF="actions-file.html#FILTER-REFRESH-TAGS"
6637 >filter{refresh-tags}</A
6640 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
6641 >filter{unsolicited-popups}</A
6644 HREF="actions-file.html#FILTER-ALL-POPUPS"
6645 >filter{all-popups}</A
6648 HREF="actions-file.html#FILTER-IMG-REORDER"
6649 >filter{img-reorder}</A
6652 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
6653 >filter{banners-by-size}</A
6656 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
6657 >filter{banners-by-link}</A
6660 HREF="actions-file.html#FILTER-WEBBUGS"
6664 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
6665 >filter{tiny-textforms}</A
6668 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
6669 >filter{jumping-windows}</A
6672 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
6673 >filter{frameset-borders}</A
6676 HREF="actions-file.html#FILTER-DEMORONIZER"
6677 >filter{demoronizer}</A
6680 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
6681 >filter{shockwave-flash}</A
6684 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
6685 >filter{quicktime-kioskmode}</A
6688 HREF="actions-file.html#FILTER-FUN"
6692 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
6693 >filter{crude-parental}</A
6696 HREF="actions-file.html#FILTER-IE-EXPLOITS"
6697 >filter{ie-exploits}</A
6700 HREF="actions-file.html#HANDLE-AS-IMAGE"
6704 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
6705 >hide-forwarded-for-headers</A
6708 HREF="actions-file.html#HIDE-FROM-HEADER"
6709 >hide-from-header{block}</A
6712 HREF="actions-file.html#HIDE-REFERER"
6713 >hide-referrer{forge}</A
6716 HREF="actions-file.html#HIDE-USER-AGENT"
6720 HREF="actions-file.html#KILL-POPUPS"
6724 HREF="actions-file.html#LIMIT-CONNECT"
6728 HREF="actions-file.html#PREVENT-COMPRESSION"
6729 >prevent-compression</A
6732 HREF="actions-file.html#SEND-VANILLA-WAFER"
6733 >send-vanilla-wafer</A
6736 HREF="actions-file.html#SEND-WAFER"
6740 HREF="actions-file.html#SESSION-COOKIES-ONLY"
6741 >session-cookies-only</A
6744 HREF="actions-file.html#SET-IMAGE-BLOCKER"
6745 >set-image-blocker{pattern}</A
6748 / # forward slash will match *all* potential URL patterns.</PRE
6754 > The default behavior is now set. Note that some actions, like not hiding
6755 the user agent, are part of a <SPAN
6757 >"general policy"</SPAN
6759 universally and won't get any exceptions defined later. Other choices,
6760 like not blocking (which is <SPAN
6767 default!) need exceptions, i.e. we need to specify explicitly what we
6768 want to block in later sections.</P
6770 > The first of our specialized sections is concerned with <SPAN
6774 sites, i.e. sites that require minimum interference, because they are either
6775 very complex or very keen on tracking you (and have mechanisms in place that
6776 make them unusable for people who avoid being tracked). We will simply use
6780 > alias instead of stating the list
6781 of actions explicitly:</P
6791 >##########################################################################
6792 # Exceptions for sites that'll break under the default action set:
6793 ##########################################################################
6795 # "Fragile" Use a minimum set of actions for these sites (see alias above):
6798 .office.microsoft.com # surprise, surprise!
6799 .windowsupdate.microsoft.com</PRE
6805 > Shopping sites are not as fragile, but they typically
6806 require cookies to log in, and pop-up windows for shopping
6807 carts or item details. Again, we'll use a pre-defined alias:</P
6821 .worldpay.com # for quietpc.com
6832 HREF="actions-file.html#FAST-REDIRECTS"
6836 action, which we enabled per default above, breaks some sites. So disable
6837 it for popular sites where we know it misbehaves:</P
6848 HREF="actions-file.html#FAST-REDIRECTS"
6854 .altavista.com/.*(like|url|link):http
6855 .altavista.com/trans.*urltext=http
6862 > It is important that <SPAN
6866 URLs belong to images, so that <SPAN
6873 be blocked, a substitute image can be sent, rather than an HTML page.
6874 Contacting the remote site to find out is not an option, since it
6875 would destroy the loading time advantage of banner blocking, and it
6876 would feed the advertisers (in terms of money <SPAN
6883 information). We can mark any URL as an image with the <TT
6886 HREF="actions-file.html#HANDLE-AS-IMAGE"
6890 and marking all URLs that end in a known image file extension is a
6901 >##########################################################################
6903 ##########################################################################
6905 # Define which file types will be treated as images, in case they get
6906 # blocked further down this file:
6909 HREF="actions-file.html#HANDLE-AS-IMAGE"
6912 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
6918 > And then there are known banner sources. They often use scripts to
6919 generate the banners, so it won't be visible from the URL that the
6920 request is for an image. Hence we block them <SPAN
6927 mark them as images in one go, with the help of our
6931 > alias defined above. (We could of
6932 course just as well use <TT
6935 HREF="actions-file.html#BLOCK"
6939 HREF="actions-file.html#HANDLE-AS-IMAGE"
6943 Remember that the type of the replacement image is chosen by the
6947 HREF="actions-file.html#SET-IMAGE-BLOCKER"
6948 >set-image-blocker</A
6951 action. Since all URLs have matched the default section with its
6955 HREF="actions-file.html#SET-IMAGE-BLOCKER"
6956 >set-image-blocker</A
6959 action before, it still applies and needn't be repeated:</P
6969 ># Known ad generators:
6974 .ad.*.doubleclick.net
6975 .a.yimg.com/(?:(?!/i/).)*$
6976 .a[0-9].yimg.com/(?:(?!/i/).)*$
6985 > One of the most important jobs of <SPAN
6989 is to block banners. A huge bunch of them are already <SPAN
6996 HREF="actions-file.html#FILTER"
6998 >{banners-by-size}</TT
7000 action, which we enabled above, and which deletes the references to banner
7001 images from the pages while they are loaded, so the browser doesn't request
7002 them anymore, and hence they don't need to be blocked here. But this naturally
7003 doesn't catch all banners, and some people choose not to use filters, so we
7004 need a comprehensive list of patterns for banner URLs here, and apply the
7008 HREF="actions-file.html#BLOCK"
7011 > action to them.</P
7013 > First comes a bunch of generic patterns, which do most of the work, by
7014 matching typical domain and path name components of banners. Then comes
7015 a list of individual patterns for specific sites, which is omitted here
7016 to keep the example short:</P
7026 >##########################################################################
7027 # Block these fine banners:
7028 ##########################################################################
7030 HREF="actions-file.html#BLOCK"
7040 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
7041 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
7043 # Site-specific patterns (abbreviated):
7051 > You wouldn't believe how many advertisers actually call their banner
7057 >.com, or call the directory
7058 in which the banners are stored simply <SPAN
7062 generic patterns are surprisingly effective.</P
7064 > But being very generic, they necessarily also catch URLs that we don't want
7065 to block. The pattern <TT
7077 >.nasty-corp.com"</SPAN
7087 >.sourcefroge.net"</SPAN
7097 >l.some-provider.net."</SPAN
7099 well-known exceptions to the <TT
7102 HREF="actions-file.html#BLOCK"
7108 > Note that these are exceptions to exceptions from the default! Consider the URL
7111 >"downloads.sourcefroge.net"</SPAN
7112 >: Initially, all actions are deactivated,
7113 so it wouldn't get blocked. Then comes the defaults section, which matches the
7114 URL, but just deactivates the <TT
7117 HREF="actions-file.html#BLOCK"
7121 action once again. Then it matches <TT
7124 >, an exception to the
7125 general non-blocking policy, and suddenly
7129 HREF="actions-file.html#BLOCK"
7132 > applies. And now, it'll match
7139 HREF="actions-file.html#BLOCK"
7143 applies, so (unless it matches <SPAN
7149 > further down) it ends up
7153 HREF="actions-file.html#BLOCK"
7156 > action applying.</P
7166 >##########################################################################
7167 # Save some innocent victims of the above generic block patterns:
7168 ##########################################################################
7173 HREF="actions-file.html#BLOCK"
7176 adv[io]*. # (for advogato.org and advice.*)
7177 adsl. # (has nothing to do with ads)
7178 ad[ud]*. # (adult.* and add.*)
7179 .edu # (universities don't host banners (yet!))
7180 .*loads. # (downloads, uploads etc)
7188 www.globalintersec.com/adv # (adv = advanced)
7189 www.ugu.com/sui/ugu/adv</PRE
7195 > Filtering source code can have nasty side effects,
7196 so make an exception for our friends at sourceforge.net,
7197 and all paths with <SPAN
7200 > in them. Note that
7204 HREF="actions-file.html#FILTER"
7214 > filters in one fell swoop!</P
7224 ># Don't filter code!
7227 HREF="actions-file.html#FILTER"
7231 .sourceforge.net</PRE
7241 comprehensive, but we hope this example made clear how it works.</P
7250 >8.7.2. user.action</H3
7252 > So far we are painting with a broad brush by setting general policies,
7253 which would be a reasonable starting point for many people. Now,
7254 you might want to be more specific and have customized rules that
7255 are more suitable to your personal habits and preferences. These would
7256 be for narrowly defined situations like your ISP or your bank, and should
7260 >, which is parsed after all other
7261 actions files and hence has the last word, over-riding any previously
7262 defined actions. <TT
7272 > place for your personal settings, since
7276 > is actively maintained by the
7280 > developers and you'll probably want
7281 to install updated versions from time to time.</P
7283 > So let's look at a few examples of things that one might typically do in
7297 ># My user.action file. <fred@foobar.com></PRE
7304 HREF="actions-file.html#ALIASES"
7306 > are local to the actions
7307 file that they are defined in, you can't use the ones from
7311 >, unless you repeat them here:</P
7321 ># Aliases are local to the file they are defined in.
7322 # (Re-)define aliases for this file:
7326 # These aliases just save typing later, and the alias names should
7327 # be self explanatory.
7329 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
7330 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
7331 allow-all-cookies = -crunch-all-cookies -session-cookies-only
7332 allow-popups = -filter{all-popups} -kill-popups
7333 +block-as-image = +block +handle-as-image
7334 -block-as-image = -block
7336 # These aliases define combinations of actions that are useful for
7337 # certain types of sites:
7339 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
7340 shop = -crunch-all-cookies allow-popups
7342 # Allow ads for selected useful free sites:
7344 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}</PRE
7352 > Say you have accounts on some sites that you visit regularly, and
7353 you don't want to have to log in manually each time. So you'd like
7354 to allow persistent cookies for these sites. The
7357 >allow-all-cookies</TT
7358 > alias defined above does exactly
7359 that, i.e. it disables crunching of cookies in any direction, and the
7360 processing of cookies to make them only temporary.</P
7370 >{ allow-all-cookies }
7382 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
7393 HREF="actions-file.html#FILTER"
7396 .your-home-banking-site.com</PRE
7402 > Some file types you may not want to filter for various reasons:</P
7412 ># Technical documentation is likely to contain strings that might
7413 # erroneously get altered by the JavaScript-oriented filters:
7418 # And this stupid host sends streaming video with a wrong MIME type,
7419 # so that Privoxy thinks it is getting HTML and starts filtering:
7421 stupid-server.example.com/</PRE
7427 > Example of a simple <A
7428 HREF="actions-file.html#BLOCK"
7430 > action. Say you've
7431 seen an ad on your favourite page on example.com that you want to get rid of.
7432 You have right-clicked the image, selected <SPAN
7434 >"copy image location"</SPAN
7436 and pasted the URL below while removing the leading http://, into a
7440 > section. Note that <TT
7444 > need not be specified, since all URLs ending in
7448 > will be tagged as images by the general rules as set
7449 in default.action anyway:</P
7460 HREF="actions-file.html#BLOCK"
7463 www.example.com/nasty-ads/sponsor.gif
7464 another.popular.site.net/more/junk/here/</PRE
7470 > The URLs of dynamically generated banners, especially from large banner
7471 farms, often don't use the well-known image file name extensions, which
7472 makes it impossible for <SPAN
7476 the file type just by looking at the URL.
7479 >+block-as-image</TT
7480 > alias defined above for
7482 Note that objects which match this rule but then turn out NOT to be an
7483 image are typically rendered as a <SPAN
7485 >"broken image"</SPAN
7487 browser. Use cautiously.</P
7497 >{ +block-as-image }
7506 > Now you noticed that the default configuration breaks Forbes Magazine,
7507 but you were too lazy to find out which action is the culprit, and you
7508 were again too lazy to give <A
7512 you just used the <TT
7515 > alias on the site, and
7522 > -- it worked. The <TT
7526 aliases disables those actions that are most likely to break a site. Also,
7527 good for testing purposes to see if it is <SPAN
7531 that is causing the problem or not.</P
7548 > You like the <SPAN
7551 > text replacements in <TT
7555 but it is disabled in the distributed actions file. (My colleagues on the team just
7556 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
7557 update-safe config, once and for all:</P
7568 HREF="actions-file.html#FILTER-FUN"
7571 / # For ALL sites!</PRE
7577 > Note that the above is not really a good idea: There are exceptions
7578 to the filters in <TT
7582 really shouldn't be filtered, like code on CVS->Web interfaces. Since
7586 > has the last word, these exceptions
7587 won't be valid for the <SPAN
7590 > filtering specified here.</P
7592 > You might also worry about how your favourite free websites are
7593 funded, and find that they rely on displaying banner advertisements
7594 to survive. So you might want to specifically allow banners for those
7595 sites that you feel provide value to you:</P
7617 > has been aliased to
7621 HREF="actions-file.html#BLOCK"
7628 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
7629 >filter{banners-by-size}</A
7635 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
7636 >filter{banners-by-link}</A
7643 > is generally the best place to define
7644 exceptions and additions to the default policies of
7648 >. Some actions are safe to have their
7649 default policies set here though. So let's set a default policy to have a
7653 > image as opposed to the checkerboard pattern for
7663 > of course matches all URL
7664 paths and patterns:</P
7675 HREF="actions-file.html#SET-IMAGE-BLOCKER"
7676 >set-image-blocker{blank}</A
7691 SUMMARY="Footer navigation table"
7720 HREF="filter-file.html"
7730 >The Main Configuration File</TD