1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 TITLE="Privoxy 3.0.3 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.3 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
193 >Ad-blocking by URL</TD
203 >Ad-filtering by size</TD
213 >GIF de-animation</TD
273 >JavaScript taming</TD
293 >Fun text replacements</TD
303 >Image tag reordering</TD
313 >Ad-filtering by link</TD
341 > The list of actions files to be used are defined in the main configuration
342 file, and are processed in the order they are defined (e.g.
346 > is typically process before
350 >). The content of these can all be viewed and
352 HREF="http://config.privoxy.org/show-status"
354 >http://config.privoxy.org/show-status</A
357 > An actions file typically has multiple sections. If you want to use
361 > in an actions file, you have to place the (optional)
363 HREF="actions-file.html#ALIASES"
365 > at the top of that file.
366 Then comes the default set of rules which will apply universally to all
367 sites and pages (be <SPAN
377 > or any other actions file after
381 >, because it will override the result
382 from consulting any previous file). And then below that,
383 exceptions to the defined universal policies. You can regard
387 > as an appendix to <TT
391 with the advantage that is a separate file, which makes preserving your
392 personal settings across <SPAN
395 > upgrades easier.</P
398 Actions can be used to block anything you want, including ads, banners, or
399 just some obnoxious URL that you would rather not see. Cookies can be accepted
400 or rejected, or accepted only during the current browser session (i.e. not
401 written to disk), content can be modified, JavaScripts tamed, user-tracking
402 fooled, and much more. See below for a <A
403 HREF="actions-file.html#ACTIONS"
413 >8.1. Finding the Right Mix</A
417 HREF="actions-file.html#ACTIONS"
419 >, like cookie suppression
420 or script disabling, may render some sites unusable that rely on these
421 techniques to work properly. Finding the right mix of actions is not always easy and
422 certainly a matter of personal taste. In general, it can be said that the more
426 > your default settings (in the top section of the
427 actions file) are, the more exceptions for <SPAN
431 will have to make later. If, for example, you want to crunch all cookies per
432 default, you'll have to make exceptions from that rule for sites that you
433 regularly use and that require cookies for actually useful puposes, like maybe
434 your bank, favorite shop, or newspaper. </P
436 > We have tried to provide you with reasonable rules to start from in the
437 distribution actions files. But there is no general rule of thumb on these
438 things. There just are too many variables, and sites are constantly changing.
439 Sooner or later you will want to change the rules (and read this chapter again :).</P
450 > The easiest way to edit the actions files is with a browser by
451 using our browser-based editor, which can be reached from <A
452 HREF="http://config.privoxy.org/show-status"
454 >http://config.privoxy.org/show-status</A
456 The editor allows both fine-grained control over every single feature on a
457 per-URL basis, and easy choosing from wholesale sets of defaults like
466 >"Adventuresome"</SPAN
470 >"Adventuresome"</SPAN
471 > setting is not only more aggressive,
472 but includes settings that are fun and subversive, and which some may find of
475 > If you prefer plain text editing to GUIs, you can of course also directly edit the
476 the actions files. Look at <TT
488 >8.3. How Actions are Applied to URLs</A
491 > Actions files are divided into sections. There are special sections,
495 HREF="actions-file.html#ALIASES"
498 > sections which will
499 be discussed later. For now let's concentrate on regular sections: They have a
500 heading line (often split up to multiple lines for readability) which consist
501 of a list of actions, separated by whitespace and enclosed in curly braces.
502 Below that, there is a list of URL patterns, each on a separate line.</P
504 > To determine which actions apply to a request, the URL of the request is
505 compared to all patterns in each action file file. Every time it matches, the list of
506 applicable actions for the URL is incrementally updated, using the heading
507 of the section in which the pattern is located. If multiple matches for
508 the same URL set the same action differently, the last match wins. If not,
509 the effects are aggregated. E.g. a URL might match a regular section with
510 a heading line of <VAR
514 HREF="actions-file.html#HANDLE-AS-IMAGE"
518 then later another one with just <VAR
522 HREF="actions-file.html#BLOCK"
532 > actions to apply.</P
534 > You can trace this process for any given URL by visiting <A
535 HREF="http://config.privoxy.org/show-url-info"
537 >http://config.privoxy.org/show-url-info</A
540 > More detail on this is provided in the Appendix, <A
541 HREF="appendix.html#ACTIONSANAT"
542 > Anatomy of an Action</A
562 to determine what actions might apply to which sites and pages your browser
563 attempts to access. These <SPAN
573 > matching to achieve a high degree of
574 flexibility. This allows one expression to be expanded and potentially match
575 against many similar patterns.</P
580 > pattern has the form
583 ><domain>/<path></VAR
587 ><domain></VAR
592 optional. (This is why the special <VAR
595 > pattern matches all
596 URLs). Note that the protocol portion of the URL pattern (e.g.
607 the pattern. This is assumed already!</P
616 >www.example.com/</VAR
620 > is a domain-only pattern and will match any request to <VAR
622 >www.example.com</VAR
624 regardless of which document on that server is requested.
630 >www.example.com</VAR
634 > means exactly the same. For domain-only patterns, the trailing <VAR
644 >www.example.com/index.html</VAR
648 > matches only the single document <VAR
654 >www.example.com</VAR
665 > matches the document <VAR
668 >, regardless of the domain,
685 > matches nothing, since it would be interpreted as a domain name and
686 there is no top-level domain called <VAR
700 >8.4.1. The Domain Pattern</A
703 > The matching of the domain part offers some flexible options: if the
704 domain starts or ends with a dot, it becomes unanchored at that end.
718 > matches any domain that <SPAN
738 > matches any domain that <SPAN
758 > matches any domain that <SPAN
768 (Correctly speaking: It matches any FQDN that contains <VAR
777 > Additionally, there are wild-cards that you can use in the domain names
778 themselves. They work pretty similar to shell wild-cards: <SPAN
782 stands for zero or more arbitrary characters, <SPAN
786 any single character, you can define character classes in square
787 brackets and all of that can be freely mixed:</P
796 >ad*.example.com</VAR
802 >"adserver.example.com"</SPAN
806 >"ads.example.com"</SPAN
809 >"sfads.example.com"</SPAN
816 >*ad*.example.com</VAR
820 > matches all of the above, and then some.
836 >pictures.epix.com</VAR
839 >a.b.c.d.e.upix.com</VAR
846 >www[1-9a-ez].example.c*</VAR
852 >www1.example.com</VAR
856 >www4.example.cc</VAR
859 >wwwd.example.cy</VAR
863 >wwwz.example.com</VAR
873 >wwww.example.com</VAR
886 >8.4.2. The Path Pattern</A
892 > uses Perl compatible regular expressions
894 HREF="http://www.pcre.org/"
898 matching the path.</P
901 HREF="appendix.html#REGEX"
903 > with a brief quick-start into regular
904 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
906 HREF="http://www.pcre.org/man.txt"
908 >http://www.pcre.org/man.txt</A
910 You might also find the Perl man page on regular expressions (<VAR
914 useful, which is available on-line at <A
915 HREF="http://www.perldoc.com/perl5.6/pod/perlre.html"
917 >http://www.perldoc.com/perl5.6/pod/perlre.html</A
920 > Note that the path pattern is automatically left-anchored at the <SPAN
924 i.e. it matches as if it would start with a <SPAN
927 > (regular expression speak
928 for the beginning of a line).</P
930 > Please also note that matching in the path is <SPAN
937 by default, but you can switch to case sensitive at any point in the pattern by using the
943 >www.example.com/(?-i)PaTtErN.*</VAR
945 only documents whose path starts with <VAR
955 > this capitalization.</P
967 > All actions are disabled by default, until they are explicitly enabled
968 somewhere in an actions file. Actions are turned on if preceded with a
972 >, and turned off if preceded with a <SPAN
981 >"do that action"</SPAN
988 >"please block URLs that match the
989 following patterns"</SPAN
996 block URLs that match the following patterns, even if <VAR
1000 previously applied."</SPAN
1004 Again, actions are invoked by placing them on a line, enclosed in curly braces and
1005 separated by whitespace, like in
1008 >{+some-action -some-other-action{some-parameter}}</VAR
1010 followed by a list of URL patterns, one per line, to which they apply.
1011 Together, the actions line and the following pattern lines make up a section
1012 of the actions file. </P
1015 There are three classes of actions:</P
1023 Boolean, i.e the action can only be <SPAN
1044 > # enable action <VAR
1051 > # disable action <VAR
1071 Parameterized, where some value is required in order to enable this type of action.
1089 >} # enable action and set parameter to <VAR
1093 # overwriting parameter from previous match if necessary
1097 > # disable action. The parameter can be omitted</PRE
1104 > Note that if the URL matches multiple positive forms of a parameterized action,
1105 the last match wins, i.e. the params from earlier matches are simply ignored.
1111 >+hide-user-agent{ Mozilla 1.0 }</VAR
1118 Multi-value. These look exactly like parameterized actions,
1119 but they behave differently: If the action applies multiple times to the
1120 same URL, but with different parameters, <SPAN
1133 > matches are remembered. This is used for actions
1134 that can be executed for the same request repeatedly, like adding multiple
1135 headers, or filtering through multiple filters. Syntax:
1152 >} # enable action and add <VAR
1155 > to the list of parameters
1162 >} # remove the parameter <VAR
1165 > from the list of parameters
1166 # If it was the last one left, disable the action.
1170 > # disable this action completely and remove all parameters from the list</PRE
1180 >+add-header{X-Fun-Header: Some text}</VAR
1184 >+filter{html-annoyances}</VAR
1191 > If nothing is specified in any actions file, no <SPAN
1195 taken. So in this case <SPAN
1199 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
1200 privacy and blocking features you need (although the provided default actions
1201 files will give a good starting point).</P
1203 > Later defined actions always over-ride earlier ones. So exceptions
1204 to any rules you make, should come in the latter part of the file (or
1205 in a file that is processed later when using multiple actions files). For
1206 multi-valued actions, the actions are applied in the order they are specified.
1207 Actions files are processed in the order they are defined in
1211 > (the default installation has three actions
1212 files). It also quite possible for any given URL pattern to match more than
1213 one pattern and thus more than one set of actions!</P
1215 > The list of valid <SPAN
1225 >8.5.1. add-header</A
1230 CLASS="VARIABLELIST"
1236 >Confuse log analysis, custom applications</P
1242 > Sends a user defined HTTP header to the web server.
1255 > Any string value is possible. Validity of the defined HTTP headers is not checked.
1256 It is recommended that you use the <SPAN
1270 > This action may be specified multiple times, in order to define multiple
1271 headers. This is rarely needed for the typical user. If you don't know what
1274 >"HTTP headers"</SPAN
1275 > are, you definitely don't need to worry about this
1291 >+add-header{X-User-Tracking: sucks}</PRE
1312 CLASS="VARIABLELIST"
1318 >Block ads or other obnoxious content</P
1324 > Requests for URLs to which this action applies are blocked, i.e. the requests are not
1325 forwarded to the remote server, but answered locally with a substitute page or image,
1326 as determined by the <VAR
1329 HREF="actions-file.html#HANDLE-AS-IMAGE"
1336 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1337 >set-image-blocker</A
1361 > sends a special <SPAN
1365 for requests to blocked pages. This page contains links to find out why the request
1366 was blocked, and a click-through to the blocked content (the latter only if compiled with the
1367 force feature enabled). The <SPAN
1370 > page adapts to the available
1371 screen space -- it displays full-blown if space allows, or miniaturized and text-only
1372 if loaded into a small frame or window. If you are using <SPAN
1376 right now, you can take a look at the
1378 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
1389 A very important exception occurs if <SPAN
1402 HREF="actions-file.html#HANDLE-AS-IMAGE"
1406 apply to the same request: it will then be replaced by an image. If
1410 HREF="actions-file.html#SET-IMAGE-BLOCKER"
1411 >set-image-blocker</A
1414 (see below) also applies, the type of image will be determined by its parameter,
1415 if not, the standard checkerboard pattern is sent.
1418 > It is important to understand this process, in order
1419 to understand how <SPAN
1423 ads and other unwanted content.
1429 HREF="actions-file.html#FILTER"
1433 action can perform a very similar task, by <SPAN
1437 banner images and other content through rewriting the relevant URLs in the
1438 document's HTML source, so they don't get requested in the first place.
1439 Note that this is a totally different technique, and it's easy to confuse the two.
1443 >Example usage (section):</DT
1454 >{+block} # Block and replace with "blocked" page
1455 .nasty-stuff.example.com
1457 {+block +handle-as-image} # Block and replace with image
1474 NAME="CRUNCH-INCOMING-COOKIES"
1475 >8.5.3. crunch-incoming-cookies</A
1480 CLASS="VARIABLELIST"
1486 > Prevent the web server from setting any cookies on your system
1495 >"Set-Cookie:"</SPAN
1496 > HTTP headers from server replies.
1516 > This action is only concerned with <SPAN
1533 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
1534 >crunch-outgoing-cookies</A
1543 > to disable cookies completely.
1552 > to use this action in conjunction
1556 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1557 >session-cookies-only</A
1560 since it would prevent the session cookies from being set. See also
1564 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
1565 >filter-content-cookies</A
1582 >+crunch-incoming-cookies</PRE
1597 NAME="CRUNCH-OUTGOING-COOKIES"
1598 >8.5.4. crunch-outgoing-cookies</A
1603 CLASS="VARIABLELIST"
1609 > Prevent the web server from reading any cookies from your system
1619 > HTTP headers from client requests.
1639 > This action is only concerned with <SPAN
1656 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
1657 >crunch-incoming-cookies</A
1666 > to disable cookies completely.
1675 > to use this action in conjunction
1679 HREF="actions-file.html#SESSION-COOKIES-ONLY"
1680 >session-cookies-only</A
1683 since it would prevent the session cookies from being read.
1698 >+crunch-outgoing-cookies</PRE
1713 NAME="DEANIMATE-GIFS"
1714 >8.5.5. deanimate-gifs</A
1719 CLASS="VARIABLELIST"
1725 >Stop those annoying, distracting animated GIF images.</P
1731 > De-animate GIF animations, i.e. reduce them to their first or last image.
1757 > This will also shrink the images considerably (in bytes, not pixels!). If
1761 > is given, the first frame of the animation
1762 is used as the replacement. If <SPAN
1765 > is given, the last
1766 frame of the animation is used instead, which probably makes more sense for
1767 most banner animations, but also has the risk of not showing the entire
1768 last frame (if it is only a delta to an earlier frame).
1771 > You can safely use this action with patterns that will also match non-GIF
1772 objects, because no attempt will be made at anything that doesn't look like
1788 >+deanimate-gifs{last}</PRE
1803 NAME="DOWNGRADE-HTTP-VERSION"
1804 >8.5.6. downgrade-http-version</A
1809 CLASS="VARIABLELIST"
1815 >Work around (very rare) problems with HTTP/1.1</P
1821 > Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
1841 > This is a left-over from the time when <SPAN
1845 didn't support important HTTP/1.1 features well. It is left here for the
1846 unlikely case that you experience HTTP/1.1 related problems with some server
1847 out there. Not all (optional) HTTP/1.1 features are supported yet, so there
1848 is a chance you might need this action.
1852 >Example usage (section):</DT
1863 >{+downgrade-http-version}
1864 problem-host.example.com</PRE
1879 NAME="FAST-REDIRECTS"
1880 >8.5.7. fast-redirects</A
1885 CLASS="VARIABLELIST"
1891 >Fool some click-tracking scripts and speed up indirect links</P
1897 > Cut off all but the last valid URL from requests.
1918 Many sites, like yahoo.com, don't just link to other sites. Instead, they
1919 will link to some script on their own servers, giving the destination as a
1920 parameter, which will then redirect you to the final target. URLs
1921 resulting from this scheme typically look like:
1926 >http://some.place/click-tracker.cgi?target=http://some.where.else</I
1931 > Sometimes, there are even multiple consecutive redirects encoded in the
1932 URL. These redirections via scripts make your web browsing more traceable,
1933 since the server from which you follow such a link can see where you go
1934 to. Apart from that, valuable bandwidth and time is wasted, while your
1935 browser ask the server for one redirect after the other. Plus, it feeds
1939 > This feature is currently not very smart and is scheduled for improvement.
1940 It is likely to break some sites. You should expect to need possibly
1941 many exceptions to this action, if it is enabled by default in
1945 >. Some sites just don't work without
1961 >{+fast-redirects}</PRE
1982 CLASS="VARIABLELIST"
1988 >Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, etc.</P
1994 > All files of text-based type, most notably HTML and JavaScript, to which this
1995 action applies, are filtered on-the-fly through the specified regular expression
1996 based substitutions. (Note: as of version 3.0.3 plain text documents
1997 are exempted from filtering, because web servers often use the
2001 > MIME type for all files whose type they
2015 > The name of a filter, as defined in the <A
2016 HREF="filter-file.html"
2026 HREF="config.html#FILTERFILE"
2033 >). When used in its negative form,
2034 and without parameters, filtering is completely disabled.
2041 > For your convenience, there are a number of pre-defined filters available
2042 in the distribution filter file that you can use. See the examples below for
2046 > Filtering requires buffering the page content, which may appear to
2047 slow down page rendering since nothing is displayed until all content has
2048 passed the filters. (It does not really take longer, but seems that way
2049 since the page is not incrementally displayed.) This effect will be more
2050 noticeable on slower connections.
2053 > This is very powerful feature, but <SPAN
2055 >"rolling your own"</SPAN
2057 filters requires a knowledge of regular expressions and HTML.
2060 > The amount of data that can be filtered is limited to the
2064 HREF="config.html#BUFFER-LIMIT"
2068 option in the main <A
2072 default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered
2073 data, and all pending data, is passed through unfiltered.
2076 > Inadequate MIME types, such as zipped files, are not filtered at all.
2077 (Again, only text-based types except plain text). Encrypted SSL data
2078 (from HTTPS servers) cannot be filtered either, since this would violate
2079 the integrity of the secure transaction. In some situations it might
2080 be necessary to protect certain text, like source code, from filtering
2081 by defining appropriate <VAR
2087 > At this time, <SPAN
2090 > cannot (yet!) uncompress compressed
2091 documents. If you want filtering to work on all documents, even those that
2092 would normally be sent compressed, use the
2096 HREF="actions-file.html#PREVENT-COMPRESSION"
2097 >prevent-compression</A
2100 action in conjunction with <VAR
2106 > Filtering can achieve some of the same effects as the
2110 HREF="actions-file.html#BLOCK"
2114 action, i.e. it can be used to block ads and banners. But the mechanism
2115 works quite differently. One effective use, is to block ad banners
2116 based on their size (see below), since many of these seem to be somewhat
2123 > with suggestions for new or
2124 improved filters is particularly welcome!
2127 > The below list has only the names and a one-line description of each
2128 predefined filter. There are <A
2129 HREF="filter-file.html#PREDEFINED-FILTERS"
2131 verbose explanations</A
2132 > of what these filters do in the <A
2133 HREF="filter-file.html"
2134 >filter file chapter</A
2139 >Example usage (with filters from the distribution <TT
2144 HREF="filter-file.html#PREDEFINED-FILTERS"
2145 >the Predefined Filters section</A
2147 more explanation on each:</DT
2151 NAME="FILTER-JS-ANNOYANCES"
2162 >+filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse</PRE
2170 NAME="FILTER-JS-EVENTS"
2181 >+filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)</PRE
2189 NAME="FILTER-HTML-ANNOYANCES"
2200 >+filter{html-annoyances} # Get rid of particularly annoying HTML abuse</PRE
2208 NAME="FILTER-CONTENT-COOKIES"
2219 >+filter{content-cookies} # Kill cookies that come in the HTML or JS content</PRE
2227 NAME="FILTER-REFRESH-TAGS"
2238 >+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)</PRE
2246 NAME="FILTER-UNSOLICITED-POPUPS"
2257 >+filter{unsolicited-popups} # Disable only unsolicited pop-up windows</PRE
2265 NAME="FILTER-ALL-POPUPS"
2276 >+filter{all-popups} # Kill all popups in JavaScript and HTML</PRE
2284 NAME="FILTER-IMG-REORDER"
2295 >+filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective</PRE
2303 NAME="FILTER-BANNERS-BY-SIZE"
2314 >+filter{banners-by-size} # Kill banners by size</PRE
2322 NAME="FILTER-BANNERS-BY-LINK"
2333 >+filter{banners-by-link} # Kill banners by their links to known clicktrackers</PRE
2341 NAME="FILTER-WEBBUGS"
2352 >+filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)</PRE
2360 NAME="FILTER-TINY-TEXTFORMS"
2371 >+filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap</PRE
2379 NAME="FILTER-JUMPING-WINDOWS"
2390 >+filter{jumping-windows} # Prevent windows from resizing and moving themselves</PRE
2398 NAME="FILTER-FRAMESET-BORDERS"
2409 >+filter{frameset-borders} # Give frames a border and make them resizable</PRE
2417 NAME="FILTER-DEMORONIZER"
2428 >+filter{demoronizer} # Fix MS's non-standard use of standard charsets</PRE
2436 NAME="FILTER-SHOCKWAVE-FLASH"
2447 >+filter{shockwave-flash} # Kill embedded Shockwave Flash objects</PRE
2455 NAME="FILTER-QUICKTIME-KIOSKMODE"
2466 >+filter{quicktime-kioskmode} # Make Quicktime movies saveable</PRE
2485 >+filter{fun} # Text replacements for subversive browsing fun!</PRE
2493 NAME="FILTER-CRUDE-PARENTAL"
2504 >+filter{crude-parental} # Crude parental filtering (demo only)</PRE
2512 NAME="FILTER-IE-EXPLOITS"
2523 >+filter{ie-exploits} # Disable some known Internet Explorer bug exploits</PRE
2538 NAME="HANDLE-AS-IMAGE"
2539 >8.5.9. handle-as-image</A
2544 CLASS="VARIABLELIST"
2550 >Mark URLs as belonging to images (so they'll be replaced by images <SPAN
2554 >if they get blocked</I
2562 > This action alone doesn't do anything noticeable. It just marks URLs as images.
2566 HREF="actions-file.html#BLOCK"
2576 the presence or absence of this mark decides whether an HTML <SPAN
2580 page, or a replacement image (as determined by the <VAR
2583 HREF="actions-file.html#SET-IMAGE-BLOCKER"
2584 >set-image-blocker</A
2586 > action) will be sent to the
2587 client as a substitute for the blocked content.
2607 > The below generic example section is actually part of <TT
2611 It marks all URLs with well-known image file name extensions as images and should
2615 > Users will probably only want to use the handle-as-image action in conjunction with
2619 HREF="actions-file.html#BLOCK"
2622 >, to block sources of banners, whose URLs don't
2623 reflect the file type, like in the second example section.
2626 > Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad
2627 frames require an HTML page to be sent, or they won't display properly.
2630 >handle-as-image</VAR
2631 > in this situation will not replace the
2632 ad frame with an image, but lead to error messages.
2636 >Example usage (sections):</DT
2647 ># Generic image extensions:
2650 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2652 # These don't look like images, but they're banners and should be
2653 # blocked as images:
2655 {+block +handle-as-image}
2656 some.nasty-banner-server.com/junk.cgi?output=trash
2658 # Banner source! Who cares if they also have non-image content?
2659 ad.doubleclick.net </PRE
2674 NAME="HIDE-FORWARDED-FOR-HEADERS"
2675 >8.5.10. hide-forwarded-for-headers</A
2680 CLASS="VARIABLELIST"
2686 >Improve privacy by hiding the true source of the request</P
2692 > Deletes any existing <SPAN
2694 >"X-Forwarded-for:"</SPAN
2695 > HTTP header from client requests,
2696 and prevents adding a new one.
2716 > It is fairly safe to leave this on.
2719 > This action is scheduled for improvement: It should be able to generate forged
2722 >"X-Forwarded-for:"</SPAN
2723 > headers using random IP addresses from a specified network,
2724 to make successive requests from the same client look like requests from a pool of different
2725 users sharing the same proxy.
2740 >+hide-forwarded-for-headers</PRE
2755 NAME="HIDE-FROM-HEADER"
2756 >8.5.11. hide-from-header</A
2761 CLASS="VARIABLELIST"
2767 >Keep your (old and ill) browser from telling web servers your email address</P
2773 > Deletes any existing <SPAN
2776 > HTTP header, or replaces it with the
2793 >, or any user defined value.
2803 > will completely remove the header
2804 (not to be confused with the <VAR
2807 HREF="actions-file.html#BLOCK"
2814 > Alternately, you can specify any value you prefer to be sent to the web
2815 server. If you do, it is a matter of fairness not to use any address that
2816 is actually used by a real person.
2819 > This action is rarely needed, as modern web browsers don't send
2838 >+hide-from-header{block}</PRE
2851 >+hide-from-header{spam-me-senseless@sittingduck.example.com}</PRE
2866 NAME="HIDE-REFERRER"
2867 >8.5.12. hide-referrer</A
2875 CLASS="VARIABLELIST"
2881 >Conceal which link you followed to get to a particular site</P
2890 > (sic) HTTP header from the client request,
2891 or replaces it with a forged one.
2911 > to delete the header completely.</P
2918 > to pretend to be coming from the homepage of the server we are talking to.</P
2922 >Any other string to set a user defined referrer.</P
2933 > is the preferred option here, since some servers will
2934 not send images back otherwise, in an attempt to prevent their valuable
2935 content from being embedded elsewhere (and hence, without being surrounded
2949 > is an alternate spelling of
2953 > and the two can be can be freely
2954 substituted with each other. (<SPAN
2958 correct English spelling, however the HTTP specification has a bug - it
2959 requires it to be spelled as <SPAN
2977 >+hide-referrer{forge}</PRE
2990 >+hide-referrer{http://www.yahoo.com/}</PRE
3005 NAME="HIDE-USER-AGENT"
3006 >8.5.13. hide-user-agent</A
3011 CLASS="VARIABLELIST"
3017 >Conceal your type of browser and client operating system</P
3023 > Replaces the value of the <SPAN
3025 >"User-Agent:"</SPAN
3027 in client requests with the specified value.
3040 > Any user-defined string.
3065 > This breaks many web sites that depend on looking at this header in order
3066 to customize their content for different browsers (which, by the
3074 HREF="http://www.javascriptkit.com/javaindex.shtml"
3085 > Using this action in multi-user setups or wherever different types of
3086 browsers will access the same <SPAN
3096 >. In single-user, single-browser
3097 setups, you might use it to delete your OS version information from
3098 the headers, because it is an invitation to exploit known bugs for your
3099 OS. It is also occasionally useful to forge this in order to access
3100 sites that won't let you in otherwise (though there may be a good
3101 reason in some cases). Example of this: some MSN sites will not
3105 > enter, yet forging to a
3109 > user-agent works just fine.
3110 (Must be just a silly MS goof, I'm sure :-).
3113 > This action is scheduled for improvement.
3128 >+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</PRE
3144 >8.5.14. kill-popups<A
3152 CLASS="VARIABLELIST"
3158 >Eliminate those annoying pop-up windows (deprecated)</P
3164 > While loading the document, replace JavaScript code that opens
3165 pop-up windows with (syntactically neutral) dummy code on the fly.
3185 > This action is basically a built-in, hardwired special-purpose filter
3186 action, but there are important differences: For <VAR
3190 the document need not be buffered, so it can be incrementally rendered while
3191 downloading. But <VAR
3194 > doesn't catch as many pop-ups as
3198 HREF="actions-file.html#FILTER-ALL-POPUPS"
3205 does and is not as smart as <VAR
3208 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
3211 >unsolicited-popups</VAR
3218 > Think of it as a fast and efficient replacement for a filter that you
3219 can use if you don't want any filtering at all. Note that it doesn't make
3220 sense to combine it with any <VAR
3223 HREF="actions-file.html#FILTER"
3227 since as soon as one <VAR
3230 HREF="actions-file.html#FILTER"
3234 the whole document needs to be buffered anyway, which destroys the advantage of
3238 > action over its filter equivalent.
3241 > Killing all pop-ups unconditionally is problematic. Many shops and banks rely on
3242 pop-ups to display forms, shopping carts etc, and the <VAR
3245 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
3248 >unsolicited-popups</VAR
3252 > does a fairly good job of catching only the unwanted ones.
3255 > If the only kind of pop-ups that you want to kill are exit consoles (those
3262 > windows that appear when you close an other
3263 one), you might want to use
3267 HREF="actions-file.html#FILTER"
3303 NAME="LIMIT-CONNECT"
3304 >8.5.15. limit-connect</A
3309 CLASS="VARIABLELIST"
3315 >Prevent abuse of <SPAN
3318 > as a TCP proxy relay</P
3324 > Specifies to which ports HTTP CONNECT requests are allowable.
3337 > A comma-separated list of ports or port ranges (the latter using dashes, with the minimum
3338 defaulting to 0 and the maximum to 65K).
3345 > By default, i.e. if no <VAR
3352 > only allows HTTP CONNECT
3353 requests to port 443 (the standard, secure HTTPS port). Use
3357 > if more fine-grained control is desired
3358 for some or all destinations.
3361 > The CONNECT methods exists in HTTP to allow access to secure websites
3365 > URLs) through proxies. It works very simply:
3366 the proxy connects to the server on the specified port, and then
3367 short-circuits its connections to the client and to the remote server.
3368 This can be a big security hole, since CONNECT-enabled proxies can be
3369 abused as TCP relays very easily.
3372 > If you don't know what any of this means, there probably is no reason to
3373 change this one, since the default is already very restrictive.
3377 >Example usages:</DT
3388 >+limit-connect{443} # This is the default and need not be specified.
3389 +limit-connect{80,443} # Ports 80 and 443 are OK.
3390 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
3391 +limit-connect{-} # All ports are OK (gaping security hole!)</PRE
3406 NAME="PREVENT-COMPRESSION"
3407 >8.5.16. prevent-compression</A
3412 CLASS="VARIABLELIST"
3418 > Ensure that servers send the content uncompressed, so it can be
3422 HREF="actions-file.html#FILTER"
3432 > Adds a header to the request that asks for uncompressed transfer.
3452 > More and more websites send their content compressed by default, which
3453 is generally a good idea and saves bandwidth. But for the <VAR
3456 HREF="actions-file.html#FILTER"
3462 HREF="actions-file.html#DEANIMATE-GIFS"
3469 HREF="actions-file.html#KILL-POPUPS"
3476 > needs access to the uncompressed data.
3477 Unfortunately, <SPAN
3480 > can't yet(!) uncompress, filter, and
3481 re-compress the content on the fly. So if you want to ensure that all websites, including
3482 those that normally compress, can be filtered, you need to use this action.
3485 > This will slow down transfers from those websites, though. If you use any of the above-mentioned
3486 actions, you will typically want to use <VAR
3488 >prevent-compression</VAR
3493 > Note that some (rare) ill-configured sites don't handle requests for uncompressed
3494 documents correctly (they send an empty document body). If you use <VAR
3496 >prevent-compression</VAR
3498 per default, you'll have to add exceptions for those sites. See the example for how to do that.
3502 >Example usage (sections):</DT
3515 {+prevent-compression}
3518 # Make exceptions for ill sites:
3520 {-prevent-compression}
3522 www.pclinuxonline.com</PRE
3537 NAME="SEND-VANILLA-WAFER"
3538 >8.5.17. send-vanilla-wafer</A
3543 CLASS="VARIABLELIST"
3549 > Feed log analysis scripts with useless data.
3556 > Sends a cookie with each request stating that you do not accept any copyright
3557 on cookies sent to you, and asking the site operator not to track you.
3577 > The vanilla wafer is a (relatively) unique header and could conceivably be used to track you.
3580 > This action is rarely used and not enabled in the default configuration.
3595 >+send-vanilla-wafer</PRE
3611 >8.5.18. send-wafer</A
3616 CLASS="VARIABLELIST"
3622 > Send custom cookies or feed log analysis scripts with even more useless data.
3629 > Sends a custom, user-defined cookie with each request.
3642 > A string of the form <SPAN
3658 > Being multi-valued, multiple instances of this action can apply to the same request,
3659 resulting in multiple cookies being sent.
3662 > This action is rarely used and not enabled in the default configuration.
3666 >Example usage (section):</DT
3677 >{+send-wafer{UsingPrivoxy=true}}
3678 my-internal-testing-server.void</PRE
3693 NAME="SESSION-COOKIES-ONLY"
3694 >8.5.19. session-cookies-only</A
3699 CLASS="VARIABLELIST"
3705 > Allow only temporary <SPAN
3708 > cookies (for the current
3709 browser session <SPAN
3727 >"Set-Cookie:"</SPAN
3729 server headers. Most browsers will not store such cookies permanently and
3730 forget them in between sessions.
3750 > This is less strict than <VAR
3753 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3754 >crunch-incoming-cookies</A
3760 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3761 >crunch-outgoing-cookies</A
3763 > and allows you to browse
3764 websites that insist or rely on setting cookies, without compromising your privacy too badly.
3767 > Most browsers will not permanently store cookies that have been processed by
3770 >session-cookies-only</VAR
3771 > and will forget about them between sessions.
3772 This makes profiling cookies useless, but won't break sites which require cookies so
3773 that you can log in for transactions. This is generally turned on for all
3774 sites, and is the recommended setting.
3785 >session-cookies-only</VAR
3790 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
3791 >crunch-incoming-cookies</A
3797 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
3798 >crunch-outgoing-cookies</A
3800 >. If you do, cookies
3801 will be plainly killed.
3804 > Note that it is up to the browser how it handles such cookies without an <SPAN
3808 field. If you use an exotic browser, you might want to try it out to be sure.
3811 > This setting also has no effect on cookies that may have been stored
3812 previously by the browser before starting <SPAN
3816 These would have to be removed manually.
3824 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
3825 >content-cookies filter</A
3827 to block some types of cookies. Content cookies are not effected by
3830 >session-cookies-only</VAR
3846 >+session-cookies-only</PRE
3861 NAME="SET-IMAGE-BLOCKER"
3862 >8.5.20. set-image-blocker</A
3867 CLASS="VARIABLELIST"
3873 >Choose the replacement for blocked images</P
3879 > This action alone doesn't do anything noticeable. If <SPAN
3889 HREF="actions-file.html#BLOCK"
3901 HREF="actions-file.html#HANDLE-AS-IMAGE"
3911 apply, i.e. if the request is to be blocked as an image,
3918 > the parameter of this action decides what will be
3919 sent as a replacement.
3939 > to send a built-in checkerboard pattern image. The image is visually
3940 decent, scales very well, and makes it obvious where banners were busted.
3948 > to send a built-in transparent image. This makes banners disappear
3949 completely, but makes it hard to detect where <SPAN
3953 images on a given page and complicates troubleshooting if <SPAN
3957 has blocked innocent images, like navigation icons.
3969 send a redirect to <VAR
3973 to any image anywhere, even in your local filesystem (via <SPAN
3979 > A good application of redirects is to use special <SPAN
3983 URLs, which send the built-in images, as <VAR
3987 This has the same visual effect as specifying <SPAN
3994 the first place, but enables your browser to cache the replacement image, instead of requesting
3995 it over and over again.
4004 > The URLs for the built-in images are <SPAN
4006 >"http://config.privoxy.org/send-banner?type=<VAR
4023 > There is a third (advanced) type, called <SPAN
4035 >set-image-blocker</VAR
4036 >, but meant for use from <A
4037 HREF="filter-file.html"
4040 Auto will select the type of image that would have applied to the referring page, had it been an image.
4058 >+set-image-blocker{pattern}</PRE
4065 > Redirect to the BSD devil:
4076 >+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}</PRE
4083 > Redirect to the built-in pattern for better caching:
4094 >+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}</PRE
4113 > Note that many of these actions have the potential to cause a page to
4114 misbehave, possibly even not to display at all. There are many ways
4115 a site designer may choose to design his site, and what HTTP header
4116 content, and other criteria, he may depend on. There is no way to have hard
4117 and fast rules for all sites. See the <A
4118 HREF="appendix.html#ACTIONSANAT"
4120 > for a brief example on troubleshooting
4143 >, can be defined by combining other actions.
4144 These can in turn be invoked just like the built-in actions.
4145 Currently, an alias name can contain any character except space, tab,
4163 > that you only use <SPAN
4183 Alias names are not case sensitive, and are not required to start with a
4190 > sign, since they are merely textually
4193 > Aliases can be used throughout the actions file, but they <SPAN
4198 defined in a special section at the top of the file!</I
4201 And there can only be one such section per actions file. Each actions file may
4202 have its own alias section, and the aliases defined in it are only visible
4203 within that file.</P
4205 > There are two main reasons to use aliases: One is to save typing for frequently
4206 used combinations of actions, the other one is a gain in flexibility: If you
4207 decide once how you want to handle shops by defining an alias called
4211 >, you can later change your policy on shops in
4218 > place, and your changes will take effect everywhere
4219 in the actions file where the <SPAN
4222 > alias is used. Calling aliases
4223 by their purpose also makes your actions files more readable.</P
4225 > Currently, there is one big drawback to using aliases, though:
4229 >'s built-in web-based action file
4230 editor honors aliases when reading the actions files, but it expands
4231 them before writing. So the effects of your aliases are of course preserved,
4232 but the aliases themselves are lost when you edit sections that use aliases
4234 This is likely to change in future versions of <SPAN
4239 > Now let's define some aliases...</P
4249 > # Useful custom aliases we can use later.
4251 # Note the (required!) section header line and that this section
4252 # must be at the top of the actions file!
4256 # These aliases just save typing later:
4257 # (Note that some already use other aliases!)
4259 +crunch-all-cookies = +<A
4260 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4261 >crunch-incoming-cookies</A
4263 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4264 >crunch-outgoing-cookies</A
4266 -crunch-all-cookies = -<A
4267 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4268 >crunch-incoming-cookies</A
4270 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4271 >crunch-outgoing-cookies</A
4273 block-as-image = +block +handle-as-image
4274 mercy-for-cookies = -crunch-all-cookies -<A
4275 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4276 >session-cookies-only</A
4278 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4279 >filter{content-cookies}</A
4282 # These aliases define combinations of actions
4283 # that are useful for certain types of sites:
4286 HREF="actions-file.html#BLOCK"
4289 HREF="actions-file.html#FILTER"
4291 > -crunch-all-cookies -<A
4292 HREF="actions-file.html#FAST-REDIRECTS"
4295 HREF="actions-file.html#HIDE-REFERER"
4298 HREF="actions-file.html#KILL-POPUPS"
4301 shop = -crunch-all-cookies -<A
4302 HREF="actions-file.html#FILTER-ALL-POPUPS"
4303 >filter{all-popups}</A
4305 HREF="actions-file.html#KILL-POPUPS"
4309 # Short names for other aliases, for really lazy people ;-)
4311 c0 = +crunch-all-cookies
4312 c1 = -crunch-all-cookies</PRE
4318 > ...and put them to use. These sections would appear in the lower part of an
4319 actions file and define exceptions to the default actions (as specified further
4333 > # These sites are either very complex or very keen on
4334 # user data and require minimal interference to work:
4337 .office.microsoft.com
4338 .windowsupdate.microsoft.com
4342 # Allow cookies (for setting and retrieving your customer data)
4346 .worldpay.com # for quietpc.com
4349 # These shops require pop-ups:
4351 {shop -kill-popups -filter{all-popups}}
4353 .overclockers.co.uk</PRE
4359 > Aliases like <SPAN
4365 > are often used for
4369 > sites that require some actions to be disabled
4370 in order to function properly.</P
4378 >8.7. Actions Files Tutorial</A
4381 > The above chapters have shown <A
4382 HREF="actions-file.html"
4383 >which actions files
4384 there are and how they are organized</A
4385 >, how actions are <A
4386 HREF="actions-file.html#ACTIONS"
4389 HREF="actions-file.html#ACTIONS-APPLY"
4393 HREF="actions-file.html#AF-PATTERNS"
4397 HREF="actions-file.html#ALIASES"
4399 >. Now, let's look at an
4407 file and see how all these pieces come together:</P
4414 >8.7.1. default.action</A
4417 >Every config file should start with a short comment stating its purpose:</P
4427 ># Sample default.action file <developers@privoxy.org></PRE
4433 >Then, since this is the <TT
4437 first section is a special section for internal use that you needn't
4438 change or worry about:</P
4448 >##########################################################################
4449 # Settings -- Don't change! For internal Privoxy use ONLY.
4450 ##########################################################################
4453 for-privoxy-version=3.0</PRE
4459 >After that comes the (optional) alias section. We'll use the example
4460 section from the above <A
4461 HREF="actions-file.html#ALIASES"
4462 >chapter on aliases</A
4464 that also explains why and how aliases are used:</P
4474 >##########################################################################
4476 ##########################################################################
4479 # These aliases just save typing later:
4480 # (Note that some already use other aliases!)
4482 +crunch-all-cookies = +<A
4483 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4484 >crunch-incoming-cookies</A
4486 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4487 >crunch-outgoing-cookies</A
4489 -crunch-all-cookies = -<A
4490 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4491 >crunch-incoming-cookies</A
4493 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4494 >crunch-outgoing-cookies</A
4496 block-as-image = +block +handle-as-image
4497 mercy-for-cookies = -crunch-all-cookies -<A
4498 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4499 >session-cookies-only</A
4501 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4502 >filter{content-cookies}</A
4505 # These aliases define combinations of actions
4506 # that are useful for certain types of sites:
4509 HREF="actions-file.html#BLOCK"
4512 HREF="actions-file.html#FILTER"
4514 > -crunch-all-cookies -<A
4515 HREF="actions-file.html#FAST-REDIRECTS"
4518 HREF="actions-file.html#HIDE-REFERER"
4521 HREF="actions-file.html#KILL-POPUPS"
4524 shop = -crunch-all-cookies -<A
4525 HREF="actions-file.html#FILTER-ALL-POPUPS"
4526 >filter{all-popups}</A
4528 HREF="actions-file.html#KILL-POPUPS"
4536 > Now come the regular sections, i.e. sets of actions, accompanied
4537 by URL patterns to which they apply. Remember <SPAN
4542 are disabled when matching starts</I
4544 >, so we have to explicitly
4545 enable the ones we want.</P
4547 > The first regular section is probably the most important. It has only
4556 HREF="actions-file.html#AF-PATTERNS"
4557 >matches all URLs</A
4559 set of actions used in this <SPAN
4567 be applied to all requests as a start</I
4569 >. It can be partly or
4570 wholly overridden by later matches further down this file, or in user.action,
4571 but it will still be largely responsible for your overall browsing
4574 > Again, at the start of matching, all actions are disabled, so there is
4575 no real need to disable any actions here, but we will do that nonetheless,
4576 to have a complete listing for your reference. (Remember: a <SPAN
4580 preceding the action name enables the action, a <SPAN
4584 Also note how this long line has been made more readable by splitting it into
4585 multiple lines with line continuation.</P
4595 >##########################################################################
4596 # "Defaults" section:
4597 ##########################################################################
4600 HREF="actions-file.html#ADD-HEADER"
4604 HREF="actions-file.html#BLOCK"
4608 HREF="actions-file.html#CRUNCH-INCOMING-COOKIES"
4609 >crunch-incoming-cookies</A
4612 HREF="actions-file.html#CRUNCH-OUTGOING-COOKIES"
4613 >crunch-outgoing-cookies</A
4616 HREF="actions-file.html#DEANIMATE-GIFS"
4620 HREF="actions-file.html#DOWNGRADE-HTTP-VERSION"
4621 >downgrade-http-version</A
4624 HREF="actions-file.html#FAST-REDIRECTS"
4628 HREF="actions-file.html#FILTER-JS-ANNOYANCES"
4629 >filter{js-annoyances}</A
4632 HREF="actions-file.html#FILTER-JS-EVENTS"
4633 >filter{js-events}</A
4636 HREF="actions-file.html#FILTER-HTML-ANNOYANCES"
4637 >filter{html-annoyances}</A
4640 HREF="actions-file.html#FILTER-CONTENT-COOKIES"
4641 >filter{content-cookies}</A
4644 HREF="actions-file.html#FILTER-REFRESH-TAGS"
4645 >filter{refresh-tags}</A
4648 HREF="actions-file.html#FILTER-UNSOLICITED-POPUPS"
4649 >filter{unsolicited-popups}</A
4652 HREF="actions-file.html#FILTER-ALL-POPUPS"
4653 >filter{all-popups}</A
4656 HREF="actions-file.html#FILTER-IMG-REORDER"
4657 >filter{img-reorder}</A
4660 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
4661 >filter{banners-by-size}</A
4664 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
4665 >filter{banners-by-link}</A
4668 HREF="actions-file.html#FILTER-WEBBUGS"
4672 HREF="actions-file.html#FILTER-TINY-TEXTFORMS"
4673 >filter{tiny-textforms}</A
4676 HREF="actions-file.html#FILTER-JUMPING-WINDOWS"
4677 >filter{jumping-windows}</A
4680 HREF="actions-file.html#FILTER-FRAMESET-BORDERS"
4681 >filter{frameset-borders}</A
4684 HREF="actions-file.html#FILTER-DEMORONIZER"
4685 >filter{demoronizer}</A
4688 HREF="actions-file.html#FILTER-SHOCKWAVE-FLASH"
4689 >filter{shockwave-flash}</A
4692 HREF="actions-file.html#FILTER-QUICKTIME-KIOSKMODE"
4693 >filter{quicktime-kioskmode}</A
4696 HREF="actions-file.html#FILTER-FUN"
4700 HREF="actions-file.html#FILTER-CRUDE-PARENTAL"
4701 >filter{crude-parental}</A
4704 HREF="actions-file.html#FILTER-IE-EXPLOITS"
4705 >filter{ie-exploits}</A
4708 HREF="actions-file.html#HANDLE-AS-IMAGE"
4712 HREF="actions-file.html#HIDE-FORWARDED-FOR-HEADERS"
4713 >hide-forwarded-for-headers</A
4716 HREF="actions-file.html#HIDE-FROM-HEADER"
4717 >hide-from-header{block}</A
4720 HREF="actions-file.html#HIDE-REFERER"
4721 >hide-referrer{forge}</A
4724 HREF="actions-file.html#HIDE-USER-AGENT"
4728 HREF="actions-file.html#KILL-POPUPS"
4732 HREF="actions-file.html#LIMIT-CONNECT"
4736 HREF="actions-file.html#PREVENT-COMPRESSION"
4737 >prevent-compression</A
4740 HREF="actions-file.html#SEND-VANILLA-WAFER"
4741 >send-vanilla-wafer</A
4744 HREF="actions-file.html#SEND-WAFER"
4748 HREF="actions-file.html#SESSION-COOKIES-ONLY"
4749 >session-cookies-only</A
4752 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4753 >set-image-blocker{pattern}</A
4756 / # forward slash will match *all* potential URL patterns.</PRE
4762 > The default behavior is now set. Note that some actions, like not hiding
4763 the user agent, are part of a <SPAN
4765 >"general policy"</SPAN
4767 universally and won't get any exceptions defined later. Other choices,
4768 like not blocking (which is <SPAN
4775 default!) need exceptions, i.e. we need to specify explicitly what we
4776 want to block in later sections.</P
4778 > The first of our specialized sections is concerned with <SPAN
4782 sites, i.e. sites that require minimum interference, because they are either
4783 very complex or very keen on tracking you (and have mechanisms in place that
4784 make them unusable for people who avoid being tracked). We will simply use
4785 our pre-defined <VAR
4788 > alias instead of stating the list
4789 of actions explicitly:</P
4799 >##########################################################################
4800 # Exceptions for sites that'll break under the default action set:
4801 ##########################################################################
4803 # "Fragile" Use a minimum set of actions for these sites (see alias above):
4806 .office.microsoft.com # surprise, surprise!
4807 .windowsupdate.microsoft.com</PRE
4813 > Shopping sites are not as fragile, but they typically
4814 require cookies to log in, and pop-up windows for shopping
4815 carts or item details. Again, we'll use a pre-defined alias:</P
4829 .worldpay.com # for quietpc.com
4840 HREF="actions-file.html#FAST-REDIRECTS"
4844 action, which we enabled per default above, breaks some sites. So disable
4845 it for popular sites where we know it misbehaves:</P
4856 HREF="actions-file.html#FAST-REDIRECTS"
4862 .altavista.com/.*(like|url|link):http
4863 .altavista.com/trans.*urltext=http
4870 > It is important that <SPAN
4874 URLs belong to images, so that <SPAN
4881 be blocked, a substitute image can be sent, rather than an HTML page.
4882 Contacting the remote site to find out is not an option, since it
4883 would destroy the loading time advantage of banner blocking, and it
4884 would feed the advertisers (in terms of money <SPAN
4891 information). We can mark any URL as an image with the <VAR
4894 HREF="actions-file.html#HANDLE-AS-IMAGE"
4898 and marking all URLs that end in a known image file extension is a
4909 >##########################################################################
4911 ##########################################################################
4913 # Define which file types will be treated as images, in case they get
4914 # blocked further down this file:
4917 HREF="actions-file.html#HANDLE-AS-IMAGE"
4920 /.*\.(gif|jpe?g|png|bmp|ico)$</PRE
4926 > And then there are known banner sources. They often use scripts to
4927 generate the banners, so it won't be visible from the URL that the
4928 request is for an image. Hence we block them <SPAN
4935 mark them as images in one go, with the help of our
4938 >block-as-image</VAR
4939 > alias defined above. (We could of
4940 course just as well use <VAR
4943 HREF="actions-file.html#BLOCK"
4947 HREF="actions-file.html#HANDLE-AS-IMAGE"
4951 Remember that the type of the replacement image is chosen by the
4955 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4956 >set-image-blocker</A
4959 action. Since all URLs have matched the default section with its
4963 HREF="actions-file.html#SET-IMAGE-BLOCKER"
4964 >set-image-blocker</A
4967 action before, it still applies and needn't be repeated:</P
4977 ># Known ad generators:
4982 .ad.*.doubleclick.net
4983 .a.yimg.com/(?:(?!/i/).)*$
4984 .a[0-9].yimg.com/(?:(?!/i/).)*$
4993 > One of the most important jobs of <SPAN
4997 is to block banners. A huge bunch of them are already <SPAN
5004 HREF="actions-file.html#FILTER"
5006 >{banners-by-size}</VAR
5008 action, which we enabled above, and which deletes the references to banner
5009 images from the pages while they are loaded, so the browser doesn't request
5010 them anymore, and hence they don't need to be blocked here. But this naturally
5011 doesn't catch all banners, and some people choose not to use filters, so we
5012 need a comprehensive list of patterns for banner URLs here, and apply the
5016 HREF="actions-file.html#BLOCK"
5019 > action to them.</P
5021 > First comes a bunch of generic patterns, which do most of the work, by
5022 matching typical domain and path name components of banners. Then comes
5023 a list of individual patterns for specific sites, which is omitted here
5024 to keep the example short:</P
5034 >##########################################################################
5035 # Block these fine banners:
5036 ##########################################################################
5038 HREF="actions-file.html#BLOCK"
5048 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
5049 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
5051 # Site-specific patterns (abbreviated):
5059 > You wouldn't believe how many advertisers actually call their banner
5063 >.com, or call the directory
5064 in which the banners are stored simply <SPAN
5068 generic patterns are surprisingly effective.</P
5070 > But being very generic, they necessarily also catch URLs that we don't want
5071 to block. The pattern <VAR
5083 >.nasty-corp.com"</SPAN
5093 >.sourcefroge.net"</SPAN
5103 >l.some-provider.net."</SPAN
5105 well-known exceptions to the <VAR
5108 HREF="actions-file.html#BLOCK"
5114 > Note that these are exceptions to exceptions from the default! Consider the URL
5117 >"downloads.sourcefroge.net"</SPAN
5118 >: Initially, all actions are deactivated,
5119 so it wouldn't get blocked. Then comes the defaults section, which matches the
5120 URL, but just deactivates the <VAR
5123 HREF="actions-file.html#BLOCK"
5127 action once again. Then it matches <VAR
5130 >, an exception to the
5131 general non-blocking policy, and suddenly
5135 HREF="actions-file.html#BLOCK"
5138 > applies. And now, it'll match
5145 HREF="actions-file.html#BLOCK"
5149 applies, so (unless it matches <SPAN
5155 > further down) it ends up
5159 HREF="actions-file.html#BLOCK"
5162 > action applying.</P
5172 >##########################################################################
5173 # Save some innocent victims of the above generic block patterns:
5174 ##########################################################################
5179 HREF="actions-file.html#BLOCK"
5182 adv[io]*. # (for advogato.org and advice.*)
5183 adsl. # (has nothing to do with ads)
5184 ad[ud]*. # (adult.* and add.*)
5185 .edu # (universities don't host banners (yet!))
5186 .*loads. # (downloads, uploads etc)
5194 www.globalintersec.com/adv # (adv = advanced)
5195 www.ugu.com/sui/ugu/adv</PRE
5201 > Filtering source code can have nasty side effects,
5202 so make an exception for our friends at sourceforge.net,
5203 and all paths with <SPAN
5206 > in them. Note that
5210 HREF="actions-file.html#FILTER"
5220 > filters in one fell swoop!</P
5230 ># Don't filter code!
5233 HREF="actions-file.html#FILTER"
5237 .sourceforge.net</PRE
5247 comprehensive, but we hope this example made clear how it works.</P
5255 >8.7.2. user.action</A
5258 > So far we are painting with a broad brush by setting general policies,
5259 which would be a reasonable starting point for many people. Now,
5260 you might want to be more specific and have customized rules that
5261 are more suitable to your personal habits and preferences. These would
5262 be for narrowly defined situations like your ISP or your bank, and should
5266 >, which is parsed after all other
5267 actions files and hence has the last word, over-riding any previously
5268 defined actions. <TT
5278 > place for your personal settings, since
5282 > is actively maintained by the
5286 > developers and you'll probably want
5287 to install updated versions from time to time.</P
5289 > So let's look at a few examples of things that one might typically do in
5303 ># My user.action file. <fred@foobar.com></PRE
5310 HREF="actions-file.html#ALIASES"
5312 > are local to the actions
5313 file that they are defined in, you can't use the ones from
5317 >, unless you repeat them here:</P
5327 ># Aliases are local to the file they are defined in.
5328 # (Re-)define aliases for this file:
5332 # These aliases just save typing later, and the alias names should
5333 # be self explanatory.
5335 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5336 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5337 allow-all-cookies = -crunch-all-cookies -session-cookies-only
5338 allow-popups = -filter{all-popups} -kill-popups
5339 +block-as-image = +block +handle-as-image
5340 -block-as-image = -block
5342 # These aliases define combinations of actions that are useful for
5343 # certain types of sites:
5345 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
5346 shop = -crunch-all-cookies allow-popups
5348 # Allow ads for selected useful free sites:
5350 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}</PRE
5358 > Say you have accounts on some sites that you visit regularly, and
5359 you don't want to have to log in manually each time. So you'd like
5360 to allow persistent cookies for these sites. The
5363 >allow-all-cookies</VAR
5364 > alias defined above does exactly
5365 that, i.e. it disables crunching of cookies in any direction, and the
5366 processing of cookies to make them only temporary.</P
5376 >{ allow-all-cookies }
5388 > Your bank is allergic to some filter, but you don't know which, so you disable them all:</P
5399 HREF="actions-file.html#FILTER"
5402 .your-home-banking-site.com</PRE
5408 > Some file types you may not want to filter for various reasons:</P
5418 ># Technical documentation is likely to contain strings that might
5419 # erroneously get altered by the JavaScript-oriented filters:
5424 # And this stupid host sends streaming video with a wrong MIME type,
5425 # so that Privoxy thinks it is getting HTML and starts filtering:
5427 stupid-server.example.com/</PRE
5433 > Example of a simple <A
5434 HREF="actions-file.html#BLOCK"
5436 > action. Say you've
5437 seen an ad on your favourite page on example.com that you want to get rid of.
5438 You have right-clicked the image, selected <SPAN
5440 >"copy image location"</SPAN
5442 and pasted the URL below while removing the leading http://, into a
5446 > section. Note that <VAR
5450 > need not be specified, since all URLs ending in
5454 > will be tagged as images by the general rules as set
5455 in default.action anyway:</P
5466 HREF="actions-file.html#BLOCK"
5469 www.example.com/nasty-ads/sponsor.gif
5470 another.popular.site.net/more/junk/here/</PRE
5476 > The URLs of dynamically generated banners, especially from large banner
5477 farms, often don't use the well-known image file name extensions, which
5478 makes it impossible for <SPAN
5482 the file type just by looking at the URL.
5483 You can use the <VAR
5485 >+block-as-image</VAR
5486 > alias defined above for
5488 Note that objects which match this rule but then turn out NOT to be an
5489 image are typically rendered as a <SPAN
5491 >"broken image"</SPAN
5493 browser. Use cautiously.</P
5503 >{ +block-as-image }
5512 > Now you noticed that the default configuration breaks Forbes Magazine,
5513 but you were too lazy to find out which action is the culprit, and you
5514 were again too lazy to give <A
5518 you just used the <VAR
5521 > alias on the site, and
5528 > -- it worked. The <VAR
5532 aliases disables those actions that are most likely to break a site. Also,
5533 good for testing purposes to see if it is <SPAN
5537 that is causing the problem or not.</P
5554 > You like the <SPAN
5557 > text replacements in <TT
5561 but it is disabled in the distributed actions file. (My colleagues on the team just
5562 don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private,
5563 update-safe config, once and for all:</P
5574 HREF="actions-file.html#FILTER-FUN"
5577 / # For ALL sites!</PRE
5583 > Note that the above is not really a good idea: There are exceptions
5584 to the filters in <TT
5588 really shouldn't be filtered, like code on CVS->Web interfaces. Since
5592 > has the last word, these exceptions
5593 won't be valid for the <SPAN
5596 > filtering specified here.</P
5598 > You might also worry about how your favourite free websites are
5599 funded, and find that they rely on displaying banner advertisements
5600 to survive. So you might want to specifically allow banners for those
5601 sites that you feel provide value to you:</P
5623 > has been aliased to
5627 HREF="actions-file.html#BLOCK"
5634 HREF="actions-file.html#FILTER-BANNERS-BY-SIZE"
5635 >filter{banners-by-size}</A
5641 HREF="actions-file.html#FILTER-BANNERS-BY-LINK"
5642 >filter{banners-by-link}</A
5649 > is generally the best place to define
5650 exceptions and additions to the default policies of
5654 >. Some actions are safe to have their
5655 default policies set here though. So let's set a default policy to have a
5659 > image as opposed to the checkerboard pattern for
5669 > of course matches all URL
5670 paths and patterns:</P
5681 HREF="actions-file.html#SET-IMAGE-BLOCKER"
5682 >set-image-blocker{blank}</A
5697 SUMMARY="Footer navigation table"
5726 HREF="filter-file.html"
5736 >The Main Configuration File</TD
5746 >The Filter File</TD