7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="Privoxy 3.0.1 User Manual"
11 HREF="index.html"><LINK
13 TITLE="The Main Configuration File"
14 HREF="config.html"><LINK
16 TITLE="The Filter File"
17 HREF="filter-file.html"><LINK
20 HREF="../p_doc.css"></HEAD
31 SUMMARY="Header navigation table"
40 >Privoxy 3.0.1 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 action file file. Every time it matches, the list of
676 applicable actions for the URL is incrementally updated, using the heading
677 of the section in which the pattern is located. If multiple matches for
678 the same URL set the same action differently, the last match wins. If not,
679 the effects are aggregated. E.g. a URL might match a regular section with
680 a heading line of <TT
684 HREF="actions-file.html#HANDLE-AS-IMAGE"
688 then later another one with just <TT
692 HREF="actions-file.html#BLOCK"
702 > actions to apply.</P
704 > You can trace this process for any given URL by visiting <A
705 HREF="http://config.privoxy.org/show-url-info"
707 >http://config.privoxy.org/show-url-info</A
710 > More detail on this is provided in the Appendix, <A
711 HREF="appendix.html#ACTIONSANAT"
712 > Anatomy of an Action</A
732 to determine what actions might apply to which sites and pages your browser
733 attempts to access. These <SPAN
743 > matching to achieve a high degree of
744 flexibility. This allows one expression to be expanded and potentially match
745 against many similar patterns.</P
750 > pattern has the form
753 ><domain>/<path></TT
757 ><domain></TT
762 optional. (This is why the special <TT
765 > pattern matches all
766 URLs). Note that the protocol portion of the URL pattern (e.g.
777 the pattern. This is assumed already!</P
786 >www.example.com/</TT
790 > is a domain-only pattern and will match any request to <TT
794 regardless of which document on that server is requested.
804 > means exactly the same. For domain-only patterns, the trailing <TT
814 >www.example.com/index.html</TT
818 > matches only the single document <TT
835 > matches the document <TT
838 >, regardless of the domain,
855 > matches nothing, since it would be interpreted as a domain name and
856 there is no top-level domain called <TT
871 >8.4.1. The Domain Pattern</H3
873 > The matching of the domain part offers some flexible options: if the
874 domain starts or ends with a dot, it becomes unanchored at that end.
888 > matches any domain that <SPAN
908 > matches any domain that <SPAN
928 > matches any domain that <SPAN
938 (Correctly speaking: It matches any FQDN that contains <TT
947 > Additionally, there are wild-cards that you can use in the domain names
948 themselves. They work pretty similar to shell wild-cards: <SPAN
952 stands for zero or more arbitrary characters, <SPAN
956 any single character, you can define character classes in square
957 brackets and all of that can be freely mixed:</P
972 >"adserver.example.com"</SPAN
976 >"ads.example.com"</SPAN
979 >"sfads.example.com"</SPAN
986 >*ad*.example.com</TT
990 > matches all of the above, and then some.
1006 >pictures.epix.com</TT
1009 >a.b.c.d.e.upix.com</TT
1016 >www[1-9a-ez].example.c*</TT
1022 >www1.example.com</TT
1026 >www4.example.cc</TT
1029 >wwwd.example.cy</TT
1033 >wwwz.example.com</TT
1043 >wwww.example.com</TT
1057 >8.4.2. The Path Pattern</H3
1062 > uses Perl compatible regular expressions
1064 HREF="http://www.pcre.org/"
1068 matching the path.</P
1071 HREF="appendix.html#REGEX"
1073 > with a brief quick-start into regular
1074 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
1076 HREF="http://www.pcre.org/man.txt"
1078 >http://www.pcre.org/man.txt</A
1080 You might also find the Perl man page on regular expressions (<TT
1084 useful, which is available on-line at <A
1085 HREF="http://www.perldoc.com/perl5.6/pod/perlre.html"
1087 >http://www.perldoc.com/perl5.6/pod/perlre.html</A
1090 > Note that the path pattern is automatically left-anchored at the <SPAN
1094 i.e. it matches as if it would start with a <SPAN
1097 > (regular expression speak
1098 for the beginning of a line).</P
1100 > Please also note that matching in the path is <SPAN
1104 >CASE INSENSITIVE</I
1107 by default, but you can switch to case sensitive at any point in the pattern by using the
1113 >www.example.com/(?-i)PaTtErN.*</TT
1115 only documents whose path starts with <TT
1125 > this capitalization.</P
1137 > All actions are disabled by default, until they are explicitly enabled
1138 somewhere in an actions file. Actions are turned on if preceded with a
1142 >, and turned off if preceded with a <SPAN
1151 >"do that action"</SPAN
1158 >"please block URLs that match the
1159 following patterns"</SPAN
1166 block URLs that match the following patterns, even if <TT
1170 previously applied."</SPAN
1174 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1175 separated by whitespace, like in
1178 >{+some-action -some-other-action{some-parameter}}</TT
1180 followed by a list of URL patterns, one per line, to which they apply.
1181 Together, the actions line and the following pattern lines make up a section
1182 of the actions file. </P
1185 There are three classes of actions:</P
1193 Boolean, i.e the action can only be <SPAN
1216 > # enable action <TT
1227 > # disable action <TT
1249 Parameterized, where some value is required in order to enable this type of action.
1271 >} # enable action and set parameter to <TT
1277 # overwriting parameter from previous match if necessary
1283 > # disable action. The parameter can be omitted</PRE
1290 > Note that if the URL matches multiple positive forms of a parameterized action,
1291 the last match wins, i.e. the params from earlier matches are simply ignored.
1297 >+hide-user-agent{ Mozilla 1.0 }</TT
1304 Multi-value. These look exactly like parameterized actions,
1305 but they behave differently: If the action applies multiple times to the
1306 same URL, but with different parameters, <SPAN
1319 > matches are remembered. This is used for actions
1320 that can be executed for the same request repeatedly, like adding multiple
1321 headers, or filtering through multiple filters. Syntax:
1342 >} # enable action and add <TT
1347 > to the list of parameters
1358 >} # remove the parameter <TT
1363 > from the list of parameters
1364 # If it was the last one left, disable the action.
1370 > # disable this action completely and remove all parameters from the list</PRE
1380 >+add-header{X-Fun-Header: Some text}</TT
1384 >+filter{html-annoyances}</TT
1391 > If nothing is specified in any actions file, no <SPAN
1395 taken. So in this case <SPAN
1399 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
1400 privacy and blocking features you need (although the provided default actions
1401 files will give a good starting point).</P
1403 > Later defined actions always over-ride earlier ones. So exceptions
1404 to any rules you make, should come in the latter part of the file (or
1405 in a file that is processed later when using multiple actions files). For
1406 multi-valued actions, the actions are applied in the order they are specified.
1407 Actions files are processed in the order they are defined in
1411 > (the default installation has three actions
1412 files). It also quite possible for any given URL pattern to match more than
1413 one pattern and thus more than one set of actions!</P
1415 > The list of valid <SPAN
1426 >8.5.1. add-header</H4
1430 CLASS="VARIABLELIST"
1436 >Confuse log analysis, custom applications</P
1442 > Sends a user defined HTTP header to the web server.
1455 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1456 It is recommended that you use the <SPAN
1470 > This action may be specified multiple times, in order to define multiple
1471 headers. This is rarely needed for the typical user. If you don't know what
1474 >"HTTP headers"</SPAN
1475 > are, you definitely don't need to worry about this
1491 >+add-header{X-User-Tracking: sucks}</PRE
1512 CLASS="VARIABLELIST"
1518 >Block ads or other obnoxious content</P
1524 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1525 forwarded to the remote server, but answered locally with a substitute page or image,
1526 as determined by the <TT
1529 HREF="actions-file.html#HANDLE-AS-IMAGE"
1536 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1537 >set-image-blocker</A
1561 > sends a special <SPAN
1565 for requests to blocked pages. This page contains links to find out why the request
1566 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1567 force feature enabled). The <SPAN
1570 > page adapts to the available
1571 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1572 if loaded into a small frame or window. If you are using <SPAN
1576 right now, you can take a look at the
1578 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1589 A very important exception occurs if <SPAN
1602 HREF="actions-file.html#HANDLE-AS-IMAGE"
1606 apply to the same request: it will then be replaced by an image. If
1610 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1611 >set-image-blocker</A
1614 (see below) also applies, the type of image will be determined by its parameter,
1615 if not, the standard checkerboard pattern is sent.
1618 > It is important to understand this process, in order
1619 to understand how <SPAN
1623 ads and other unwanted content.
1629 HREF="actions-file.html#FILTER"
1633 action can perform a very similar task, by <SPAN
1637 banner images and other content through rewriting the relevant URLs in the
1638 document's HTML source, so they don't get requested in the first place.
1639 Note that this is a totally different technique, and it's easy to confuse the two.
1643 >Example usage (section):</DT
1654 >{+block} # Block and replace with "blocked" page
1655 .nasty-stuff.example.com
1657 {+block +handle-as-image} # Block and replace with image
1674 NAME="CRUNCH-INCOMING-COOKIES"
1676 >8.5.3. crunch-incoming-cookies</H4
1680 CLASS="VARIABLELIST"
1686 > Prevent the web server from setting any cookies on your system
1695 >"Set-Cookie:"</SPAN
1696 > HTTP headers from server replies.
1716 > This action is only concerned with <SPAN
1733 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
1734 >crunch-outgoing-cookies</A
1743 > to disable cookies completely.
1752 > to use this action in conjunction
1756 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1757 >session-cookies-only</A
1760 since it would prevent the session cookies from being set. See also
1764 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
1765 >filter-content-cookies</A
1782 >+crunch-incoming-cookies</PRE
1797 NAME="CRUNCH-OUTGOING-COOKIES"
1799 >8.5.4. crunch-outgoing-cookies</H4
1803 CLASS="VARIABLELIST"
1809 > Prevent the web server from reading any cookies from your system
1819 > HTTP headers from client requests.
1839 > This action is only concerned with <SPAN
1856 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
1857 >crunch-incoming-cookies</A
1866 > to disable cookies completely.
1875 > to use this action in conjunction
1879 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1880 >session-cookies-only</A
1883 since it would prevent the session cookies from being read.
1898 >+crunch-outgoing-cookies</PRE
1913 NAME="DEANIMATE-GIFS"
1915 >8.5.5. deanimate-gifs</H4
1919 CLASS="VARIABLELIST"
1925 >Stop those annoying, distracting animated GIF images.</P
1931 > De-animate GIF animations, i.e. reduce them to their first or last image.
1957 > This will also shrink the images considerably (in bytes, not pixels!). If
1961 > is given, the first frame of the animation
1962 is used as the replacement. If <SPAN
1965 > is given, the last
1966 frame of the animation is used instead, which probably makes more sense for
1967 most banner animations, but also has the risk of not showing the entire
1968 last frame (if it is only a delta to an earlier frame).
1971 > You can safely use this action with patterns that will also match non-GIF
1972 objects, because no attempt will be made at anything that doesn't look like
1988 >+deanimate-gifs{last}</PRE
2003 NAME="DOWNGRADE-HTTP-VERSION"
2005 >8.5.6. downgrade-http-version</H4
2009 CLASS="VARIABLELIST"
2015 >Work around (very rare) problems with HTTP/1.1</P
2021 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
2041 > This is a left-over from the time when <SPAN
2045 didn't support important HTTP/1.1 features well. It is left here for the
2046 unlikely case that you experience HTTP/1.1 related problems with some server
2047 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
2048 is a chance you might need this action.
2052 >Example usage (section):</DT
2063 >{+downgrade-http-version}
2064 problem-host.example.com</PRE
2079 NAME="FAST-REDIRECTS"
2081 >8.5.7. fast-redirects</H4
2085 CLASS="VARIABLELIST"
2091 >Fool some click-tracking scripts and speed up indirect links</P
2097 > Cut off all but the last valid URL from requests.
2118 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2119 will link to some script on their own servers, giving the destination as a
2120 parameter, which will then redirect you to the final target. URLs
2121 resulting from this scheme typically look like:
2126 >http://some.place/click-tracker.cgi?target=http://some.where.else</I
2131 > Sometimes, there are even multiple consecutive redirects encoded in the
2132 URL. These redirections via scripts make your web browsing more traceable,
2133 since the server from which you follow such a link can see where you go
2134 to. Apart from that, valuable bandwidth and time is wasted, while your
2135 browser ask the server for one redirect after the other. Plus, it feeds
2139 > This feature is currently not very smart and is scheduled for improvement.
2140 It is likely to break some sites. You should expect to need possibly
2141 many exceptions to this action, if it is enabled by default in
2145 >. Some sites just don't work without
2161 >{+fast-redirects}</PRE
2182 CLASS="VARIABLELIST"
2188 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
2194 > Text documents, including HTML and JavaScript, to which this action
2195 applies, are filtered on-the-fly through the specified regular expression
2196 based substitutions.
2209 > The name of a filter, as defined in the <A
2210 HREF="filter-file.html"
2220 HREF="config.html#FILTERFILE"
2228 can be completely disabled without the use of parameters.
2235 > For your convenience, there are a number of pre-defined filters available
2236 in the distribution filter file that you can use. See the examples below for
2240 > This is potentially a very powerful feature! But <SPAN
2242 >"rolling your own"</SPAN
2244 filters requires a knowledge of regular expressions and HTML.
2247 > Filtering requires buffering the page content, which may appear to
2248 slow down page rendering since nothing is displayed until all content has
2249 passed the filters. (It does not really take longer, but seems that way
2250 since the page is not incrementally displayed.) This effect will be more
2251 noticeable on slower connections.
2254 > The amount of data that can be filtered is limited to the
2258 HREF="config.html#BUFFER-LIMIT"
2262 option in the main <A
2266 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2267 data, and all pending data, is passed through unfiltered.
2270 > Inappropriate MIME types, such as zipped files, are not filtered at all.
2271 Encrypted SSL data (from HTTPS servers) cannot be filtered either since
2272 this would violate the integrity of the secure transaction.
2275 > At this time, <SPAN
2278 > cannot (yet!) uncompress compressed
2279 documents. If you want filtering to work on all documents, even those that
2280 would normally be sent compressed, use the
2284 HREF="actions-file.html#PREVENT-COMPRESSION"
2285 >prevent-compression</A
2288 action in conjunction with <TT
2294 > Filtering can achieve some of the same effects as the
2298 HREF="actions-file.html#BLOCK"
2302 action, i.e. it can be used to block ads and banners. But the mechanism
2303 works quite differently. One effective use, is to block ad banners
2304 based on their size (see below), since many of these seem to be somewhat
2311 > with suggestions for new or
2312 improved filters is particularly welcome!
2316 >Example usage (with filters from the distribution <TT
2323 NAME="FILTER-JS-ANNOYANCES"
2334 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
2342 NAME="FILTER-JS-EVENTS"
2353 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
2361 NAME="FILTER-HTML-ANNOYANCES"
2372 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
2380 NAME="FILTER-CONTENT-COOKIES"
2391 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
2399 NAME="FILTER-REFRESH-TAGS"
2410 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
2418 NAME="FILTER-UNSOLICITED-POPUPS"
2429 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
2437 NAME="FILTER-ALL-POPUPS"
2448 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
2456 NAME="FILTER-IMG-REORDER"
2467 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
2475 NAME="FILTER-BANNERS-BY-SIZE"
2486 >+filter{banners-by-size} # Kill banners by size</PRE
2494 NAME="FILTER-BANNERS-BY-LINK"
2505 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
2513 NAME="FILTER-WEBBUGS"
2524 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
2532 NAME="FILTER-TINY-TEXTFORMS"
2543 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
2551 NAME="FILTER-JUMPING-WINDOWS"
2562 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
2570 NAME="FILTER-FRAMESET-BORDERS"
2581 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
2589 NAME="FILTER-DEMORONIZER"
2600 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
2608 NAME="FILTER-SHOCKWAVE-FLASH"
2619 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
2627 NAME="FILTER-QUICKTIME-KIOSKMODE"
2638 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
2657 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
2665 NAME="FILTER-CRUDE-PARENTAL"
2676 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
2684 NAME="FILTER-IE-EXPLOITS"
2695 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
2710 NAME="HANDLE-AS-IMAGE"
2712 >8.5.9. handle-as-image</H4
2716 CLASS="VARIABLELIST"
2722 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
2726 >if they get blocked</I
2734 > This action alone doesn't do anything noticeable. It just marks URLs as images.
2738 HREF="actions-file.html#BLOCK"
2748 the presence or absence of this mark decides whether an HTML <SPAN
2752 page, or a replacement image (as determined by the <TT
2755 HREF="actions-file.html#SET-IMAGE-BLOCKER"
2756 >set-image-blocker</A
2758 > action) will be sent to the
2759 client as a substitute for the blocked content.
2779 > The below generic example section is actually part of <TT
2783 It marks all URLs with well-known image file name extensions as images and should
2787 > Users will probably only want to use the handle-as-image action in conjunction with
2791 HREF="actions-file.html#BLOCK"
2794 >, to block sources of banners, whose URLs don't
2795 reflect the file type, like in the second example section.
2798 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
2799 frames require an HTML page to be sent, or they won't display properly.
2802 >handle-as-image</TT
2803 > in this situation will not replace the
2804 ad frame with an image, but lead to error messages.
2808 >Example usage (sections):</DT
2819 ># Generic image extensions:
2822 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2824 # These don't look like images, but they're banners and should be
2825 # blocked as images:
2827 {+block +handle-as-image}
2828 some.nasty-banner-server.com/junk.cgi?output=trash
2830 # Banner source! Who cares if they also have non-image content?
2831 ad.doubleclick.net </PRE
2846 NAME="HIDE-FORWARDED-FOR-HEADERS"
2848 >8.5.10. hide-forwarded-for-headers</H4
2852 CLASS="VARIABLELIST"
2858 >Improve privacy by hiding the true source of the request</P
2864 > Deletes any existing <SPAN
2866 >"X-Forwarded-for:"</SPAN
2867 > HTTP header from client requests,
2868 and prevents adding a new one.
2888 > It is fairly safe to leave this on.
2891 > This action is scheduled for improvement: It should be able to generate forged
2894 >"X-Forwarded-for:"</SPAN
2895 > headers using random IP addresses from a specified network,
2896 to make successive requests from the same client look like requests from a pool of different
2897 users sharing the same proxy.
2912 >+hide-forwarded-for-headers</PRE
2927 NAME="HIDE-FROM-HEADER"
2929 >8.5.11. hide-from-header</H4
2933 CLASS="VARIABLELIST"
2939 >Keep your (old and ill) browser from telling web servers your email address</P
2945 > Deletes any existing <SPAN
2948 > HTTP header, or replaces it with the
2965 >, or any user defined value.
2975 > will completely remove the header
2976 (not to be confused with the <TT
2979 HREF="actions-file.html#BLOCK"
2986 > Alternately, you can specify any value you prefer to be sent to the web
2987 server. If you do, it is a matter of fairness not to use any address that
2988 is actually used by a real person.
2991 > This action is rarely needed, as modern web browsers don't send
3010 >+hide-from-header{block}</PRE
3023 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
3038 NAME="HIDE-REFERRER"
3040 >8.5.12. hide-referrer</H4
3047 CLASS="VARIABLELIST"
3053 >Conceal which link you followed to get to a particular site</P
3062 > (sic) HTTP header from the client request,
3063 or replaces it with a forged one.
3083 > to delete the header completely.</P
3090 > to pretend to be coming from the homepage of the server we are talking to.</P
3094 >Any other string to set a user defined referrer.</P
3105 > is the preferred option here, since some servers will
3106 not send images back otherwise, in an attempt to prevent their valuable
3107 content from being embedded elsewhere (and hence, without being surrounded
3121 > is an alternate spelling of
3125 > and the two can be can be freely
3126 substituted with each other. (<SPAN
3130 correct English spelling, however the HTTP specification has a bug - it
3131 requires it to be spelled as <SPAN
3149 >+hide-referrer{forge}</PRE
3162 >+hide-referrer{http://www.yahoo.com/}</PRE
3177 NAME="HIDE-USER-AGENT"
3179 >8.5.13. hide-user-agent</H4
3183 CLASS="VARIABLELIST"
3189 >Conceal your type of browser and client operating system</P
3195 > Replaces the value of the <SPAN
3197 >"User-Agent:"</SPAN
3199 in client requests with the specified value.
3212 > Any user-defined string.
3237 > This breaks many web sites that depend on looking at this header in order
3238 to customize their content for different browsers (which, by the
3246 HREF="http://www.javascriptkit.com/javaindex.shtml"
3257 > Using this action in multi-user setups or wherever different types of
3258 browsers will access the same <SPAN
3268 >. In single-user, single-browser
3269 setups, you might use it to delete your OS version information from
3270 the headers, because it is an invitation to exploit known bugs for your
3271 OS. It is also occasionally useful to forge this in order to access
3272 sites that won't let you in otherwise (though there may be a good
3273 reason in some cases). Example of this: some MSN sites will not
3277 > enter, yet forging to a
3281 > user-agent works just fine.
3282 (Must be just a silly MS goof, I'm sure :-).
3285 > This action is scheduled for improvement.
3300 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
3317 >8.5.14. kill-popups<A
3324 CLASS="VARIABLELIST"
3330 >Eliminate those annoying pop-up windows (deprecated)</P
3336 > While loading the document, replace JavaScript code that opens
3337 pop-up windows with (syntactically neutral) dummy code on the fly.
3357 > This action is basically a built-in, hardwired special-purpose filter
3358 action, but there are important differences: For <TT
3362 the document need not be buffered, so it can be incrementally rendered while
3363 downloading. But <TT
3366 > doesn't catch as many pop-ups as
3370 HREF="actions-file.html#FILTER-ALL-POPUPS"
3379 does and is not as smart as <TT
3382 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
3386 >unsolicited-popups</I
3394 > Think of it as a fast and efficient replacement for a filter that you
3395 can use if you don't want any filtering at all. Note that it doesn't make
3396 sense to combine it with any <TT
3399 HREF="actions-file.html#FILTER"
3403 since as soon as one <TT
3406 HREF="actions-file.html#FILTER"
3410 the whole document needs to be buffered anyway, which destroys the advantage of
3414 > action over its filter equivalent.
3417 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
3418 pop-ups to display forms, shopping carts etc, and the <TT
3421 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
3425 >unsolicited-popups</I
3430 > does a fairly good job of catching only the unwanted ones.
3433 > If the only kind of pop-ups that you want to kill are exit consoles (those
3440 > windows that appear when you close an other
3441 one), you might want to use
3445 HREF="actions-file.html#FILTER"
3483 NAME="LIMIT-CONNECT"
3485 >8.5.15. limit-connect</H4
3489 CLASS="VARIABLELIST"
3495 >Prevent abuse of <SPAN
3498 > as a TCP proxy relay</P
3504 > Specifies to which ports HTTP CONNECT requests are allowable.
3517 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
3518 defaulting to 0 and the maximum to 65K).
3525 > By default, i.e. if no <TT
3532 > only allows HTTP CONNECT
3533 requests to port 443 (the standard, secure HTTPS port). Use
3537 > if more fine-grained control is desired
3538 for some or all destinations.
3541 > The CONNECT methods exists in HTTP to allow access to secure websites
3545 > URLs) through proxies. It works very simply:
3546 the proxy connects to the server on the specified port, and then
3547 short-circuits its connections to the client and to the remote server.
3548 This can be a big security hole, since CONNECT-enabled proxies can be
3549 abused as TCP relays very easily.
3552 > If you don't know what any of this means, there probably is no reason to
3553 change this one, since the default is already very restrictive.
3557 >Example usages:</DT
3568 >+limit-connect{443} # This is the default and need not be specified.
3569 +limit-connect{80,443} # Ports 80 and 443 are OK.
3570 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
3571 +limit-connect{-} # All ports are OK (gaping security hole!)</PRE
3586 NAME="PREVENT-COMPRESSION"
3588 >8.5.16. prevent-compression</H4
3592 CLASS="VARIABLELIST"
3598 > Ensure that servers send the content uncompressed, so it can be
3602 HREF="actions-file.html#FILTER"
3612 > Adds a header to the request that asks for uncompressed transfer.
3632 > More and more websites send their content compressed by default, which
3633 is generally a good idea and saves bandwidth. But for the <TT
3636 HREF="actions-file.html#FILTER"
3642 HREF="actions-file.html#DEANIMATE-GIFS"
3649 HREF="actions-file.html#KILL-POPUPS"
3656 > needs access to the uncompressed data.
3657 Unfortunately, <SPAN
3660 > can't yet(!) uncompress, filter, and
3661 re-compress the content on the fly. So if you want to ensure that all websites, including
3662 those that normally compress, can be filtered, you need to use this action.
3665 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
3666 actions, you will typically want to use <TT
3668 >prevent-compression</TT
3673 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
3674 documents correctly (they send an empty document body). If you use <TT
3676 >prevent-compression</TT
3678 per default, you'll have to add exceptions for those sites. See the example for how to do that.
3682 >Example usage (sections):</DT
3695 {+prevent-compression}
3698 # Make exceptions for ill sites:
3700 {-prevent-compression}
3702 www.pclinuxonline.com</PRE
3717 NAME="SEND-VANILLA-WAFER"
3719 >8.5.17. send-vanilla-wafer</H4
3723 CLASS="VARIABLELIST"
3729 > Feed log analysis scripts with useless data.
3736 > Sends a cookie with each request stating that you do not accept any copyright
3737 on cookies sent to you, and asking the site operator not to track you.
3757 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
3760 > This action is rarely used and not enabled in the default configuration.
3775 >+send-vanilla-wafer</PRE
3792 >8.5.18. send-wafer</H4
3796 CLASS="VARIABLELIST"
3802 > Send custom cookies or feed log analysis scripts with even more useless data.
3809 > Sends a custom, user-defined cookie with each request.
3822 > A string of the form <SPAN
3842 > Being multi-valued, multiple instances of this action can apply to the same request,
3843 resulting in multiple cookies being sent.
3846 > This action is rarely used and not enabled in the default configuration.
3850 >Example usage (section):</DT
3861 >{+send-wafer{UsingPrivoxy=true}}
3862 my-internal-testing-server.void</PRE
3877 NAME="SESSION-COOKIES-ONLY"
3879 >8.5.19. session-cookies-only</H4
3883 CLASS="VARIABLELIST"
3889 > Allow only temporary <SPAN
3892 > cookies (for the current
3893 browser session <SPAN
3911 >"Set-Cookie:"</SPAN
3913 server headers. Most browsers will not store such cookies permanently and
3914 forget them in between sessions.
3934 > This is less strict than <TT
3937 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3938 >crunch-incoming-cookies</A
3944 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3945 >crunch-outgoing-cookies</A
3947 > and allows you to browse
3948 websites that insist or rely on setting cookies, without compromising your privacy too badly.
3951 > Most browsers will not permanently store cookies that have been processed by
3954 >session-cookies-only</TT
3955 > and will forget about them between sessions.
3956 This makes profiling cookies useless, but won't break sites which require cookies so
3957 that you can log in for transactions. This is generally turned on for all
3958 sites, and is the recommended setting.
3969 >session-cookies-only</TT
3974 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3975 >crunch-incoming-cookies</A
3981 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3982 >crunch-outgoing-cookies</A
3984 >. If you do, cookies
3985 will be plainly killed.
3988 > Note that it is up to the browser how it handles such cookies without an <SPAN
3992 field. If you use an exotic browser, you might want to try it out to be sure.
3995 > This setting also has no effect on cookies that may have been stored
3996 previously by the browser before starting <SPAN
4000 These would have to be removed manually.
4008 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4009 >content-cookies filter</A
4011 to block some types of cookies. Content cookies are not effected by
4014 >session-cookies-only</TT
4030 >+session-cookies-only</PRE
4045 NAME="SET-IMAGE-BLOCKER"
4047 >8.5.20. set-image-blocker</H4
4051 CLASS="VARIABLELIST"
4057 >Choose the replacement for blocked images</P
4063 > This action alone doesn't do anything noticeable. If <SPAN
4073 HREF="actions-file.html#BLOCK"
4085 HREF="actions-file.html#HANDLE-AS-IMAGE"
4095 apply, i.e. if the request is to be blocked as an image,
4102 > the parameter of this action decides what will be
4103 sent as a replacement.
4123 > to send a built-in checkerboard pattern image. The image is visually
4124 decent, scales very well, and makes it obvious where banners were busted.
4132 > to send a built-in transparent image. This makes banners disappear
4133 completely, but makes it hard to detect where <SPAN
4137 images on a given page and complicates troubleshooting if <SPAN
4141 has blocked innocent images, like navigation icons.
4155 send a redirect to <TT
4161 to any image anywhere, even in your local filesystem (via <SPAN
4167 > A good application of redirects is to use special <SPAN
4171 URLs, which send the built-in images, as <TT
4177 This has the same visual effect as specifying <SPAN
4184 the first place, but enables your browser to cache the replacement image, instead of requesting
4185 it over and over again.
4194 > The URLs for the built-in images are <SPAN
4196 >"http://config.privoxy.org/send-banner?type=<TT
4217 > There is a third (advanced) type, called <SPAN
4229 >set-image-blocker</TT
4230 >, but meant for use from <A
4231 HREF="filter-file.html"
4234 Auto will select the type of image that would have applied to the referring page, had it been an image.
4252 >+set-image-blocker{pattern}</PRE
4259 > Redirect to the BSD devil:
4270 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
4277 > Redirect to the built-in pattern for better caching:
4288 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
4305 >8.5.21. Summary</H3
4307 > Note that many of these actions have the potential to cause a page to
4308 misbehave, possibly even not to display at all. There are many ways
4309 a site designer may choose to design his site, and what HTTP header
4310 content, and other criteria, he may depend on. There is no way to have hard
4311 and fast rules for all sites. See the <A
4312 HREF="appendix.html#ACTIONSANAT"
4314 > for a brief example on troubleshooting
4337 >, can be defined by combining other actions.
4338 These can in turn be invoked just like the built-in actions.
4339 Currently, an alias name can contain any character except space, tab,
4357 > that you only use <SPAN
4377 Alias names are not case sensitive, and are not required to start with a
4384 > sign, since they are merely textually
4387 > Aliases can be used throughout the actions file, but they <SPAN
4392 defined in a special section at the top of the file!</I
4395 And there can only be one such section per actions file. Each actions file may
4396 have its own alias section, and the aliases defined in it are only visible
4397 within that file.</P
4399 > There are two main reasons to use aliases: One is to save typing for frequently
4400 used combinations of actions, the other one is a gain in flexibility: If you
4401 decide once how you want to handle shops by defining an alias called
4405 >, you can later change your policy on shops in
4412 > place, and your changes will take effect everywhere
4413 in the actions file where the <SPAN
4416 > alias is used. Calling aliases
4417 by their purpose also makes your actions files more readable.</P
4419 > Currently, there is one big drawback to using aliases, though:
4423 >'s built-in web-based action file
4424 editor honors aliases when reading the actions files, but it expands
4425 them before writing. So the effects of your aliases are of course preserved,
4426 but the aliases themselves are lost when you edit sections that use aliases
4428 This is likely to change in future versions of <SPAN
4433 > Now let's define some aliases...</P
4443 > # Useful custom aliases we can use later.
4445 # Note the (required!) section header line and that this section
4446 # must be at the top of the actions file!
4450 # These aliases just save typing later:
4451 # (Note that some already use other aliases!)
4453 +crunch-all-cookies = +<A
4454 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4455 >crunch-incoming-cookies</A
4457 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4458 >crunch-outgoing-cookies</A
4460 -crunch-all-cookies = -<A
4461 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4462 >crunch-incoming-cookies</A
4464 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4465 >crunch-outgoing-cookies</A
4467 block-as-image = +block +handle-as-image
4468 mercy-for-cookies = -crunch-all-cookies -<A
4469 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4470 >session-cookies-only</A
4472 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4473 >filter{content-cookies}</A
4476 # These aliases define combinations of actions
4477 # that are useful for certain types of sites:
4480 HREF="actions-file.html#BLOCK"
4483 HREF="actions-file.html#FILTER"
4485 > -crunch-all-cookies -<A
4486 HREF="actions-file.html#FAST-REDIRECTS"
4489 HREF="actions-file.html#HIDE-REFERER"
4492 HREF="actions-file.html#KILL-POPUPS"
4495 shop = -crunch-all-cookies -<A
4496 HREF="actions-file.html#FILTER-ALL-POPUPS"
4497 >filter{all-popups}</A
4499 HREF="actions-file.html#KILL-POPUPS"
4503 # Short names for other aliases, for really lazy people ;-)
4505 c0 = +crunch-all-cookies
4506 c1 = -crunch-all-cookies</PRE
4512 > ...and put them to use. These sections would appear in the lower part of an
4513 actions file and define exceptions to the default actions (as specified further
4527 > # These sites are either very complex or very keen on
4528 # user data and require minimal interference to work:
4531 .office.microsoft.com
4532 .windowsupdate.microsoft.com
4536 # Allow cookies (for setting and retrieving your customer data)
4540 .worldpay.com # for quietpc.com
4543 # These shops require pop-ups:
4545 {shop -kill-popups -filter{all-popups}}
4547 .overclockers.co.uk</PRE
4553 > Aliases like <SPAN
4559 > are often used for
4563 > sites that require some actions to be disabled
4564 in order to function properly.</P
4573 >8.7. Actions Files Tutorial</H2
4575 > The above chapters have shown <A
4576 HREF="actions-file.html"
4577 >which actions files
4578 there are and how they are organized</A
4579 >, how actions are <A
4580 HREF="actions-file.html#ACTIONS"
4583 HREF="actions-file.html#ACTIONS-APPLY"
4587 HREF="actions-file.html#AF-PATTERNS"
4591 HREF="actions-file.html#ALIASES"
4593 >. Now, let's look at an
4601 file and see how all these pieces come together:</P
4609 >8.7.1. default.action</H3
4611 >Every config file should start with a short comment stating its purpose:</P
4621 ># Sample default.action file <developers@privoxy.org></PRE
4627 >Then, since this is the <TT
4631 first section is a special section for internal use that you needn't
4632 change or worry about:</P
4642 >##########################################################################
4643 # Settings -- Don't change! For internal Privoxy use ONLY.
4644 ##########################################################################
4647 for-privoxy-version=3.0</PRE
4653 >After that comes the (optional) alias section. We'll use the example
4654 section from the above <A
4655 HREF="actions-file.html#ALIASES"
4656 >chapter on aliases</A
4658 that also explains why and how aliases are used:</P
4668 >##########################################################################
4670 ##########################################################################
4673 # These aliases just save typing later:
4674 # (Note that some already use other aliases!)
4676 +crunch-all-cookies = +<A
4677 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4678 >crunch-incoming-cookies</A
4680 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4681 >crunch-outgoing-cookies</A
4683 -crunch-all-cookies = -<A
4684 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4685 >crunch-incoming-cookies</A
4687 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4688 >crunch-outgoing-cookies</A
4690 block-as-image = +block +handle-as-image
4691 mercy-for-cookies = -crunch-all-cookies -<A
4692 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4693 >session-cookies-only</A
4695 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4696 >filter{content-cookies}</A
4699 # These aliases define combinations of actions
4700 # that are useful for certain types of sites:
4703 HREF="actions-file.html#BLOCK"
4706 HREF="actions-file.html#FILTER"
4708 > -crunch-all-cookies -<A
4709 HREF="actions-file.html#FAST-REDIRECTS"
4712 HREF="actions-file.html#HIDE-REFERER"
4715 HREF="actions-file.html#KILL-POPUPS"
4718 shop = -crunch-all-cookies -<A
4719 HREF="actions-file.html#FILTER-ALL-POPUPS"
4720 >filter{all-popups}</A
4722 HREF="actions-file.html#KILL-POPUPS"
4730 > Now come the regular sections, i.e. sets of actions, accompanied
4731 by URL patterns to which they apply. Remember <SPAN
4736 are disabled when matching starts</I
4738 >, so we have to explicitly
4739 enable the ones we want.</P
4741 > The first regular section is probably the most important. It has only
4750 HREF="actions-file.html#AF-PATTERNS"
4751 >matches all URLs</A
4753 set of actions used in this <SPAN
4761 be applied to all requests as a start</I
4763 >. It can be partly or
4764 wholly overridden by later matches further down this file, or in user.action,
4765 but it will still be largely responsible for your overall browsing
4768 > Again, at the start of matching, all actions are disabled, so there is
4769 no real need to disable any actions here, but we will do that nonetheless,
4770 to have a complete listing for your reference. (Remember: a <SPAN
4774 preceding the action name enables the action, a <SPAN
4778 Also note how this long line has been made more readable by splitting it into
4779 multiple lines with line continuation.</P
4789 >##########################################################################
4790 # "Defaults" section:
4791 ##########################################################################
4794 HREF="actions-file.html#ADD-HEADER"
4798 HREF="actions-file.html#BLOCK"
4802 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4803 >crunch-incoming-cookies</A
4806 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4807 >crunch-outgoing-cookies</A
4810 HREF="actions-file.html#DEANIMATE-GIFS"
4814 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
4815 >downgrade-http-version</A
4818 HREF="actions-file.html#FAST-REDIRECTS"
4822 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
4823 >filter{js-annoyances}</A
4826 HREF="actions-file.html#FILTER-JS-EVENTS"
4827 >filter{js-events}</A
4830 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
4831 >filter{html-annoyances}</A
4834 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4835 >filter{content-cookies}</A
4838 HREF="actions-file.html#FILTER-REFRESH-TAGS"
4839 >filter{refresh-tags}</A
4842 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
4843 >filter{unsolicited-popups}</A
4846 HREF="actions-file.html#FILTER-ALL-POPUPS"
4847 >filter{all-popups}</A
4850 HREF="actions-file.html#FILTER-IMG-REORDER"
4851 >filter{img-reorder}</A
4854 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
4855 >filter{banners-by-size}</A
4858 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
4859 >filter{banners-by-link}</A
4862 HREF="actions-file.html#FILTER-WEBBUGS"
4866 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
4867 >filter{tiny-textforms}</A
4870 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
4871 >filter{jumping-windows}</A
4874 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
4875 >filter{frameset-borders}</A
4878 HREF="actions-file.html#FILTER-DEMORONIZER"
4879 >filter{demoronizer}</A
4882 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
4883 >filter{shockwave-flash}</A
4886 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
4887 >filter{quicktime-kioskmode}</A
4890 HREF="actions-file.html#FILTER-FUN"
4894 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
4895 >filter{crude-parental}</A
4898 HREF="actions-file.html#FILTER-IE-EXPLOITS"
4899 >filter{ie-exploits}</A
4902 HREF="actions-file.html#HANDLE-AS-IMAGE"
4906 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
4907 >hide-forwarded-for-headers</A
4910 HREF="actions-file.html#HIDE-FROM-HEADER"
4911 >hide-from-header{block}</A
4914 HREF="actions-file.html#HIDE-REFERER"
4915 >hide-referrer{forge}</A
4918 HREF="actions-file.html#HIDE-USER-AGENT"
4922 HREF="actions-file.html#KILL-POPUPS"
4926 HREF="actions-file.html#LIMIT-CONNECT"
4930 HREF="actions-file.html#PREVENT-COMPRESSION"
4931 >prevent-compression</A
4934 HREF="actions-file.html#SEND-VANILLA-WAFER"
4935 >send-vanilla-wafer</A
4938 HREF="actions-file.html#SEND-WAFER"
4942 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4943 >session-cookies-only</A
4946 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4947 >set-image-blocker{pattern}</A
4950 / # forward slash will match *all* potential URL patterns.</PRE
4956 > The default behavior is now set. Note that some actions, like not hiding
4957 the user agent, are part of a <SPAN
4959 >"general policy"</SPAN
4961 universally and won't get any exceptions defined later. Other choices,
4962 like not blocking (which is <SPAN
4969 default!) need exceptions, i.e. we need to specify explicitly what we
4970 want to block in later sections.</P
4972 > The first of our specialized sections is concerned with <SPAN
4976 sites, i.e. sites that require minimum interference, because they are either
4977 very complex or very keen on tracking you (and have mechanisms in place that
4978 make them unusable for people who avoid being tracked). We will simply use
4982 > alias instead of stating the list
4983 of actions explicitly:</P
4993 >##########################################################################
4994 # Exceptions for sites that'll break under the default action set:
4995 ##########################################################################
4997 # "Fragile" Use a minimum set of actions for these sites (see alias above):
5000 .office.microsoft.com # surprise, surprise!
5001 .windowsupdate.microsoft.com</PRE
5007 > Shopping sites are not as fragile, but they typically
5008 require cookies to log in, and pop-up windows for shopping
5009 carts or item details. Again, we'll use a pre-defined alias:</P
5023 .worldpay.com # for quietpc.com
5034 HREF="actions-file.html#FAST-REDIRECTS"
5038 action, which we enabled per default above, breaks some sites. So disable
5039 it for popular sites where we know it misbehaves:</P
5050 HREF="actions-file.html#FAST-REDIRECTS"
5056 .altavista.com/.*(like|url|link):http
5057 .altavista.com/trans.*urltext=http
5064 > It is important that <SPAN
5068 URLs belong to images, so that <SPAN
5075 be blocked, a substitute image can be sent, rather than an HTML page.
5076 Contacting the remote site to find out is not an option, since it
5077 would destroy the loading time advantage of banner blocking, and it
5078 would feed the advertisers (in terms of money <SPAN
5085 information). We can mark any URL as an image with the <TT
5088 HREF="actions-file.html#HANDLE-AS-IMAGE"
5092 and marking all URLs that end in a known image file extension is a
5103 >##########################################################################
5105 ##########################################################################
5107 # Define which file types will be treated as images, in case they get
5108 # blocked further down this file:
5111 HREF="actions-file.html#HANDLE-AS-IMAGE"
5114 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
5120 > And then there are known banner sources. They often use scripts to
5121 generate the banners, so it won't be visible from the URL that the
5122 request is for an image. Hence we block them <SPAN
5129 mark them as images in one go, with the help of our
5133 > alias defined above. (We could of
5134 course just as well use <TT
5137 HREF="actions-file.html#BLOCK"
5141 HREF="actions-file.html#HANDLE-AS-IMAGE"
5145 Remember that the type of the replacement image is chosen by the
5149 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5150 >set-image-blocker</A
5153 action. Since all URLs have matched the default section with its
5157 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5158 >set-image-blocker</A
5161 action before, it still applies and needn't be repeated:</P
5171 ># Known ad generators:
5176 .ad.*.doubleclick.net
5177 .a.yimg.com/(?:(?!/i/).)*$
5178 .a[0-9].yimg.com/(?:(?!/i/).)*$
5187 > One of the most important jobs of <SPAN
5191 is to block banners. A huge bunch of them are already <SPAN
5198 HREF="actions-file.html#FILTER"
5200 >{banners-by-size}</TT
5202 action, which we enabled above, and which deletes the references to banner
5203 images from the pages while they are loaded, so the browser doesn't request
5204 them anymore, and hence they don't need to be blocked here. But this naturally
5205 doesn't catch all banners, and some people choose not to use filters, so we
5206 need a comprehensive list of patterns for banner URLs here, and apply the
5210 HREF="actions-file.html#BLOCK"
5213 > action to them.</P
5215 > First comes a bunch of generic patterns, which do most of the work, by
5216 matching typical domain and path name components of banners. Then comes
5217 a list of individual patterns for specific sites, which is omitted here
5218 to keep the example short:</P
5228 >##########################################################################
5229 # Block these fine banners:
5230 ##########################################################################
5232 HREF="actions-file.html#BLOCK"
5242 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
5243 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
5245 # Site-specific patterns (abbreviated):
5253 > You wouldn't believe how many advertisers actually call their banner
5259 >.com, or call the directory
5260 in which the banners are stored simply <SPAN
5264 generic patterns are surprisingly effective.</P
5266 > But being very generic, they necessarily also catch URLs that we don't want
5267 to block. The pattern <TT
5279 >.nasty-corp.com"</SPAN
5289 >.sourcefroge.net"</SPAN
5299 >l.some-provider.net."</SPAN
5301 well-known exceptions to the <TT
5304 HREF="actions-file.html#BLOCK"
5310 > Note that these are exceptions to exceptions from the default! Consider the URL
5313 >"downloads.sourcefroge.net"</SPAN
5314 >: Initially, all actions are deactivated,
5315 so it wouldn't get blocked. Then comes the defaults section, which matches the
5316 URL, but just deactivates the <TT
5319 HREF="actions-file.html#BLOCK"
5323 action once again. Then it matches <TT
5326 >, an exception to the
5327 general non-blocking policy, and suddenly
5331 HREF="actions-file.html#BLOCK"
5334 > applies. And now, it'll match
5341 HREF="actions-file.html#BLOCK"
5345 applies, so (unless it matches <SPAN
5351 > further down) it ends up
5355 HREF="actions-file.html#BLOCK"
5358 > action applying.</P
5368 >##########################################################################
5369 # Save some innocent victims of the above generic block patterns:
5370 ##########################################################################
5375 HREF="actions-file.html#BLOCK"
5378 adv[io]*. # (for advogato.org and advice.*)
5379 adsl. # (has nothing to do with ads)
5380 ad[ud]*. # (adult.* and add.*)
5381 .edu # (universities don't host banners (yet!))
5382 .*loads. # (downloads, uploads etc)
5390 www.globalintersec.com/adv # (adv = advanced)
5391 www.ugu.com/sui/ugu/adv</PRE
5397 > Filtering source code can have nasty side effects,
5398 so make an exception for our friends at sourceforge.net,
5399 and all paths with <SPAN
5402 > in them. Note that
5406 HREF="actions-file.html#FILTER"
5416 > filters in one fell swoop!</P
5426 ># Don't filter code!
5429 HREF="actions-file.html#FILTER"
5433 .sourceforge.net</PRE
5443 comprehensive, but we hope this example made clear how it works.</P
5452 >8.7.2. user.action</H3
5454 > So far we are painting with a broad brush by setting general policies,
5455 which would be a reasonable starting point for many people. Now,
5456 you might want to be more specific and have customized rules that
5457 are more suitable to your personal habits and preferences. These would
5458 be for narrowly defined situations like your ISP or your bank, and should
5462 >, which is parsed after all other
5463 actions files and hence has the last word, over-riding any previously
5464 defined actions. <TT
5474 > place for your personal settings, since
5478 > is actively maintained by the
5482 > developers and you'll probably want
5483 to install updated versions from time to time.</P
5485 > So let's look at a few examples of things that one might typically do in
5499 ># My user.action file. <fred@foobar.com></PRE
5506 HREF="actions-file.html#ALIASES"
5508 > are local to the actions
5509 file that they are defined in, you can't use the ones from
5513 >, unless you repeat them here:</P
5523 ># Aliases are local to the file they are defined in.
5524 # (Re-)define aliases for this file:
5528 # These aliases just save typing later, and the alias names should
5529 # be self explanatory.
5531 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5532 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5533 allow-all-cookies = -crunch-all-cookies -session-cookies-only
5534 allow-popups = -filter{all-popups} -kill-popups
5535 +block-as-image = +block +handle-as-image
5536 -block-as-image = -block
5538 # These aliases define combinations of actions that are useful for
5539 # certain types of sites:
5541 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -kill-popups
5542 shop = -crunch-all-cookies allow-popups
5544 # Allow ads for selected useful free sites:
5546 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}</PRE
5554 > Say you have accounts on some sites that you visit regularly, and
5555 you don't want to have to log in manually each time. So you'd like
5556 to allow persistent cookies for these sites. The
5559 >allow-all-cookies</TT
5560 > alias defined above does exactly
5561 that, i.e. it disables crunching of cookies in any direction, and the
5562 processing of cookies to make them only temporary.</P
5572 >{ allow-all-cookies }
5583 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
5594 HREF="actions-file.html#FILTER"
5597 .your-home-banking-site.com</PRE
5603 > Some file types you may not want to filter.
5607 > makes no distinctions between regular web
5608 pages and downloads done via your web browser if it is an html or text type
5619 ># A list of common file extensions that are likely to indicate raw text, and best
5621 /(.*/)?.*\.(pl|(s|p)?h|c(c|xx|pp)?|tcl|am|init?|cfg?|conf(ig)?|txt|rc|bat)$
5623 # Documentation should not need filtering (at least on some sites).
5630 > Example of a simple <A
5631 HREF="actions-file.html#BLOCK"
5633 > action. Say you've
5634 seen an ad on your favourite page on example.com that you want to get rid of.
5635 You have right-clicked the image, selected <SPAN
5637 >"copy image location"</SPAN
5639 and pasted the URL below while removing the leading http://, into a
5643 > section. Note that <TT
5647 > need not be specified, since all URLs ending in
5651 > will be tagged as images by the general rules as set
5652 in default.action anyway:</P
5663 HREF="actions-file.html#BLOCK"
5666 www.example.com/nasty-ads/sponsor.gif
5667 another.popular.site.net/more/junk/here/
5669 # Here we found one that is not in <SPAN
5672 > default blocked list:
5679 > To force URLs that tend to have ad images, but it is difficult for
5683 > to know this since the ultimate returned
5684 object is obscured for one reason or another, we can try to force these to be
5685 treated as images (and thus avoid <SPAN
5692 > banner page). Note that if what is returned by the
5693 server turns out NOT to be an image, then your browser typically will display
5694 a broken icon image. Use cautiously.</P
5704 >{ +block-as-image }
5705 # A shockwave ad, very annoying.
5715 > Now you noticed that the default configuration breaks Forbes Magazine,
5716 but you were too lazy to find out which action is the culprit, and you
5717 were again too lazy to give <A
5721 you just used the <TT
5724 > alias on the site, and
5731 > -- it worked. The <TT
5735 aliases disables those actions that are most likely to break a site. Also,
5736 good for testing purposes to see if it is <SPAN
5740 that is causing the problem or not.</P
5757 > You like the <SPAN
5760 > text replacements in <TT
5764 but it is disabled in the distributed actions file. (My colleagues on the team just
5765 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
5766 update-safe config, once and for all:</P
5777 HREF="actions-file.html#FILTER-FUN"
5780 / # For ALL sites!</PRE
5786 > Note that the above is not really a good idea: There are exceptions
5787 to the filters in <TT
5791 really shouldn't be filtered, like code on CVS->Web interfaces. Since
5795 > has the last word, these exceptions
5796 won't be valid for the <SPAN
5799 > filtering specified here.</P
5801 > You might also worry about how your favourite free websites are
5802 funded, and find that they rely on displaying banner advertisements
5803 to survive. So you might want to specifically allow banners for those
5804 sites that you feel provide value to you:</P
5826 > has been aliased to
5830 HREF="actions-file.html#BLOCK"
5837 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
5838 >filter{banners-by-size}</A
5844 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
5845 >filter{banners-by-link}</A
5852 > is generally the best place to define
5853 exceptions and additions to the default policies of
5857 >. Some actions are safe to have their
5858 default policies set here though. So let's set a default policy to have a
5862 > image as opposed to the checkerboard pattern for
5872 > of course matches all URL
5873 paths and patterns:</P
5884 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5885 >set-image-blocker{blank}</A
5900 SUMMARY="Footer navigation table"
5929 HREF="filter-file.html"
5939 >The Main Configuration File</TD
5949 >The Filter File</TD