7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="Privoxy 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 User Manual</TH
62 HREF="filter-file.html"
76 NAME="ACTIONS-FILE">8. Actions Files</H1
78 > The actions files are used to define what actions
82 > takes for which URLs, and thus determine
83 how ad images, cookies and various other aspects of HTTP content and
84 transactions are handled, and on which sites (or even parts thereof). There
85 are three such files included with <SPAN
89 version 2.9.15), with differing purposes:
100 > - is the primary action file
101 that sets the initial values for all actions. It is intended to
102 provide a base level of functionality for
106 > array of features. So it is
107 a set of broad rules that should work reasonably well for users everywhere.
108 This is the file that the developers are keeping updated, and making
117 > - is intended to be for local site
118 preferences and exceptions. As an example, if your ISP or your bank
119 has specific requirements, and need special handling, this kind of
120 thing should go here. This file will not be upgraded.
128 > - is used by the web based editor,
129 to set various pre-defined sets of rules for the default actions section
133 >. These have increasing levels of
138 >and have no influence on your browsing unless
139 you select them explicitly in the editor</I
141 >. It is not recommend
149 > The list of actions files to be used are defined in the main configuration
150 file, and are processed in the order they are defined. The content of these
151 can all be viewed and edited from <A
152 HREF="http://config.privoxy.org/show-status"
154 >http://config.privoxy.org/show-status</A
157 > An actions file typically has multiple sections. If you want to use
161 > in an actions file, you have to place the (optional)
163 HREF="actions-file.html#ALIASES"
165 > at the top of that file.
166 Then comes the default set of rules which will apply universally to all
167 sites and pages (be <SPAN
177 > or any other actions file after
181 >, because it will override the result
182 from consulting any previous file). And then below that,
183 exceptions to the defined universal policies. You can regard
187 > as an appendix to <TT
191 with the advantage that is a separate file, which makes preserving your
192 personal settings across <SPAN
195 > upgrades easier.</P
198 Actions can be used to block anything you want, including ads, banners, or
199 just some obnoxious URL that you would rather not see. Cookies can be accepted
200 or rejected, or accepted only during the current browser session (i.e. not
201 written to disk), content can be modified, JavaScripts tamed, user-tracking
202 fooled, and much more. See below for a <A
203 HREF="actions-file.html#ACTIONS"
212 NAME="AEN1584">8.1. Finding the Right Mix</H2
215 HREF="actions-file.html#ACTIONS"
217 >, like cookie suppression
218 or script disabling, may render some sites unusable that rely on these
219 techniques to work properly. Finding the right mix of actions is not always easy and
220 certainly a matter of personal taste. In general, it can be said that the more
224 > your default settings (in the top section of the
225 actions file) are, the more exceptions for <SPAN
229 will have to make later. If, for example, you want to kill popup windows per
230 default, you'll have to make exceptions from that rule for sites that you
231 regularly use and that require popups for actually useful content, like maybe
232 your bank, favorite shop, or newspaper.</P
234 > We have tried to provide you with reasonable rules to start from in the
235 distribution actions files. But there is no general rule of thumb on these
236 things. There just are too many variables, and sites are constantly changing.
237 Sooner or later you will want to change the rules (and read this chapter again :).</P
244 NAME="AEN1591">8.2. How to Edit</H2
246 > The easiest way to edit the actions files is with a browser by
247 using our browser-based editor, which can be reached from <A
248 HREF="http://config.privoxy.org/show-status"
250 >http://config.privoxy.org/show-status</A
252 The editor allows both fine-grained control over every single feature on a
253 per-URL basis, and easy choosing from wholesale sets of defaults like
265 > If you prefer plain text editing to GUIs, you can of course also directly edit the
266 the actions files. Look at <TT
277 NAME="ACTIONS-APPLY">8.3. How Actions are Applied to URLs</H2
279 > Actions files are divided into sections. There are special sections,
283 HREF="actions-file.html#ALIASES"
286 > sections which will
287 be discussed later. For now let's concentrate on regular sections: They have a
288 heading line (often split up to multiple lines for readability) which consist
289 of a list of actions, separated by whitespace and enclosed in curly braces.
290 Below that, there is a list of URL patterns, each on a separate line.</P
292 > To determine which actions apply to a request, the URL of the request is
293 compared to all patterns in each action file file. Every time it matches, the list of
294 applicable actions for the URL is incrementally updated, using the heading
295 of the section in which the pattern is located. If multiple matches for
296 the same URL set the same action differently, the last match wins. If not,
297 the effects are aggregated. E.g. a URL might match a regular section with
298 a heading line of <TT
302 HREF="actions-file.html#HANDLE-AS-IMAGE"
307 then later another one with just <TT
311 HREF="actions-file.html#BLOCK"
322 > actions to apply.</P
324 > You can trace this process for any given URL by visiting <A
325 HREF="http://config.privoxy.org/show-url-info"
327 >http://config.privoxy.org/show-url-info</A
330 > More detail on this is provided in the Appendix, <A
331 HREF="appendix.html#ACTIONSANAT"
332 > Anatomy of an Action</A
340 NAME="AF-PATTERNS">8.4. Patterns</H2
342 > Generally, a pattern has the form <TT
344 ><domain>/<path></TT
348 ><domain></TT
353 are optional. (This is why the pattern <TT
356 > matches all URLs).</P
365 >www.example.com/</TT
369 > is a domain-only pattern and will match any request to <TT
373 regardless of which document on that server is requested.
383 > means exactly the same. For domain-only patterns, the trailing <TT
393 >www.example.com/index.html</TT
397 > matches only the single document <TT
414 > matches the document <TT
417 >, regardless of the domain,
434 > matches nothing, since it would be interpreted as a domain name and
435 there is no top-level domain called <TT
448 NAME="AEN1655">8.4.1. The Domain Pattern</H3
450 > The matching of the domain part offers some flexible options: if the
451 domain starts or ends with a dot, it becomes unanchored at that end.
465 > matches any domain that <SPAN
485 > matches any domain that <SPAN
505 > matches any domain that <SPAN
515 (Correctly speaking: It matches any FQDN that contains <TT
524 > Additionally, there are wild-cards that you can use in the domain names
525 themselves. They work pretty similar to shell wild-cards: <SPAN
529 stands for zero or more arbitrary characters, <SPAN
533 any single character, you can define character classes in square
534 brackets and all of that can be freely mixed:</P
549 >"adserver.example.com"</SPAN
553 >"ads.example.com"</SPAN
556 >"sfads.example.com"</SPAN
563 >*ad*.example.com</TT
567 > matches all of the above, and then some.
583 >pictures.epix.com</TT
586 >a.b.c.d.e.upix.com</TT
593 >www[1-9a-ez].example.c*</TT
599 >www1.example.com</TT
610 >wwwz.example.com</TT
620 >wwww.example.com</TT
632 NAME="AEN1717">8.4.2. The Path Pattern</H3
637 > uses Perl compatible regular expressions
639 HREF="http://www.pcre.org/"
643 matching the path.</P
646 HREF="appendix.html#REGEX"
648 > with a brief quick-start into regular
649 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
651 HREF="http://www.pcre.org/man.txt"
653 >http://www.pcre.org/man.txt</A
655 You might also find the Perl man page on regular expressions (<TT
659 useful, which is available on-line at <A
660 HREF="http://www.perldoc.com/perl5.6/pod/perlre.html"
662 >http://www.perldoc.com/perl5.6/pod/perlre.html</A
665 > Note that the path pattern is automatically left-anchored at the <SPAN
669 i.e. it matches as if it would start with a <SPAN
672 > (regular expression speak
673 for the beginning of a line).</P
675 > Please also note that matching in the path is <SPAN
682 by default, but you can switch to case sensitive at any point in the pattern by using the
688 >www.example.com/(?-i)PaTtErN.*</TT
690 only documents whose path starts with <TT
700 > this capitalization.</P
708 NAME="ACTIONS">8.5. Actions</H2
710 > All actions are disabled by default, until they are explicitly enabled
711 somewhere in an actions file. Actions are turned on if preceded with a
715 >, and turned off if preceded with a <SPAN
724 >"do that action"</SPAN
731 >"please block URLs that match the
732 following patterns"</SPAN
739 block URLs that match the following patterns, even if <TT
743 previously applied."</SPAN
747 Again, actions are invoked by placing them on a line, enclosed in curly braces and
748 separated by whitespace, like in
751 >{+some-action -some-other-action{some-parameter}}</TT
753 followed by a list of URL patterns, one per line, to which they apply.
754 Together, the actions line and the following pattern lines make up a section
755 of the actions file. </P
758 There are three classes of actions:</P
766 Boolean, i.e the action can only be <SPAN
789 > # enable action <TT
800 > # disable action <TT
822 Parameterized, where some value is required in order to enable this type of action.
844 >} # enable action and set parameter to <TT
850 # overwriting parameter from previous match if necessary
856 > # disable action. The parameter can be omitted</PRE
863 > Note that if the URL matches multiple positive forms of a parameterized action,
864 the last match wins, i.e. the params from earlier matches are simply ignored.
870 >+hide-user-agent{ Mozilla 1.0 }</TT
877 Multi-value. These look exactly like parameterized actions,
878 but they behave differently: If the action applies multiple times to the
879 same URL, but with different parameters, <SPAN
892 > matches are remembered. This is used for actions
893 that can be executed for the same request repeatedly, like adding multiple
894 headers, or filtering through multiple filters. Syntax:
915 >} # enable action and add <TT
920 > to the list of parameters
931 >} # remove the parameter <TT
936 > from the list of parameters
937 # If it was the last one left, disable the action.
943 > # disable this action completely and remove all parameters from the list</PRE
953 >+add-header{X-Fun-Header: Some text}</TT
957 >+filter{html-annoyances}</TT
964 > If nothing is specified in any actions file, no <SPAN
968 taken. So in this case <SPAN
972 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
973 privacy and blocking features you need (although the provided default actions
974 files will give a good starting point).</P
976 > Later defined actions always over-ride earlier ones. So exceptions
977 to any rules you make, should come in the latter part of the file (or
978 in a file that is processed later when using multiple actions files). For
979 multi-valued actions, the actions are applied in the order they are specified.
980 Actions files are processed in the order they are defined in
984 > (the default installation has three actions
985 files). It also quite possible for any given URL pattern to match more than
986 one pattern and thus more than one set of actions!</P
988 > The list of valid <SPAN
997 NAME="ADD-HEADER">8.5.1. add-header</H4
1001 CLASS="VARIABLELIST"
1007 >Confuse log analysis, custom applications</P
1013 > Sends a user defined HTTP header to the web server.
1026 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1027 It is recommended that you use the <SPAN
1041 > This action may be specified multiple times, in order to define multiple
1042 headers. This is rarely needed for the typical user. If you don't know what
1045 >"HTTP headers"</SPAN
1046 > are, you definitely don't need to worry about this
1062 >+add-header{X-User-Tracking: sucks}</PRE
1077 NAME="BLOCK">8.5.2. block</H4
1081 CLASS="VARIABLELIST"
1087 >Block ads or other obnoxious content</P
1093 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1094 forwarded to the remote server, but answered locally with a substitute page or image,
1095 as determined by the <TT
1098 HREF="actions-file.html#HANDLE-AS-IMAGE"
1105 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1106 >set-image-blocker</A
1130 > sends a special <SPAN
1134 for requests to blocked pages. This page contains links to find out why the request
1135 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1136 force feature enabled). The <SPAN
1139 > page adapts to the available
1140 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1141 if loaded into a small frame or window. If you are using <SPAN
1145 right now, you can take a look at the
1147 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1158 A very important exception occurs if <SPAN
1171 HREF="actions-file.html#HANDLE-AS-IMAGE"
1175 apply to the same request: it will then be replaced by an image. If
1179 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1180 >set-image-blocker</A
1183 (see below) also applies, the type of image will be determined by its parameter,
1184 if not, the standard checkerboard pattern is sent.
1187 > It is important to understand this process, in order
1188 to understand how <SPAN
1192 ads and other unwanted content.
1198 HREF="actions-file.html#FILTER"
1202 action can perform a very similar task, by <SPAN
1206 banner images and other content through rewriting the relevant URLs in the
1207 document's HTML source, so they don't get requested in the first place.
1208 Note that this is a totally different technique, and it's easy to confuse the two.
1212 >Example usage (section):</DT
1223 >{+block} # Block and replace with "blocked" page
1224 .nasty-stuff.example.com
1226 {+block +handle-as-image} # Block and replace with image
1243 NAME="CRUNCH-INCOMING-COOKIES">8.5.3. crunch-incoming-cookies</H4
1247 CLASS="VARIABLELIST"
1253 > Prevent the web server from setting any cookies on your system
1262 >"Set-Cookie:"</SPAN
1263 > HTTP headers from server replies.
1283 > This action is only concerned with <SPAN
1300 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
1301 >crunch-outgoing-cookies</A
1310 > to disable cookies completely.
1319 > to use this action in conjunction
1323 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1324 >session-cookies-only</A
1327 since it would prevent the session cookies from being set.
1342 >+crunch-incoming-cookies</PRE
1357 NAME="CRUNCH-OUTGOING-COOKIES">8.5.4. crunch-outgoing-cookies</H4
1361 CLASS="VARIABLELIST"
1367 > Prevent the web server from reading any cookies from your system
1377 > HTTP headers from client requests.
1397 > This action is only concerned with <SPAN
1414 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
1415 >crunch-incoming-cookies</A
1424 > to disable cookies completely.
1433 > to use this action in conjunction
1437 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1438 >session-cookies-only</A
1441 since it would prevent the session cookies from being read.
1456 >+crunch-outgoing-cookies</PRE
1471 NAME="DEANIMATE-GIFS">8.5.5. deanimate-gifs</H4
1475 CLASS="VARIABLELIST"
1481 >Stop those annoying, distracting animated GIF images.</P
1487 > De-animate GIF animations, i.e. reduce them to their first or last image.
1513 > This will also shrink the images considerably (in bytes, not pixels!). If
1517 > is given, the first frame of the animation
1518 is used as the replacement. If <SPAN
1521 > is given, the last
1522 frame of the animation is used instead, which probably makes more sense for
1523 most banner animations, but also has the risk of not showing the entire
1524 last frame (if it is only a delta to an earlier frame).
1527 > You can safely use this action with patterns that will also match non-GIF
1528 objects, because no attempt will be made at anything that doesn't look like
1544 >+deanimate-gifs{last}</PRE
1559 NAME="DOWNGRADE-HTTP-VERSION">8.5.6. downgrade-http-version</H4
1563 CLASS="VARIABLELIST"
1569 >Work around (very rare) problems with HTTP/1.1</P
1575 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
1595 > This is a left-over from the time when <SPAN
1599 didn't support important HTTP/1.1 features well. It is left here for the
1600 unlikely case that you experience HTTP/1.1 related problems with some server
1601 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
1602 is a chance you might need this action.
1606 >Example usage (section):</DT
1617 >{+downgrade-http-version}
1618 problem-host.example.com</PRE
1633 NAME="FAST-REDIRECTS">8.5.7. fast-redirects</H4
1637 CLASS="VARIABLELIST"
1643 >Fool some click-tracking scripts and speed up indirect links</P
1649 > Cut off all but the last valid URL from requests.
1670 Many sites, like yahoo.com, don't just link to other sites. Instead, they
1671 will link to some script on their own servers, giving the destination as a
1672 parameter, which will then redirect you to the final target. URLs
1673 resulting from this scheme typically look like:
1678 >http://some.place/click-tracker.cgi?target=http://some.where.else</I
1683 > Sometimes, there are even multiple consecutive redirects encoded in the
1684 URL. These redirections via scripts make your web browsing more traceable,
1685 since the server from which you follow such a link can see where you go
1686 to. Apart from that, valuable bandwidth and time is wasted, while your
1687 browser ask the server for one redirect after the other. Plus, it feeds
1691 > This feature is currently not very smart and is scheduled for improvement.
1692 It is likely to break some sites. You should expect to need possibly
1693 many exceptions to this action, if it is enabled by default in
1697 >. Some sites just don't work without
1713 >{+fast-redirects}</PRE
1728 NAME="FILTER">8.5.8. filter</H4
1732 CLASS="VARIABLELIST"
1738 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
1744 > Text documents, including HTML and JavaScript, to which this action
1745 applies, are filtered on-the-fly through the specified regular expression
1746 based substitutions.
1759 > The name of a filter, as defined in the <A
1760 HREF="filter-file.html"
1770 HREF="config.html#FILTERFILE"
1778 can be completely disabled without the use of parameters. Example:
1797 > Disables filters for that site.
1804 > For your convenience, there are a number of pre-defined filters available
1805 in the distribution filter file that you can use. See the examples below for
1809 > This is potentially a very powerful feature! But <SPAN
1811 >"rolling your own"</SPAN
1813 filters requires a knowledge of regular expressions and HTML.
1816 > Filtering requires buffering the page content, which may appear to
1817 slow down page rendering since nothing is displayed until all content has
1818 passed the filters. (It does not really take longer, but seems that way
1819 since the page is not incrementally displayed.) This effect will be more
1820 noticeable on slower connections.
1823 > The amount of data that can be filtered is limited to the
1827 HREF="config.html#BUFFER-LIMIT"
1831 option in the main <A
1835 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
1836 data, and all pending data, is passed through unfiltered.
1839 > At this time, <SPAN
1842 > cannot (yet!) uncompress compressed
1843 documents. If you want filtering to work on all documents, even those that
1844 would normally be sent compressed, use the
1848 HREF="actions-file.html#PREVENT-COMPRESSION"
1849 >prevent-compression</A
1852 action in conjunction with <TT
1858 > Filtering can achieve some of the same effects as the
1862 HREF="actions-file.html#BLOCK"
1866 action, i.e. it can be used to block ads and banners. But the mechanism
1867 works quite differently. One effective use, is to block ad banners
1868 based on their size (see below), since many of these seem to be somewhat
1875 > with suggestions for new or
1876 improved filters is particularly welcome!
1880 >Example usage (with filters from the distribution <TT
1887 NAME="FILTER-HTML-ANNOYANCES"
1898 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse.</PRE
1906 NAME="FILTER-JS-ANNOYANCES"
1917 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
1925 NAME="FILTER-BANNERS-BY-SIZE"
1936 >+filter{banners-by-size} # Kill banners based on their size for this page (<SPAN
1950 NAME="FILTER-CONTENT-COOKIES"
1961 >+filter{content-cookies} # Kill cookies that come sneaking in the HTML or JS content</PRE
1969 NAME="FILTER-POPUPS"
1980 >+filter{popups} # Kill all popups in JS and HTML</PRE
1988 NAME="FILTER-WEBBUGS"
1999 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
2018 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
2026 NAME="FILTER-FRAMESET-BORDERS"
2037 >+filter{frameset-borders} # Give frames a border and make them resizeable</PRE
2045 NAME="FILTER-REFRESH-TAGS"
2056 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
2075 >+filter{nimda} # Remove Nimda (virus) code.</PRE
2083 NAME="FILTER-SHOCKWAVE-FLASH"
2094 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
2102 NAME="FILTER-CRUDE-PARENTAL"
2113 >+filter{crude-parental} # Kill all web pages that contain the words "sex" or "warez"</PRE
2128 NAME="HANDLE-AS-IMAGE">8.5.9. handle-as-image</H4
2132 CLASS="VARIABLELIST"
2138 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
2142 >if they get blocked</I
2150 > This action alone doesn't do anything noticeable. It just marks URLs as images.
2154 HREF="actions-file.html#BLOCK"
2164 the presence or absence of this mark decides whether an HTML <SPAN
2168 page, or a replacement image (as determined by the <TT
2171 HREF="actions-file.html#SET-IMAGE-BLOCKER"
2172 >set-image-blocker</A
2174 > action) will be sent to the
2175 client as a substitute for the blocked content.
2195 > The below generic example section is actually part of <TT
2199 It marks all URLs with well-known image file name extensions as images and should
2203 > Users will probably only want to use the handle-as-image action in conjunction with
2207 HREF="actions-file.html#BLOCK"
2210 >, to block sources of banners, whose URLs don't
2211 reflect the file type, like in the second example section.
2214 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
2215 frames require an HTML page to be sent, or they won't display properly.
2218 >handle-as-image</TT
2219 > in this situation will not replace the
2220 ad frame with an image, but lead to error messages.
2224 >Example usage (sections):</DT
2235 ># Generic image extensions:
2238 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2240 # These don't look like images, but they're banners and should be
2241 # blocked as images:
2243 {+block +handle-as-image}
2244 some.nasty-banner-server.com/junk.cgi?output=trash
2246 # Banner source! Who cares if they also have non-image content?
2247 ad.doubleclick.net </PRE
2262 NAME="HIDE-FORWARDED-FOR-HEADERS">8.5.10. hide-forwarded-for-headers</H4
2266 CLASS="VARIABLELIST"
2272 >Improve privacy by hiding the true source of the request</P
2278 > Deletes any existing <SPAN
2280 >"X-Forwarded-for:"</SPAN
2281 > HTTP header from client requests,
2282 and prevents adding a new one.
2302 > It is fairly safe to leave this on.
2305 > This action is scheduled for improvement: It should be able to generate forged
2308 >"X-Forwarded-for:"</SPAN
2309 > headers using random IP addresses from a specified network,
2310 to make successive requests from the same client look like requests from a pool of different
2311 users sharing the same proxy.
2326 >+hide-forwarded-for-headers</PRE
2341 NAME="HIDE-FROM-HEADER">8.5.11. hide-from-header</H4
2345 CLASS="VARIABLELIST"
2351 >Keep your (old and ill) browser from telling web servers your email address</P
2357 > Deletes any existing <SPAN
2360 > HTTP header, or replaces it with the
2377 >, or any user defined value.
2387 > will completely remove the header
2388 (not to be confused with the <TT
2391 HREF="actions-file.html#BLOCK"
2398 > Alternately, you can specify any value you prefer to be sent to the web
2399 server. If you do, it is a matter of fairness not to use any address that
2400 is actually used by a real person.
2403 > This action is rarely needed, as modern web browsers don't send
2422 >+hide-from-header{block}</PRE
2435 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
2450 NAME="HIDE-REFERRER">8.5.12. hide-referrer</H4
2457 CLASS="VARIABLELIST"
2463 >Conceal which link you followed to get to a particular site</P
2472 > (sic) HTTP header from the client request,
2473 or replaces it with a forged one.
2493 > to delete the header completely.</P
2500 > to pretend to be coming from the homepage of the server we are talking to.</P
2504 >Any other string to set a user defined referrer.</P
2515 > is the preferred option here, since some servers will
2516 not send images back otherwise, in an attempt to prevent their valuable
2517 content from being embedded elsewhere (and hence, without being surrounded
2531 > is an alternate spelling of
2535 > and the two can be can be freely
2536 substituted with each other. (<SPAN
2540 correct English spelling, however the HTTP specification has a bug - it
2541 requires it to be spelled as <SPAN
2559 >+hide-referrer{forge}</PRE
2572 >+hide-referrer{http://www.yahoo.com/}</PRE
2587 NAME="HIDE-USER-AGENT">8.5.13. hide-user-agent</H4
2591 CLASS="VARIABLELIST"
2597 >Conceal your type of browser and client operating system</P
2603 > Replaces the value of the <SPAN
2605 >"User-Agent:"</SPAN
2607 in client requests with the specified value.
2620 > Any user-defined string.
2645 > This breaks many web sites that depend on looking at this header in order
2646 to customize their content for different browsers (which, by the
2654 HREF="http://www.javascriptkit.com/javaindex.shtml"
2665 > Using this action in multi-user setups or wherever different types of
2666 browsers will access the same <SPAN
2676 >. In single-user, single-browser
2677 setups, you might use it to delete your OS version information from
2678 the headers, because it is an invitation to exploit known bugs for your
2679 OS. It is also occasionally useful to forge this in order to access
2680 sites that won't let you in otherwise (though there may be a good
2681 reason in some cases). Example of this: some MSN sites will not
2685 > enter, yet forging to a
2689 > user-agent works just fine.
2690 (Must be just a silly MS goof, I'm sure :-).
2693 > This action is scheduled for improvement.
2708 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
2723 NAME="KILL-POPUPS">8.5.14. kill-popups<A
2730 CLASS="VARIABLELIST"
2736 >Eliminate those annoying pop-up windows</P
2742 > While loading the document, replace JavaScript code that opens
2743 pop-up windows with (syntactically neutral) dummy code on the fly.
2763 > This action is easily confused with the built-in, hardwired <TT
2766 HREF="actions-file.html#FILTER"
2770 action, but there are important differences: For <TT
2774 the document need not be buffered, so it can be incrementally rendered while
2775 downloading. But <TT
2778 > doesn't catch as many pop-ups as
2782 HREF="actions-file.html#FILTER"
2794 > Think of it as a fast and efficient replacement for a filter that you
2795 can use if you don't want any filtering at all. Note that it doesn't make
2796 sense to combine it with any <TT
2799 HREF="actions-file.html#FILTER"
2803 since as soon as one <TT
2806 HREF="actions-file.html#FILTER"
2810 the whole document needs to be buffered anyway, which destroys the advantage of
2814 > action over its filter equivalent.
2817 > Killing all pop-ups is a dangerous business. Many shops and banks rely on
2818 pop-ups to display forms, shopping carts etc, and killing only the unwanted pop-ups
2819 would require artificial intelligence in <SPAN
2823 If the only kind of pop-ups that you want to kill are exit consoles (those
2830 > windows that appear when you close an other
2831 one), you might want to use
2835 HREF="actions-file.html#FILTER"
2873 NAME="LIMIT-CONNECT">8.5.15. limit-connect</H4
2877 CLASS="VARIABLELIST"
2883 >Prevent abuse of <SPAN
2886 > as a TCP proxy relay</P
2892 > Specifies to which ports HTTP CONNECT requests are allowable.
2905 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
2906 defaulting to 0 and the maximum to 65K).
2913 > By default, i.e. if no <TT
2920 > only allows HTTP CONNECT
2921 requests to port 443 (the standard, secure HTTPS port). Use
2925 > if more fine-grained control is desired
2926 for some or all destinations.
2929 > The CONNECT methods exists in HTTP to allow access to secure websites
2933 > URLs) through proxies. It works very simply:
2934 the proxy connects to the server on the specified port, and then
2935 short-circuits its connections to the client and to the remote server.
2936 This can be a big security hole, since CONNECT-enabled proxies can be
2937 abused as TCP relays very easily.
2940 > If you don't know what any of this means, there probably is no reason to
2941 change this one, since the default is already very restrictive.
2945 >Example usages:</DT
2956 >+limit-connect{443} # This is the default and need not be specified.
2957 +limit-connect{80,443} # Ports 80 and 443 are OK.
2958 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
2959 +limit-connect{-} # All ports are OK (gaping security hole!)</PRE
2974 NAME="PREVENT-COMPRESSION">8.5.16. prevent-compression</H4
2978 CLASS="VARIABLELIST"
2984 > Ensure that servers send the content uncompressed, so it can be
2988 HREF="actions-file.html#FILTER"
2998 > Adds a header to the request that asks for uncompressed transfer.
3018 > More and more websites send their content compressed by default, which
3019 is generally a good idea and saves bandwidth. But for the <TT
3022 HREF="actions-file.html#FILTER"
3028 HREF="actions-file.html#DEANIMATE-GIFS"
3035 HREF="actions-file.html#KILL-POPUPS"
3042 > needs access to the uncompressed data.
3043 Unfortunately, <SPAN
3046 > can't yet(!) uncompress, filter, and
3047 re-compress the content on the fly. So if you want to ensure that all websites, including
3048 those that normally compress, can be filtered, you need to use this action.
3051 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
3052 actions, you will typically want to use <TT
3054 >prevent-compression</TT
3059 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
3060 documents correctly (they send an empty document body). If you use <TT
3062 >prevent-compression</TT
3064 per default, you'll have to add exceptions for those sites. See the example for how to do that.
3068 >Example usage (sections):</DT
3081 {+prevent-compression}
3084 # Make exceptions for ill sites:
3086 {-prevent-compression}
3088 www.pclinuxonline.com</PRE
3103 NAME="SEND-VANILLA-WAFER">8.5.17. send-vanilla-wafer</H4
3107 CLASS="VARIABLELIST"
3113 > Feed log analysis scripts with useless data.
3120 > Sends a cookie with each request stating that you do not accept any copyright
3121 on cookies sent to you, and asking the site operator not to track you.
3141 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
3144 > This action is rarely used and not enabled in the default configuration.
3159 >+send-vanilla-wafer</PRE
3174 NAME="SEND-WAFER">8.5.18. send-wafer</H4
3178 CLASS="VARIABLELIST"
3184 > Send custom cookies or feed log analysis scripts with even more useless data.
3191 > Sends a custom, user-defined cookie with each request.
3204 > A string of the form <SPAN
3224 > Being multi-valued, multiple instances of this action can apply to the same request,
3225 resulting in multiple cookies being sent.
3228 > This action is rarely used and not enabled in the default configuration.
3232 >Example usage (section):</DT
3243 >{+send-wafer{UsingPrivoxy=true}}
3244 my-internal-testing-server.void</PRE
3259 NAME="SESSION-COOKIES-ONLY">8.5.19. session-cookies-only</H4
3263 CLASS="VARIABLELIST"
3269 > Allow only temporary <SPAN
3272 > cookies (for the current browser session <SPAN
3290 >"Set-Cookie:"</SPAN
3292 Most browsers will not store such cookies permanently and forget them in between sessions.
3312 > This is less strict than <TT
3315 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3316 >crunch-incoming-cookies</A
3322 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3323 >crunch-outgoing-cookies</A
3325 > and allows you to browse
3326 websites that insist or rely on setting cookies, without compromising your privacy too badly.
3329 > Most browsers will not permanently store cookies that have been processed by
3332 >session-cookies-only</TT
3333 > and will forget about them between sessions.
3334 This makes profiling cookies useless, but won't break sites which require cookies so
3335 that you can log in for transactions. This is generally turned on for all
3336 sites, and is the recommended setting.
3347 >session-cookies-only</TT
3352 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3353 >crunch-incoming-cookies</A
3359 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3360 >crunch-outgoing-cookies</A
3362 >. If you do, cookies
3363 will be plainly killed.
3366 > Note that it is up to the browser how it handles such cookies without an <SPAN
3370 field. If you use an exotic browser, you might want to try it out to be sure.
3385 >+session-cookies-only</PRE
3400 NAME="SET-IMAGE-BLOCKER">8.5.20. set-image-blocker</H4
3404 CLASS="VARIABLELIST"
3410 >Choose the replacement for blocked images</P
3416 > This action alone doesn't do anything noticeable. If <SPAN
3426 HREF="actions-file.html#BLOCK"
3438 HREF="actions-file.html#HANDLE-AS-IMAGE"
3448 apply, i.e. if the request is to be blocked as an image,
3455 > the parameter of this action decides what will be
3456 sent as a replacement.
3476 > to send a built-in checkerboard pattern image. The image is visually
3477 decent, scales very well, and makes it obvious where banners were busted.
3485 > to send a built-in transparent image. This makes banners disappear
3486 completely, but makes it hard to detect where <SPAN
3490 images on a given page and complicates troubleshooting if <SPAN
3494 has blocked innocent images, like navigation icons.
3508 send a redirect to <TT
3514 to any image anywhere, even in your local filesystem (via <SPAN
3520 > A good application of redirects is to use special <SPAN
3524 URLs, which send the built-in images, as <TT
3530 This has the same visual effect as specifying <SPAN
3537 the first place, but enables your browser to cache the replacement image, instead of requesting
3538 it over and over again.
3547 > The URLs for the built-in images are <SPAN
3549 >"http://config.privoxy.org/send-banner?type=<TT
3570 > There is a third (advanced) type, called <SPAN
3582 >set-image-blocker</TT
3583 >, but meant for use from <A
3584 HREF="filter-file.html"
3587 Auto will select the type of image that would have applied to the referring page, had it been an image.
3605 >+set-image-blocker{pattern}</PRE
3612 > Redirect to the BSD devil:
3623 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
3630 > Redirect to the built-in pattern for better caching:
3641 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
3656 NAME="AEN2638">8.5.21. Summary</H3
3658 > Note that many of these actions have the potential to cause a page to
3659 misbehave, possibly even not to display at all. There are many ways
3660 a site designer may choose to design his site, and what HTTP header
3661 content, and other criteria, he may depend on. There is no way to have hard
3662 and fast rules for all sites. See the <A
3663 HREF="appendix.html#ACTIONSANAT"
3665 > for a brief example on troubleshooting
3674 NAME="ALIASES">8.6. Aliases</H2
3686 >, can be defined by combining other actions.
3687 These can in turn be invoked just like the built-in actions.
3688 Currently, an alias name can contain any character except space, tab,
3706 > that you only use <SPAN
3726 Alias names are not case sensitive, and are not required to start with a
3733 > sign, since they are merely textually
3736 > Aliases can be used throughout the actions file, but they <SPAN
3741 defined in a special section at the top of the file!</I
3744 And there can only be one such section per actions file. Each actions file may
3745 have its own alias section, and the aliases defined in it are only visible
3746 within that file.</P
3748 > There are two main reasons to use aliases: One is to save typing for frequently
3749 used combinations of actions, the other one is a gain in flexibility: If you
3750 decide once how you want to handle shops by defining an alias called
3754 >, you can later change your policy on shops in
3761 > place, and your changes will take effect everywhere
3762 in the actions file where the <SPAN
3765 > alias is used. Calling aliases
3766 by their purpose also makes your actions files more readable.</P
3768 > Currently, there is one big drawback to using aliases, though:
3772 >'s built-in web-based action file
3773 editor honors aliases when reading the actions files, but it expands
3774 them before writing. So the effects of your aliases are of course preserved,
3775 but the aliases themselves are lost when you edit sections that use aliases
3777 This is likely to change in future versions of <SPAN
3782 > Now let's define some aliases...</P
3792 > # Useful custom aliases we can use later.
3794 # Note the (required!) section header line and that this section
3795 # must be at the top of the actions file!
3799 # These aliases just save typing later:
3800 # (Note that some already use other aliases!)
3802 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
3803 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
3804 block-as-image = +block +handle-as-image
3805 mercy-for-cookies = -crunch-all-cookies -session-cookies-only
3807 # These aliases define combinations of actions
3808 # that are useful for certain types of sites:
3810 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -kill-popups
3811 shop = -crunch-all-cookies -filter{popups} -kill-popups
3813 # Short names for other aliases, for really lazy people ;-)
3815 c0 = +crunch-all-cookies
3816 c1 = -crunch-all-cookies</PRE
3822 > ...and put them to use. These sections would appear in the lower part of an
3823 actions file and define exceptions to the default actions (as specified further
3837 > # These sites are either very complex or very keen on
3838 # user data and require minimal interference to work:
3841 .office.microsoft.com
3842 .windowsupdate.microsoft.com
3846 # Allow cookies (for setting and retrieving your customer data)
3850 .worldpay.com # for quietpc.com
3853 # These shops require pop-ups:
3855 {shop -kill-popups -filter{popups}}
3857 .overclockers.co.uk</PRE
3863 > Aliases like <SPAN
3869 > are often used for
3873 > sites that require some actions to be disabled
3874 in order to function properly.</P
3881 NAME="ACT-EXAMPLES">8.7. Actions Files Tutorial</H2
3883 > The above chapters have shown <A
3884 HREF="actions-file.html"
3885 >which actions files
3886 there are and how they are organized</A
3887 >, how actions are <A
3888 HREF="actions-file.html#ACTIONS"
3891 HREF="actions-file.html#ACTIONS-APPLY"
3895 HREF="actions-file.html#AF-PATTERNS"
3899 HREF="actions-file.html#ALIASES"
3901 >. Now, let's look at an
3909 file and see how all these pieces come together:</P
3915 NAME="AEN2690">8.7.1. default.action</H3
3917 >Every config file should start with a short comment stating its purpose:</P
3927 ># Sample default.action file <developers@privoxy.org></PRE
3933 >Then, since this is the <TT
3937 first section is a special section for internal use that you needn't
3938 change or worry about:</P
3948 >##########################################################################
3949 # Settings -- Don't change! For internal Privoxy use ONLY.
3950 ##########################################################################
3953 for-privoxy-version=3.0</PRE
3959 >After that comes the (optional) alias section. We'll use the example
3960 section from the above <A
3961 HREF="actions-file.html#ALIASES"
3962 >chapter on aliases</A
3964 that also explains why and how aliases are used:</P
3974 >##########################################################################
3976 ##########################################################################
3979 # These aliases just save typing later:
3980 # (Note that some already use other aliases!)
3982 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
3983 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
3984 block-as-image = +block +handle-as-image
3985 mercy-for-cookies = -crunch-all-cookies -session-cookies-only
3987 # These aliases define combinations of actions
3988 # that are useful for certain types of sites:
3990 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -kill-popups
3991 shop = mercy-for-cookies -filter{popups} -kill-popups</PRE
3997 > Now come the regular sections, i.e. sets of actions, accompanied
3998 by URL patterns to which they apply. Remember <SPAN
4003 are disabled when matching starts</I
4005 >, so we have to explicitly
4006 enable the ones we want.</P
4008 > The first regular section is probably the most important. It has only
4017 HREF="actions-file.html#AF-PATTERNS"
4018 >matches all URLs</A
4020 set of actions used in this <SPAN
4028 be applied to all requests as a start</I
4030 >. It can be partly or
4031 wholly overridden by later matches further down this file, or in user.action,
4032 but it will still be largely responsible for your overall browsing
4035 > Again, at the start of matching, all actions are disabled, so there is
4036 no real need to disable any actions here, but we will do that nonetheless,
4037 to have a complete listing for your reference. (Remember: a <SPAN
4041 preceding the action name enables the action, a <SPAN
4045 Also note how this long line has been made more readable by splitting it into
4046 multiple lines with line continuation.</P
4056 >##########################################################################
4057 # "Defaults" section:
4058 ##########################################################################
4061 HREF="actions-file.html#ADD-HEADER"
4065 HREF="actions-file.html#BLOCK"
4069 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4070 >crunch-incoming-cookies</A
4073 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4074 >crunch-outgoing-cookies</A
4077 HREF="actions-file.html#DEANIMATE-GIFS"
4081 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
4082 >downgrade-http-version</A
4085 HREF="actions-file.html#FAST-REDIRECTS"
4089 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
4090 >filter{html-annoyances}</A
4093 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
4094 >filter{js-annoyances}</A
4097 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4098 >filter{content-cookies}</A
4101 HREF="actions-file.html#FILTER-POPUPS"
4105 HREF="actions-file.html#FILTER-WEBBUGS"
4109 HREF="actions-file.html#FILTER-REFRESH-TAGS"
4110 >filter{refresh-tags}</A
4113 HREF="actions-file.html#FILTER-FUN"
4117 HREF="actions-file.html#FILTER-NIMDA"
4121 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
4122 >filter{banners-by-size}</A
4125 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
4126 >filter{shockwave-flash}</A
4129 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
4130 >filter{crude-parental}</A
4133 HREF="actions-file.html#HANDLE-AS-IMAGE"
4137 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
4138 >hide-forwarded-for-headers</A
4141 HREF="actions-file.html#HIDE-FROM-HEADER"
4142 >hide-from-header{block}</A
4145 HREF="actions-file.html#HIDE-REFERER"
4146 >hide-referrer{forge}</A
4149 HREF="actions-file.html#HIDE-USER-AGENT"
4153 HREF="actions-file.html#KILL-POPUPS"
4157 HREF="actions-file.html#LIMIT-CONNECT"
4161 HREF="actions-file.html#PREVENT-COMPRESSION"
4162 >prevent-compression</A
4165 HREF="actions-file.html#SEND-VANILLA-WAFER"
4166 >send-vanilla-wafer</A
4169 HREF="actions-file.html#SEND-WAFER"
4173 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4174 >session-cookies-only</A
4177 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4178 >set-image-blocker{pattern}</A
4181 / # forward slash will match *all* potential URL patterns.</PRE
4187 > The default behavior is now set. Note that some actions, like not hiding
4188 the user agent, are part of a <SPAN
4190 >"general policy"</SPAN
4192 universally and won't get any exceptions defined later. Other choices,
4193 like not blocking (which is <SPAN
4200 default!) need exceptions, i.e. we need to specify explicitly what we
4201 want to block in later sections.
4202 We will also want to make exceptions from our general pop-up-killing,
4203 and use our defined aliases for that.</P
4205 > The first of our specialized sections is concerned with <SPAN
4209 sites, i.e. sites that require minimum interference, because they are either
4210 very complex or very keen on tracking you (and have mechanisms in place that
4211 make them unusable for people who avoid being tracked). We will simply use
4215 > alias instead of stating the list
4216 of actions explicitly:</P
4226 >##########################################################################
4227 # Exceptions for sites that'll break under the default action set:
4228 ##########################################################################
4230 # "Fragile" Use a minimum set of actions for these sites (see alias above):
4233 .office.microsoft.com # surprise, surprise!
4234 .windowsupdate.microsoft.com</PRE
4240 > Shopping sites are not as fragile, but they typically
4241 require cookies to log in, and pop-up windows for shopping
4242 carts or item details. Again, we'll use a pre-defined alias:</P
4256 .worldpay.com # for quietpc.com
4264 > Then, there are sites which rely on pop-up windows (yuck!) to work.
4265 Since we made pop-up-killing our default above, we need to make exceptions
4267 HREF="http://www.mozilla.org/"
4271 can turn on smart handling of unwanted pop-ups in their browsers, can
4276 HREF="actions-file.html#FILTER-POPUPS"
4283 HREF="actions-file.html#KILL-POPUPS"
4287 and hence don't need this section. Anyway, disabling an already disabled
4288 action doesn't hurt, so we'll define our exceptions regardless of what was
4289 chosen in the defaults section:</P
4299 ># These sites require pop-ups too :(
4302 HREF="actions-file.html#KILL-POPUPS"
4305 HREF="actions-file.html#FILTER-POPUPS"
4310 .deutsche-bank-24.de</PRE
4319 HREF="actions-file.html#FAST-REDIRECTS"
4323 action, which we enabled per default above, breaks some sites. So disable
4324 it for popular sites where we know it misbehaves:</P
4335 HREF="actions-file.html#FAST-REDIRECTS"
4341 .altavista.com/.*(like|url|link):http
4342 .altavista.com/trans.*urltext=http
4349 > It is important that <SPAN
4353 URLs belong to images, so that <SPAN
4360 be blocked, a substitute image can be sent, rather than an HTML page.
4361 Contacting the remote site to find out is not an option, since it
4362 would destroy the loading time advantage of banner blocking, and it
4363 would feed the advertisers (in terms of money <SPAN
4370 information). We can mark any URL as an image with the <TT
4373 HREF="actions-file.html#HANDLE-AS-IMAGE"
4377 and marking all URLs that end in a known image file extension is a
4388 >##########################################################################
4390 ##########################################################################
4392 # Define which file types will be treated as images, in case they get
4393 # blocked further down this file:
4396 HREF="actions-file.html#HANDLE-AS-IMAGE"
4399 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
4405 > And then there are known banner sources. They often use scripts to
4406 generate the banners, so it won't be visible from the URL that the
4407 request is for an image. Hence we block them <SPAN
4414 mark them as images in one go, with the help of our
4418 > alias defined above. (We could of
4419 course just as well use <TT
4422 HREF="actions-file.html#BLOCK"
4426 HREF="actions-file.html#HANDLE-AS-IMAGE"
4430 Remember that the type of the replacement image is chosen by the
4434 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4435 >set-image-blocker</A
4438 action. Since all URLs have matched the default section with its
4442 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4443 >set-image-blocker</A
4446 action before, it still applies and needn't be repeated:</P
4456 ># Known ad generators:
4461 .ad.*.doubleclick.net
4462 .a.yimg.com/(?:(?!/i/).)*$
4463 .a[0-9].yimg.com/(?:(?!/i/).)*$
4472 > One of the most important jobs of <SPAN
4476 is to block banners. A huge bunch of them are already <SPAN
4483 HREF="actions-file.html#FILTER"
4485 >{banners-by-size}</TT
4487 action, which we enabled above, and which deletes the references to banner
4488 images from the pages while they are loaded, so the browser doesn't request
4489 them anymore, and hence they don't need to be blocked here. But this naturally
4490 doesn't catch all banners, and some people choose not to use filters, so we
4491 need a comprehensive list of patterns for banner URLs here, and apply the
4495 HREF="actions-file.html#BLOCK"
4498 > action to them.</P
4500 > First comes a bunch of generic patterns, which do most of the work, by
4501 matching typical domain and path name components of banners. Then comes
4502 a list of individual patterns for specific sites, which is omitted here
4503 to keep the example short:</P
4513 >##########################################################################
4514 # Block these fine banners:
4515 ##########################################################################
4517 HREF="actions-file.html#BLOCK"
4527 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
4528 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
4530 # Site-specific patterns (abbreviated):
4538 > You wouldn't believe how many advertisers actually call their banner
4544 >.com, or call the directory
4545 in which the banners are stored simply <SPAN
4549 generic patterns are surprisingly effective.</P
4551 > But being very generic, they necessarily also catch URLs that we don't want
4552 to block. The pattern <TT
4564 >.nasty-corp.com"</SPAN
4574 >.sourcefroge.net"</SPAN
4584 >l.some-provider.net."</SPAN
4586 well-known exceptions to the <TT
4589 HREF="actions-file.html#BLOCK"
4595 > Note that these are exceptions to exceptions from the default! Consider the URL
4598 >"downloads.sourcefroge.net"</SPAN
4599 >: Initially, all actions are deactivated,
4600 so it wouldn't get blocked. Then comes the defaults section, which matches the
4601 URL, but just deactivates the <TT
4604 HREF="actions-file.html#BLOCK"
4608 action once again. Then it matches <TT
4611 >, an exception to the
4612 general non-blocking policy, and suddenly
4616 HREF="actions-file.html#BLOCK"
4619 > applies. And now, it'll match
4626 HREF="actions-file.html#BLOCK"
4630 applies, so (unless it matches <SPAN
4636 > further down) it ends up
4640 HREF="actions-file.html#BLOCK"
4643 > action applying.</P
4653 >##########################################################################
4654 # Save some innocent victims of the above generic block patterns:
4655 ##########################################################################
4660 HREF="actions-file.html#BLOCK"
4663 adv[io]*. # (for advogato.org and advice.*)
4664 adsl. # (has nothing to do with ads)
4665 ad[ud]*. # (adult.* and add.*)
4666 .edu # (universities don't host banners (yet!))
4667 .*loads. # (downloads, uploads etc)
4675 www.globalintersec.com/adv # (adv = advanced)
4676 www.ugu.com/sui/ugu/adv</PRE
4682 > Filtering source code can have nasty side effects,
4683 so make an exception for our friends at sourceforge.net,
4684 and all paths with <SPAN
4687 > in them. Note that
4691 HREF="actions-file.html#FILTER"
4701 > filters in one fell swoop!</P
4711 ># Don't filter code!
4714 HREF="actions-file.html#FILTER"
4718 .sourceforge.net</PRE
4728 comprehensive, but we hope this example made clear how it works.</P
4735 NAME="AEN2844">8.7.2. user.action</H3
4737 > So far we are painting with a broad brush by setting general policies,
4738 which would be a reasonable starting point for many people. Now,
4739 you might want to be more specific and have customized rules that
4740 are more suitable to your personal habits and preferences. These would
4741 be for narrowly defined situations like your ISP or your bank, and should
4745 >, which is parsed after all other
4746 actions files and hence has the last word, over-riding any previously
4747 defined actions. <TT
4757 > place for your personal settings, since
4761 > is actively maintained by the
4765 > developers and you'll probably want
4766 to install updated versions from time to time.</P
4768 > So let's look at a few examples of things that one might typically do in
4782 ># My user.action file. <fred@foobar.com></PRE
4789 HREF="actions-file.html#ALIASES"
4791 > are local to the actions
4792 file that they are defined in, you can't use the ones from
4796 >, unless you repeat them here:</P
4806 ># (Re-)define aliases for this file:
4809 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
4810 mercy-for-cookies = -crunch-all-cookies -session-cookies-only
4811 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -kill-popups
4812 shop = mercy-for-cookies -filter{popups} -kill-popups
4813 allow-ads = -block -filter{banners-by-size} # (see below)</PRE
4820 > Say you have accounts on some sites that you visit regularly, and
4821 you don't want to have to log in manually each time. So you'd like
4822 to allow persistent cookies for these sites. The
4825 >mercy-for-cookies</TT
4826 > alias defined above does exactly
4827 that, i.e. it disables crunching of cookies in any direction, and
4828 processing of cookies to make them temporary.</P
4838 >{ mercy-for-cookies }
4849 > Your bank needs popups and is allergic to some filter, but you don't
4850 know which, so you disable them all:</P
4861 HREF="actions-file.html#FILTER"
4864 HREF="actions-file.html#KILL-POPUPS"
4867 .your-home-banking-site.com</PRE
4873 > While browsing the web with <SPAN
4877 noticed some ads that sneaked through, but you were too lazy to
4878 report them through our fine and easy <A
4882 system, so you have added them here:</P
4893 HREF="actions-file.html#BLOCK"
4896 www.a-popular-site.com/some/unobvious/path
4897 another.popular.site.net/more/junk/here/</PRE
4903 > Note that, assuming the banners in the above example have regular image
4904 extensions (most do),
4908 HREF="actions-file.html#HANDLE-AS-IMAGE"
4912 need not be specified, since all URLs ending in these extensions will
4913 already have been tagged as images in the relevant section of
4919 > Then you noticed that the default configuration breaks Forbes Magazine,
4920 but you were too lazy to find out which action is the culprit, and you
4921 were again too lazy to give <A
4925 you just used the <TT
4928 > alias on the site, and
4929 -- whoa! -- it worked:</P
4946 > You like the <SPAN
4949 > text replacements in <TT
4953 but it is disabled in the distributed actions file. (My colleagues on the team just
4954 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
4955 update-safe config, once and for all:</P
4966 HREF="actions-file.html#FILTER-FUN"
4969 / # For ALL sites!</PRE
4975 > Note that the above is not really a good idea: There are exceptions
4976 to the filters in <TT
4980 really shouldn't be filtered, like code on CVS->Web interfaces. Since
4984 > has the last word, these exceptions
4985 won't be valid for the <SPAN
4988 > filtering specified here.</P
4990 > Finally, you might think about how your favourite free websites are
4991 funded, and find that they rely on displaying banner advertisements
4992 to survive. So you might want to specifically allow banners for those
4993 sites that you feel provide value to you:</P
5015 > has been aliased to
5019 HREF="actions-file.html#BLOCK"
5026 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
5027 >filter{banners-by-size}</A
5039 SUMMARY="Footer navigation table"
5068 HREF="filter-file.html"
5078 >The Main Configuration File</TD
5088 >The Filter File</TD