X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=doc%2Fsource%2Fuser-manual.sgml;h=541c562d6a9b968306fcbba5de6fa2c2750e5671;hp=a882281eca2854cbd3eab826aca3ffe38c140dee;hb=70b9ed04dec24ef32a00a14dbe2a1556275e9bd3;hpb=4a195e841c32cf0223782e33b797e4cc79454117 diff --git a/doc/source/user-manual.sgml b/doc/source/user-manual.sgml index a882281e..541c562d 100644 --- a/doc/source/user-manual.sgml +++ b/doc/source/user-manual.sgml @@ -11,11 +11,11 @@ - - + + - - + + @@ -24,6 +24,7 @@ + Privoxy"> ]> - Copyright &my-copy; 2001 - 2007 by + Copyright &my-copy; 2001-2010 by Privoxy Developers -$Id: user-manual.sgml,v 2.41 2007/11/11 16:32:11 hal9 Exp $ +$Id: user-manual.sgml,v 2.121 2010/02/15 15:30:13 fabiankeil Exp $ @@ -210,7 +211,7 @@ How to install the binary packages depends on your operating system: -Debian +Debian and Ubuntu DEBs can be installed with apt-get install privoxy, and will use /etc/privoxy for the location of @@ -298,32 +299,24 @@ How to install the binary packages depends on your operating system: -Mac OSX - - Unzip the downloaded file (you can either double-click on the file - from the finder, or from the desktop if you downloaded it there). - Then, double-click on the package installer icon named - Privoxy.pkg - and follow the installation process. - Privoxy will be installed in the folder - /Library/Privoxy. - It will start automatically whenever you start up. To prevent it from - starting automatically, remove or rename the folder - /Library/StartupItems/Privoxy. - +Mac OS X - To start Privoxy by hand, double-click on - StartPrivoxy.command in the - /Library/Privoxy folder. - Or, type this command in the Terminal: + Unzip the downloaded file (you can either double-click on the zip file + icon from the Finder, or from the desktop if you downloaded it there). + Then, double-click on the package installer icon and follow the + installation process. - - /Library/Privoxy/StartPrivoxy.command - + The privoxy service will automatically start after a successful + installation (in addition to every time your computer starts up). To + prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named + /Library/StartupItems/Privoxy. - You will be prompted for the administrator password. + To manually start or stop the privoxy service, use the Privoxy Utility + for Mac OS X. This application controls the privoxy service (e.g. + starting and stopping the service as well as uninstalling the software). @@ -366,7 +359,7 @@ How to install the binary packages depends on your operating system: Before installing Privoxy under Gentoo just do - first emerge rsync to get the latest changes from the + first emerge --sync to get the latest changes from the Portage tree. With emerge privoxy you install the latest version. @@ -444,302 +437,439 @@ How to install the binary packages depends on your operating system: What's New in this Release - There are many improvements and new features since Privoxy 3.0.6, the last stable release: + Privoxy 3.0.16 is a stable release. + The changes since 3.0.15 beta are: - Two new actions server-header-tagger - and client-header-tagger - that can be used to apply arbitrary tags to - each request's headers. These tags can then - subsequently be used by other actions, greatly increasing - &my-app;'s flexibity and selectivity. See tag patterns for more on tags. - - - - - - - Header filtering can be done with dedicated header filters now. As a result - the actions filter-client-headers and filter-server-headers - that were introduced with Privoxy 3.0.5 to apply - the content filters to the headers as, well have been removed again. - See the new actions server-header-filter - and client-header-filter. - - - - - There are four new options for the main config file: - - - - - - allow-cgi-request-crunching - which allows requests for Privoxy's internal CGI pages to be - blocked, redirected or (un)trusted like ordinary requests. - - - - - split-large-forms - that will work around a browser bug that caused IE6 and IE7 to - ignore the Submit button on the Privoxy's edit-actions-for-url CGI - page. - - - - - accept-intercepted-requests - which will combine Privoxy with any packet filter to create an intercepting - proxy for HTTP/1.1 requests (and for HTTP/1.0 requests with Host - header set) so that explicitly setting the browser's proxy settings - is not necessary. - - - - - templdir - to designate an alternate location for Privoxy's own CGI templates - to make sure any locally customized templates aren't overwritten - during upgrades. - - - - - + Added the config file option handle-as-empty-doc-returns-ok to + work around Firefox bug #492459, which causes Firefox to hang + if JavaScripts are blocked in certain situations. The option is + enabled in the default config file. + + - A new command line option --pre-chroot-nslookup hostname to - initialize the resolver library before chroot'ing. On some systems this - reduces the number of files that must be copied into the chroot tree. - (Patch provided by Stephen Gildea) + Added the config file option default-server-timeout to control the + assumed default server timeout. Since Privoxy no longer returns + an error message for connection resets on reused client connections, + assuming larger server timeout values appears to actually work + pretty well as long as connections aren't shared. - - The forward-override action - allows changing of the forwarding settings based on client headers like the - User-Agent, or the request origin. - + Added optional support for FreeBSD's accf_http(9). Use the + configure option --enable-accept-filter to enable it. + - - The redirect action can now use regular - expression substitutions against the original URL. + Added fancier Privoxy icons for win32. Contributed by Jeff H. - - zlib support is now available as a compile - time option for compressed documents. + In daemon mode, fd 0, 1 and 2 are bound to /dev/null. - - - Improve various filters, and add new ones. + + + Resolve localhost using whatever address family the operating + system feels like. Previous betas would try to use IPv4 as this + is what most users expect, but this didn't work reliable on + GNU/Linux systems. - - - Include support for RFC 3253 so that Subversion works - with &my-app;. + In the action lists on CGI pages, actions and their parameters are + no longer separated with a space. The action file parser doesn't + actually allow this and will throw an invalid syntax error if actions + and parameters in the action files are separated. Not adding the + spaces means copy and pasting CGI output into the action files works. - - Logging can be turned on or off. + The default keep-alive timeout has been reduced to 5 seconds to work + around hangs in clients that treat the proxy like any other host and + stop allowing any new connections if the "maximum number of + connections per host" is reached. - - - A number of improvements to Privoxy's internal CGI pages, including the - use of favicons for error and control pages. + Several webbug URLs that look like they are leading to images are now + blocked as image instead of empty documents. Doing the latter causes + WebKit-based clients to show a "missing image" icon which may mess up + the layout. + + + + + The no-such-domain template if used if for DNS resolution + problems with FEATURE_IPV6_SUPPORT enabled. Previously the + connect-failed template was used. Reported by 'zebul666'. + + + + + Accepts quoted expiration dates even though RFC 2109 10.1.2 + doesn't seem to allow them. Reported anonymously. + + + + + Don't try to forget connections if connection sharing is disabled. + This wasn't a real problem but caused an unnecessary log message. + + + + + The still undocumented --enable-extended-host-patterns configure + option has a better description. + + + + + Fixed an error message that would claim a write to the server + failed when actually writing to the client failed. + + + + + Log the crunch reason before trying to write to the client. + The log is easier to read that way. + + + + + Several log messages about client connections also mention + the socket number. + + + + + handle-as-empty-document no longer depends on the image blocking + code being enabled. - - Many bugfixes, memory leaks addressed, code improvements, and logging - improvments. + Privoxy-Log-Parser is roughly 40% faster in highlighting mode. + + + uagen, a Firefox User-Agent generator for Privoxy and Mozilla + browsers has been imported and is available in the tarballs + tools directory. + + + + + The scripts in the tools directory treat unknown parameters + as fatal errors. + + + + + + If you missed the previous two beta versions, you may also be + interested in the additional changes since 3.0.12, the + last stable release: + - + @@ -754,52 +884,48 @@ How to install the binary packages depends on your operating system: - - Some installers may remove earlier versions completely, including - configuration files. Save any important configuration files! + + The recommended way to upgrade &my-app; is to backup your old + configuration files, install the new ones, verify that &my-app; + is working correctly and finally merge back your changes using + diff and maybe patch. + + + There are a number of new features in each &my-app; release and + most of them have to be explicitly enabled in the configuration + files. Old configuration files obviously don't do that and due + to syntax changes using old configuration files with a new + &my-app; isn't always possible anyway. - On the other hand, other installers may not overwrite any existing configuration - files, thinking you will want to do that. You may want to manually check - your saved files against the newer versions to see if the improvements have - merit, or whether there are new options that you may want to consider. - There are a number of new features, but most won't be available unless - these features are incorporated into your configuration somehow. + Note that some installers remove earlier versions completely, + including configuration files, therefore you should really save + any important configuration files! - standard.action now only includes the enabled actions. - Not all actions as before. + On the other hand, other installers don't overwrite existing configuration + files, thinking you will want to do that yourself. - + + standard.action has been merged into + the default.action file. + + - - Logging is off by default now. If you need logging, it can be turned on - in the config file. - - + + In the default configuration only fatal errors are logged now. + You can change that in the debug section + of the configuration file. You may also want to enable more verbose + logging until you verified that the new &my-app; version is working + as expected. + + @@ -812,18 +938,6 @@ How to install the binary packages depends on your operating system: - - - The filter-client-headers and - filter-server-headers actions that were introduced with - Privoxy 3.0.5 to apply the content filters to - the headers as, well have been removed and replaced with new actions. - See the What's New section above. - - - - Windows @@ -1502,21 +1612,34 @@ Example Unix startup command: -Mac OSX +Mac OS X - During installation, Privoxy is configured to - start automatically when the system restarts. To start &my-app; manually, - double-click on the StartPrivoxy.command icon in the - /Library/Privoxy folder. Or, type this command - in the Terminal: + After downloading the privoxy software, unzip the downloaded file by + double-clicking on the zip file icon. Then, double-click on the + installer package icon and follow the installation process. + + + The privoxy service will automatically start after a successful + installation. In addition, the privoxy service will automatically + start every time your computer starts up. - - /Library/Privoxy/StartPrivoxy.command - + To prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named + /Library/StartupItems/Privoxy. - You will be prompted for the administrator password. + A simple application named Privoxy Utility has been created which + enables administrators to easily start and stop the privoxy service. + + + In addition, the Privoxy Utility presents a simple way for + administrators to edit the various privoxy config files. A method + to uninstall the software is also available. + + + An administrator username and password must be supplied in order for + the Privoxy Utility to perform any of the tasks. @@ -1589,11 +1712,9 @@ must find a better place for this paragraph Another feature where you will probably want to define exceptions for trusted - sites is the popup-killing (through the +kill-popups and - +filter{popups} - actions), because your favorite shopping, banking, or leisure site may need + sites is the popup-killing (through +filter{popups}), + because your favorite shopping, banking, or leisure site may need popups (explained below). @@ -1821,8 +1942,8 @@ for details.         ▪  Toggle Privoxy on or off -         ▪  Documentation +         ▪  Documentation @@ -1897,22 +2018,23 @@ for details. - default.action (the main actions file) - is used to define which actions relating to banner-blocking, images, pop-ups, - content modification, cookie handling etc should be applied by default. It also defines many - exceptions (both positive and negative) from this default set of actions that enable - Privoxy to selectively eliminate the junk, and only the junk, on - as many websites as possible. + match-all.action is used to define which actions + relating to banner-blocking, images, pop-ups, content modification, cookie handling + etc should be applied by default. It should be the first actions file loaded. + + + default.action defines many exceptions (both positive and negative) + from the default set of actions that's configured in match-all.action. + It should be the second actions file loaded and shouldn't be edited by the user. Multiple actions files may be defined in config. These are processed in the order they are defined. Local customizations and locally - preferred exceptions to the default policies as defined in - default.action (which you will most probably want - to define sooner or later) are probably best applied in - user.action, where you can preserve them across - upgrades. standard.action is only for - Privoxy's internal use. + preferred exceptions to the default policies as defined in + match-all.action (which you will most probably want + to define sooner or later) are best applied in user.action, + where you can preserve them across upgrades. The file isn't installed by all + installers, but you can easily create it yourself with a text editor. There is also a web based editor that can be accessed from @@ -2006,6 +2128,11 @@ for details. Actions Files + + The actions files are used to define what actions Privoxy takes for which URLs, and thus determines @@ -2021,77 +2148,71 @@ for details. There are three action files included with Privoxy with differing purposes: - - - - - - - default.action - is the primary action file - that sets the initial values for all actions. It is intended to - provide a base level of functionality for - Privoxy's array of features. So it is - a set of broad rules that should work reasonably well as-is for most users. - This is the file that the developers are keeping updated, and making available to users. - The user's preferences as set in standard.action, - e.g. either Cautious (the default), - Medium, or Advanced (see - below). - - - - - user.action - is intended to be for local site - preferences and exceptions. As an example, if your ISP or your bank - has specific requirements, and need special handling, this kind of - thing should go here. This file will not be upgraded. - + + + + + + match-all.action - is used to define which + actions relating to banner-blocking, images, pop-ups, + content modification, cookie handling etc should be applied by default. + It should be the first actions file loaded + - - - standard.action - is used only by the web based editor - at - http://config.privoxy.org/edit-actions-list?f=default, - to set various pre-defined sets of rules for the default actions section - in default.action. - - - Edit Set to Cautious Set to Medium Set to Advanced - - - These have increasing levels of aggressiveness and have no - influence on your browsing unless you select them explicitly in the - editor. A default installation should be pre-set to - Cautious (versions prior to 3.0.5 were set to - Medium). New users should try this for a while before - adjusting the settings to more aggressive levels. The more aggressive - the settings, then the more likelihood there is of problems such as sites - not working as they should. - - - The Edit button allows you to turn each - action on/off individually for fine-tuning. The Cautious - button changes the actions list to low/safe settings which will activate - ad blocking and a minimal set of &my-app;'s features, and subsequently - there will be less of a chance for accidental problems. The - Medium button sets the list to a medium level of - other features and a low level set of privacy features. The - Advanced button sets the list to a high level of - ad blocking and medium level of privacy. See the chart below. The latter - three buttons over-ride any changes via with the - Edit button. More fine-tuning can be done in the - lower sections of this internal page. - - - It is not recommend to edit the standard.action file - itself. - - - The default profiles, and their associated actions, as pre-defined in - standard.action are: - - + + + default.action - defines many exceptions (both + positive and negative) from the default set of actions that's configured + in match-all.action. It is a set of rules that should + work reasonably well as-is for most users. This file is only supposed to + be edited by the developers. It should be the second actions file loaded. + + + + + user.action - is intended to be for local site + preferences and exceptions. As an example, if your ISP or your bank + has specific requirements, and need special handling, this kind of + thing should go here. This file will not be upgraded. + + + + + Edit Set to Cautious Set to Medium Set to Advanced + + + These have increasing levels of aggressiveness and have no + influence on your browsing unless you select them explicitly in the + editor. A default installation should be pre-set to + Cautious. New users should try this for a while before + adjusting the settings to more aggressive levels. The more aggressive + the settings, then the more likelihood there is of problems such as sites + not working as they should. + + + The Edit button allows you to turn each + action on/off individually for fine-tuning. The Cautious + button changes the actions list to low/safe settings which will activate + ad blocking and a minimal set of &my-app;'s features, and subsequently + there will be less of a chance for accidental problems. The + Medium button sets the list to a medium level of + other features and a low level set of privacy features. The + Advanced button sets the list to a high level of + ad blocking and medium level of privacy. See the chart below. The latter + three buttons over-ride any changes via with the + Edit button. More fine-tuning can be done in the + lower sections of this internal page. + + + While the actions file editor allows to enable these settings in all + actions files, they are only supposed to be enabled in the first one + to make sure you don't unintentionally overrule earlier rules. + + + The default profiles, and their associated actions, as pre-defined in + default.action are: + + Default Configurations @@ -2164,7 +2285,6 @@ for details. yes - GIF de-animation no @@ -2172,7 +2292,6 @@ for details. yes - Fast redirects no @@ -2204,7 +2323,7 @@ for details. Image tag reordering no - no + yes yes @@ -2213,9 +2332,9 @@ for details.
-
-
-
+
+ + The list of actions files to be used are defined in the main configuration @@ -2290,7 +2409,7 @@ for details. using our browser-based editor, which can be reached from http://config.privoxy.org/show-status. Note: the config file option enale-edit-actions must be enabled for + linkend="enable-edit-actions">enable-edit-actions must be enabled for this to work. The editor allows both fine-grained control over every single feature on a per-URL basis, and easy choosing from wholesale sets of defaults like Cautious, Medium or @@ -2341,7 +2460,7 @@ for details. - { +handle-as-image +block } + { +handle-as-image +block{Banner ads.} } # Block these as if they were images. Send no block page. banners.example.com media.example.com/.*banners @@ -2373,19 +2492,25 @@ for details. Generally, an URL pattern has the form - <domain>/<path>, where both the - <domain> and <path> are - optional. (This is why the special / pattern matches all - URLs). Note that the protocol portion of the URL pattern (e.g. - http://) should not be included in - the pattern. This is assumed already! + <domain><port>/<path>, where the + <domain>, the <port> + and the <path> are optional. (This is why the special + / pattern matches all URLs). Note that the protocol + portion of the URL pattern (e.g. http://) should + not be included in the pattern. This is assumed already! The pattern matching syntax is different for the domain and path parts of the URL. The domain part uses a simple globbing type matching technique, - while the path part uses a more flexible + while the path part uses more flexible Regular - Expressions (PCRE) based syntax. + Expressions (POSIX 1003.2). + + + The port part of a pattern is a decimal port number preceded by a colon + (:). If the domain part contains a numerical IPv6 address, + it has to be put into angle brackets + (<, >). @@ -2410,7 +2535,7 @@ for details. - www.example.com/index.html$ + www.example.com/index.html matches all the documents on www.example.com @@ -2436,6 +2561,23 @@ for details. + + :8000/ + + + Matches any URL pointing to TCP port 8000. + + + + + <2001:db8::1>/ + + + Matches any URL with the host address 2001:db8::1. + (Note that the real URL uses plain brackets, not angle brackets.) + + + index.html @@ -2463,8 +2605,11 @@ for details. .example.com - matches any domain that ENDS in - .example.com + matches any domain with first-level domain com + and second-level domain example. + For example www.example.com, + example.com and foo.bar.baz.example.com. + Note that it wouldn't match if the second-level domain was another-example. @@ -2473,7 +2618,8 @@ for details. matches any domain that STARTS with - www. + www. (It also matches the domain + www but most of the time that doesn't matter.) @@ -2560,20 +2706,16 @@ for details. The Path Pattern - Privoxy uses Perl compatible (PCRE) + Privoxy uses modern POSIX 1003.2 Regular - Expression based syntax - (through the PCRE library) for - matching the path portion (after the slash), and is thus more flexible. + Expressions for matching the path portion (after the slash), + and is thus more flexible. There is an Appendix with a brief quick-start into regular - expressions, and full (very technical) documentation on PCRE regex syntax is available on-line - at http://www.pcre.org/man.txt. - You might also find the Perl man page on regular expressions (man perlre) - useful, which is available on-line at http://perldoc.perl.org/perlre.html. + expressions, you also might want to have a look at your operating system's documentation + on regular expressions (try man re_format). @@ -2675,7 +2817,7 @@ for details. can tell them apart from URL patterns. Everything after the colon including white space, is interpreted as a regular expression with path pattern syntax, except that tag patterns aren't left-anchored - automatically (Privoxy doesn't silently add a ^, + automatically (&my-app; doesn't silently add a ^, you have to do it yourself if you need it). @@ -2701,13 +2843,15 @@ for details. - For example you could tag client requests which use the POST method, - use this tag to activate another tagger that adds a tag if cookies - are send, and then block based on the cookie tag. However if you'd - reverse the position of the described taggers, and activated the method - tagger based on the cookie tagger, no method tags would be created. + For example you could tag client requests which use the + POST method, + then use this tag to activate another tagger that adds a tag if cookies + are sent, and then use a block action based on the cookie tag. This allows + the outcome of one action, to be input into a subsequent action. However if + you'd reverse the position of the described taggers, and activated the + method tagger based on the cookie tagger, no method tags would be created. The method tagger would look for the request line, but at the time - the cookie tag is created the request line has already been parsed. + the cookie tag is created, the request line has already been parsed. @@ -2765,7 +2909,7 @@ for details. -name # disable action name - Example: +block + Example: +handle-as-image @@ -2899,6 +3043,9 @@ for details. HTTP headers are, you definitely don't need to worry about this one. + + Headers added by this action are not modified by other actions. + @@ -2948,14 +3095,14 @@ for details. Type: - Boolean. + Parameterized. Parameter: - N/A + A block reason that should be given to the user. @@ -2964,14 +3111,10 @@ for details. Privoxy sends a special BLOCKED page - for requests to blocked pages. This page contains links to find out why the request - was blocked, and a click-through to the blocked content (the latter only if compiled with the - force feature enabled). The BLOCKED page adapts to the available - screen space -- it displays full-blown if space allows, or miniaturized and text-only - if loaded into a small frame or window. If you are using Privoxy - right now, you can take a look at the - BLOCKED - page. + for requests to blocked pages. This page contains the block reason given as + parameter, a link to find out why the block action applies, and a click-through + to the blocked content (the latter only if the force feature is available and + enabled). A very important exception occurs if both @@ -3001,18 +3144,18 @@ for details. Example usage (section): - {+block} + {+block{No nasty stuff for you.}} # Block and replace with "blocked" page .nasty-stuff.example.com -{+block +handle-as-image} +{+block{Doubleclick banners.} +handle-as-image} # Block and replace with image .ad.doubleclick.net .ads.r.us/banners/ -{+block +handle-as-empty-document} +{+block{Layered ads.} +handle-as-empty-document} # Block and then ignore - adserver.exampleclick.net/.*\.js$ + adserver.example.net/.*\.js$ @@ -3022,6 +3165,76 @@ for details.
+ + +change-x-forwarded-for + + + + Typical use: + + Improve privacy by not forwarding the source of the request in the HTTP headers. + + + + + Effect: + + + Deletes the X-Forwarded-For: HTTP header from the client request, + or adds a new one. + + + + + + Type: + + + Parameterized. + + + + + Parameter: + + + + block to delete the header. + + + + add to create the header (or append + the client's IP address to an already existing one). + + + + + + + + Notes: + + + It is safe and recommended to use block. + + + Forwarding the source address of the request may make + sense in some multi-user setups but is also a privacy risk. + + + + + Example usage: + + + +change-x-forwarded-for{block} + + + + + + client-header-filter @@ -3077,6 +3290,11 @@ for details. Client-header filters are executed after the other header actions have finished and use their output as input. + + If the request URL gets changed, &my-app; will detect that and use the new + one. This can be used to rewrite the request destination behind the client's + back, for example to specify a Tor exit relay for certain requests. + Please refer to the filter file chapter to learn which client-header filters are available by default, and how to @@ -3091,8 +3309,9 @@ for details. +# Hide Tor exit notation in Host and Referer Headers {+client-header-filter{hide-tor-exit-notation}} -.exit/ +/ @@ -3168,6 +3387,25 @@ for details. # Tag every request with the User-Agent header {+client-header-tagger{user-agent}} / + +# Tagging itself doesn't change the action +# settings, sections with TAG patterns do: +# +# If it's a download agent, use a different forwarding proxy, +# show the real User-Agent and make sure resume works. +{+forward-override{forward-socks5 10.0.0.2:2222 .} \ + -hide-if-modified-since \ + -overwrite-last-modified \ + -hide-user-agent \ + -filter \ + -deanimate-gifs \ +} +TAG:^User-Agent: NetBSD-ftp/ +TAG:^User-Agent: Novell ZYPP Installer +TAG:^User-Agent: RPM APT-HTTP/ +TAG:^User-Agent: fetch libfetch/ +TAG:^User-Agent: Ubuntu APT-HTTP/ +TAG:^User-Agent: MPlayer/ @@ -4064,23 +4302,23 @@ problem-host.example.com - +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse + +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse. - +filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites) + +filter{js-events} # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites). - +filter{html-annoyances} # Get rid of particularly annoying HTML abuse + +filter{html-annoyances} # Get rid of particularly annoying HTML abuse. - +filter{content-cookies} # Kill cookies that come in the HTML or JS content + +filter{content-cookies} # Kill cookies that come in the HTML or JS content. - +filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups) + +filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups). @@ -4092,43 +4330,43 @@ problem-host.example.com - +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective + +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective. - +filter{banners-by-size} # Kill banners by size + +filter{banners-by-size} # Kill banners by size. - +filter{banners-by-link} # Kill banners by their links to known clicktrackers + +filter{banners-by-link} # Kill banners by their links to known clicktrackers. - +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking) + +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking). - +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap + +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap. - +filter{jumping-windows} # Prevent windows from resizing and moving themselves + +filter{jumping-windows} # Prevent windows from resizing and moving themselves. - +filter{frameset-borders} # Give frames a border and make them resizeable + +filter{frameset-borders} # Give frames a border and make them resizable. - +filter{demoronizer} # Fix MS's non-standard use of standard charsets + +filter{demoronizer} # Fix MS's non-standard use of standard charsets. - +filter{shockwave-flash} # Kill embedded Shockwave Flash objects + +filter{shockwave-flash} # Kill embedded Shockwave Flash objects. - +filter{quicktime-kioskmode} # Make Quicktime movies savable + +filter{quicktime-kioskmode} # Make Quicktime movies saveable. @@ -4136,35 +4374,35 @@ problem-host.example.com - +filter{crude-parental} # Crude parental filtering (demo only) + +filter{crude-parental} # Crude parental filtering. Note that this filter doesn't work reliably. - +filter{ie-exploits} # Disable a known Internet Explorer bug exploits + +filter{ie-exploits} # Disable some known Internet Explorer bug exploits. - +filter{site-specifics} # Custom filters for specific site related problems + +filter{site-specifics} # Cure for site-specific problems. Don't apply generally! + + + + +filter{no-ping} # Removes non-standard ping attributes in <a> and <area> tags. - +filter{google} # Removes text ads and other Google specific improvements + +filter{google} # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement. - +filter{yahoo} # Removes text ads and other Yahoo specific improvements + +filter{yahoo} # CSS-based block for Yahoo text ads. Also removes a width limitation. - +filter{msn} # Removes text ads and other MSN specific improvements + +filter{msn} # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation. - +filter{blogspot} # Cleans up Blogspot blogs - - - - +filter{no-ping} # Removes non-standard ping attributes from anchor and area tags + +filter{blogspot} # Cleans up some Blogspot blogs. Read the fine print before using this. @@ -4293,7 +4531,8 @@ new action forward-socks4a 127.0.0.1:9050 . to use the socks4a proxy listening at 127.0.0.1 port 9050. Replace forward-socks4a with forward-socks4 - to use a socks4 connection (with local DNS resolution) instead. + to use a socks4 connection (with local DNS resolution) instead, use forward-socks5 + for socks5 connections (with remote DNS resolution). @@ -4301,7 +4540,8 @@ new action forward-socks4a 127.0.0.1:9050 proxy.example.org:8000 to use the socks4a proxy listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000. Replace forward-socks4a with forward-socks4 to use a socks4 connection - (with local DNS resolution) instead. + (with local DNS resolution) instead, use forward-socks5 + for socks5 connections (with remote DNS resolution). @@ -4312,7 +4552,7 @@ new action Notes: - This action takes parameters similar to the + This action takes parameters similar to the forward directives in the configuration file, but without the URL pattern. It can be used as replacement, but normally it's only used in cases where matching based on the request URL isn't sufficient. @@ -4347,6 +4587,8 @@ new action # This way you can continue to use Tor for your normal browsing, # without overloading the Tor network with your FreeBSD ports updates # or downloads of bigger files like ISOs. +# Note that HTTP headers are easy to fake and therefore their +# values are as (un)trustworthy as your clients and users. {+forward-override{forward .} \ -hide-if-modified-since \ -overwrite-last-modified \ @@ -4428,7 +4670,7 @@ new action # Block all documents on example.org that end with ".js", # but send an empty document instead of the usual HTML message. -{+block +handle-as-empty-document} +{+block{Blocked JavaScript} +handle-as-empty-document} example.org/.*\.js$ @@ -4515,11 +4757,8 @@ example.org/.*\.js$ # These don't look like images, but they're banners and should be # blocked as images: # -{+block +handle-as-image} -some.nasty-banner-server.com/junk.cgi\?output=trash - -# Banner source! Who cares if they also have non-image content? -ad.doubleclick.net +{+block{Nasty banners.} +handle-as-image} +nasty-banner-server.example.com/junk.cgi\?output=trash @@ -4761,8 +5000,8 @@ new action Randomizing the value of the If-Modified-Since: makes - sure it isn't used as a cookie replacement, but you will run into - caching problems if the random range is too high. + it less likely that the server can use the time as a cookie replacement, + but you will run into caching problems if the random range is too high. It is a good idea to only use a small negative value and let @@ -4771,7 +5010,8 @@ new action It is also recommended to use this action together with - crunch-if-none-match. + crunch-if-none-match, + otherwise it's more or less pointless. @@ -4780,8 +5020,8 @@ new action Example usage (section): - # Let the browser revalidate without being tracked across sessions -{ +hide-if-modified-since{-60} \ + # Let the browser revalidate but make tracking based on the time less likely. +{+hide-if-modified-since{-60} \ +overwrite-last-modified{randomize} \ +crunch-if-none-match} / @@ -4792,65 +5032,6 @@ new action - - -hide-forwarded-for-headers - - - Typical use: - - Improve privacy by not embedding the source of the request in the HTTP headers. - - - - - Effect: - - - Deletes any existing X-Forwarded-for: HTTP header from client requests, - and prevents adding a new one. - - - - - - Type: - - - Boolean. - - - - - Parameter: - - - N/A - - - - - - Notes: - - - It is safe to leave this on. - - - - - - Example usage: - - - +hide-forwarded-for-headers - - - - - - - hide-from-header @@ -4924,210 +5105,14 @@ new action - -hide-referrer - - - - Typical use: - - Conceal which link you followed to get to a particular site - - - - - Effect: - - - Deletes the Referer: (sic) HTTP header from the client request, - or replaces it with a forged one. - - - - - - Type: - - - Parameterized. - - - - - Parameter: - - - - conditional-block to delete the header completely if the host has changed. - - - - block to delete the header unconditionally. - - - forge to pretend to be coming from the homepage of the server we are talking to. - - - Any other string to set a user defined referrer. - - - - - - - Notes: - - - conditional-block is the only parameter, - that isn't easily detected in the server's log file. If it blocks the - referrer, the request will look like the visitor used a bookmark or - typed in the address directly. - - - Leaving the referrer unmodified for requests on the same host - allows the server owner to see the visitor's click path, - but in most cases she could also get that information by comparing - other parts of the log file: for example the User-Agent if it isn't - a very common one, or the user's IP address if it doesn't change between - different requests. - - - Always blocking the referrer, or using a custom one, can lead to - failures on servers that check the referrer before they answer any - requests, in an attempt to prevent their valuable content from being - embedded or linked to elsewhere. - - - Both conditional-block and forge - will work with referrer checks, as long as content and valid referring page - are on the same host. Most of the time that's the case. - - - hide-referer is an alternate spelling of - hide-referrer and the two can be can be freely - substituted with each other. (referrer is the - correct English spelling, however the HTTP specification has a bug - it - requires it to be spelled as referer.) - - - - - - Example usage: - - - +hide-referrer{forge} or - +hide-referrer{http://www.yahoo.com/} - - - - - - - - - -hide-user-agent - - - - Typical use: - - Conceal your type of browser and client operating system - - - - - Effect: - - - Replaces the value of the User-Agent: HTTP header - in client requests with the specified value. - - - - - - Type: - - - Parameterized. - - - - - Parameter: - - - Any user-defined string. - - - - - - Notes: - - - - This can lead to problems on web sites that depend on looking at this header in - order to customize their content for different browsers (which, by the - way, is NOT the right thing to do: good web sites - work browser-independently). - - - - - Using this action in multi-user setups or wherever different types of - browsers will access the same Privoxy is - not recommended. In single-user, single-browser - setups, you might use it to delete your OS version information from - the headers, because it is an invitation to exploit known bugs for your - OS. It is also occasionally useful to forge this in order to access - sites that won't let you in otherwise (though there may be a good - reason in some cases). Example of this: some MSN sites will not - let Mozilla enter, yet forging to a - Netscape 6.1 user-agent works just fine. - (Must be just a silly MS goof, I'm sure :-). - - - More information on known user-agent strings can be found at - http://www.user-agents.org/ - and - http://en.wikipedia.org/wiki/User_agent. - - - - - - Example usage: - - - +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)} - - - - - - - - - -inspect-jpegs - + +hide-referrer + Typical use: - To protect against the MS buffer over-run in JPEG processing + Conceal which link you followed to get to a particular site @@ -5135,7 +5120,8 @@ new action Effect: - Protect against a known exploit + Deletes the Referer: (sic) HTTP header from the client request, + or replaces it with a forged one. @@ -5144,16 +5130,30 @@ new action Type: - Boolean. + Parameterized. Parameter: - - N/A - + + + conditional-block to delete the header completely if the host has changed. + + + conditional-forge to forge the header if the host has changed. + + + block to delete the header unconditionally. + + + forge to pretend to be coming from the homepage of the server we are talking to. + + + Any other string to set a user defined referrer. + + @@ -5161,26 +5161,47 @@ new action Notes: - See Microsoft Security Bulletin MS04-028. JPEG images are one of the most - common image types found across the Internet. The exploit as described can - allow execution of code on the target system, giving an attacker access - to the system in question by merely planting an altered JPEG image, which - would have no obvious indications of what lurks inside. This action - prevents this exploit. + conditional-block is the only parameter, + that isn't easily detected in the server's log file. If it blocks the + referrer, the request will look like the visitor used a bookmark or + typed in the address directly. + + + Leaving the referrer unmodified for requests on the same host + allows the server owner to see the visitor's click path, + but in most cases she could also get that information by comparing + other parts of the log file: for example the User-Agent if it isn't + a very common one, or the user's IP address if it doesn't change between + different requests. - Note that the described exploit is only one of many, - using this action does not mean that you no longer - have to patch the client. + Always blocking the referrer, or using a custom one, can lead to + failures on servers that check the referrer before they answer any + requests, in an attempt to prevent their content from being + embedded or linked to elsewhere. + + + Both conditional-block and forge + will work with referrer checks, as long as content and valid referring page + are on the same host. Most of the time that's the case. + + + hide-referer is an alternate spelling of + hide-referrer and the two can be can be freely + substituted with each other. (referrer is the + correct English spelling, however the HTTP specification has a bug - it + requires it to be spelled as referer.) - Example usage: - +inspect-jpegs + + +hide-referrer{forge} or + +hide-referrer{http://www.yahoo.com/} + @@ -5188,14 +5209,14 @@ new action - -kill-popups<anchor id="kill-popup"> + +hide-user-agent Typical use: - Eliminate those annoying pop-up windows (deprecated) + Try to conceal your type of browser and client operating system @@ -5203,8 +5224,8 @@ new action Effect: - While loading the document, replace JavaScript code that opens - pop-up windows with (syntactically neutral) dummy code on the fly. + Replaces the value of the User-Agent: HTTP header + in client requests with the specified value. @@ -5213,7 +5234,7 @@ new action Type: - Boolean. + Parameterized. @@ -5221,7 +5242,7 @@ new action Parameter: - N/A + Any user-defined string. @@ -5229,57 +5250,42 @@ new action Notes: + + + This can lead to problems on web sites that depend on looking at this header in + order to customize their content for different browsers (which, by the + way, is NOT the right thing to do: good web sites + work browser-independently). + + - This action is basically a built-in, hardwired special-purpose filter - action, but there are important differences: For kill-popups, - the document need not be buffered, so it can be incrementally rendered while - downloading. But kill-popups doesn't catch as many pop-ups as - filter{all-popups} - does and is not as smart as filter{unsolicited-popups} - is. - - - Think of it as a fast and efficient replacement for a filter that you - can use if you don't want any filtering at all. Note that it doesn't make - sense to combine it with any filter action, - since as soon as one filter applies, - the whole document needs to be buffered anyway, which destroys the advantage of - the kill-popups action over its filter equivalent. - - - Killing all pop-ups unconditionally is problematic. Many shops and banks rely on - pop-ups to display forms, shopping carts etc, and the filter{unsolicited-popups} - does a better job of catching only the unwanted ones. - - - If the only kind of pop-ups that you want to kill are exit consoles (those - really nasty windows that appear when you close an other - one), you might want to use - filter{js-annoyances} - instead. - - - This action is most appropriate for browsers that don't have any controls - for unwanted pop-ups. Not recommended for general usage. + Using this action in multi-user setups or wherever different types of + browsers will access the same Privoxy is + not recommended. In single-user, single-browser + setups, you might use it to delete your OS version information from + the headers, because it is an invitation to exploit known bugs for your + OS. It is also occasionally useful to forge this in order to access + sites that won't let you in otherwise (though there may be a good + reason in some cases). Example of this: some MSN sites will not + let Mozilla enter, yet forging to a + Netscape 6.1 user-agent works just fine. + (Must be just a silly MS goof, I'm sure :-). - - - + Example usage: - +kill-popups + + +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)} + @@ -5330,26 +5336,21 @@ new action By default, i.e. if no limit-connect action applies, - Privoxy only allows HTTP CONNECT - requests to port 443 (the standard, secure HTTPS port). Use - limit-connect if more fine-grained control is desired - for some or all destinations. + Privoxy allows HTTP CONNECT requests to all + ports. Use limit-connect if fine-grained control + is desired for some or all destinations. The CONNECT methods exists in HTTP to allow access to secure websites (https:// URLs) through proxies. It works very simply: the proxy connects to the server on the specified port, and then short-circuits its connections to the client and to the remote server. - This can be a big security hole, since CONNECT-enabled proxies can be - abused as TCP relays very easily. + This means CONNECT-enabled proxies can be used as TCP relays very easily. Privoxy relays HTTPS traffic without seeing the decoded content. Websites can leverage this limitation to circumvent &my-app;'s filters. By specifying an invalid port range you can disable HTTPS entirely. - If you plan to disable SSL by default, consider enabling - treat-forbidden-connects-like-blocks - as well, to be able to quickly create exceptions. @@ -5361,7 +5362,7 @@ new action - +limit-connect{443} # This is the default and need not be specified. + +limit-connect{443} # Port 443 is OK. +limit-connect{80,443} # Ports 80 and 443 are OK. +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK. +limit-connect{-} # All ports are OK @@ -5419,9 +5420,9 @@ new action More and more websites send their content compressed by default, which is generally a good idea and saves bandwidth. But the filter, deanimate-gifs - and kill-popups actions need - access to the uncompressed data. + linkend="filter">filter and + deanimate-gifs + actions need access to the uncompressed data. When compiled with zlib support (available since &my-app; 3.0.7), content that should be @@ -5541,7 +5542,7 @@ new action reset-to-request-time overwrites the value of the Last-Modified: header with the current time. You could use this option together with - hided-if-modified-since + hide-if-modified-since to further customize your random range. @@ -5581,170 +5582,13 @@ new action redirect - - - Typical use: - - - Redirect requests to other sites. - - - - - - Effect: - - - Convinces the browser that the requested document has been moved - to another location and the browser should get it from there. - - - - - - Type: - - - Parameterized - - - - - Parameter: - - - An absolute URL or a single pcrs command. - - - - - - Notes: - - - Requests to which this action applies are answered with a - HTTP redirect to URLs of your choosing. The new URL is - either provided as parameter, or derived by applying a - single pcrs command to the original URL. - - - This action will be ignored if you use it together with - block. - It can be combined with - fast-redirects{check-decoded-url} - to redirect to a decoded version of a rewritten URL. - - - Use this action carefully, make sure not to create redirection loops - and be aware that using your own redirects might make it - possible to fingerprint your requests. - - - - - - Example usages: - - - # Replace example.com's style sheet with another one -{ +redirect{http://localhost/css-replacements/example.com.css} } - example.com/stylesheet\.css - -# Create a short, easy to remember nickname for a favorite site -# (relies on the browser accept and forward invalid URLs to &my-app;) -{ +redirect{http://www.privoxy.org/user-manual/actions-file.html} } - a - -# Always use the expanded view for Undeadly.org articles -# (Note the $ at the end of the URL pattern to make sure -# the request for the rewritten URL isn't redirected as well) -{+redirect{s@$@&mode=expanded@}} -undeadly.org/cgi\?action=article&sid=\d*$ - - - - - - - - - - -send-vanilla-wafer - - - - Typical use: - - - Feed log analysis scripts with useless data. - - - - - - Effect: - - - Sends a cookie with each request stating that you do not accept any copyright - on cookies sent to you, and asking the site operator not to track you. - - - - - - Type: - - - Boolean. - - - - - Parameter: - - - N/A - - - - - - Notes: - - - The vanilla wafer is a (relatively) unique header and could conceivably be used to track you. - - - This action is rarely used and not enabled in the default configuration. - - - - - - Example usage: - - - +send-vanilla-wafer - - - - - - - - - - -send-wafer - +--> Typical use: - Send custom cookies or feed log analysis scripts with even more useless data. + Redirect requests to other sites. @@ -5753,7 +5597,8 @@ undeadly.org/cgi\?action=article&sid=\d*$ Effect: - Sends a custom, user-defined cookie with each request. + Convinces the browser that the requested document has been moved + to another location and the browser should get it from there. @@ -5762,7 +5607,7 @@ undeadly.org/cgi\?action=article&sid=\d*$ Type: - Multi-value. + Parameterized @@ -5770,8 +5615,7 @@ undeadly.org/cgi\?action=article&sid=\d*$ Parameter: - A string of the form name=value. + An absolute URL or a single pcrs command. @@ -5780,23 +5624,65 @@ undeadly.org/cgi\?action=article&sid=\d*$ Notes: - Being multi-valued, multiple instances of this action can apply to the same request, - resulting in multiple cookies being sent. + Requests to which this action applies are answered with a + HTTP redirect to URLs of your choosing. The new URL is + either provided as parameter, or derived by applying a + single pcrs command to the original URL. + + + This action will be ignored if you use it together with + block. + It can be combined with + fast-redirects{check-decoded-url} + to redirect to a decoded version of a rewritten URL. + + + Use this action carefully, make sure not to create redirection loops + and be aware that using your own redirects might make it + possible to fingerprint your requests. - This action is rarely used and not enabled in the default configuration. + In case of problems with your redirects, or simply to watch + them working, enable debug 128. + - Example usage (section): + Example usages: - {+send-wafer{UsingPrivoxy=true}} -my-internal-testing-server.void + # Replace example.com's style sheet with another one +{ +redirect{http://localhost/css-replacements/example.com.css} } + example.com/stylesheet\.css + +# Create a short, easy to remember nickname for a favorite site +# (relies on the browser accept and forward invalid URLs to &my-app;) +{ +redirect{http://www.privoxy.org/user-manual/actions-file.html} } + a + +# Always use the expanded view for Undeadly.org articles +# (Note the $ at the end of the URL pattern to make sure +# the request for the rewritten URL isn't redirected as well) +{+redirect{s@$@&mode=expanded@}} +undeadly.org/cgi\?action=article&sid=\d*$ + +# Redirect Google search requests to MSN +{+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}} +.google.com/search + +# Redirect MSN search requests to Yahoo +{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}} +search.msn.com//results\.aspx\?q= + +# Redirect remote requests for this manual +# to the local version delivered by Privoxy +{+redirect{s@^http://www@http://config@}} +www.privoxy.org/user-manual/ + @@ -5892,7 +5778,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not Typical use: - Disable or disable filters based on the Content-Type header. + Enable or disable filters based on the Content-Type header. @@ -5954,7 +5840,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not -# Tag every request with the declared content type +# Tag every request with the content type declared by the server {+server-header-tagger{content-type}} / @@ -6174,81 +6060,6 @@ example.org/instance-that-is-delivered-as-xml-but-is-not - - -treat-forbidden-connects-like-blocks - - - - Typical use: - - Block forbidden connects with an easy to find error message. - - - - - Effect: - - - If this action is enabled, Privoxy no longer - makes a difference between forbidden connects and ordinary blocks. - - - - - - Type: - - - Boolean - - - - - Parameter: - - N/A - - - - - Notes: - - - By default Privoxy answers - forbidden Connect requests - with a short error message inside the headers. If the browser doesn't display - headers (most don't), you just see an empty page. - - - With this action enabled, Privoxy displays - the message that is used for ordinary blocks instead. If you decide - to make an exception for the page in question, you can do so by - following the See why link. - - - For Connect requests the clients tell - Privoxy which host they are interested - in, but not which document they plan to get later. As a result, the - Go there anyway wouldn't work and is therefore suppressed. - - - - - - Example usage: - - - +treat-forbidden-connects-like-blocks - - - - - - - Summary @@ -6323,15 +6134,15 @@ new action # +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies - +block-as-image = +block +handle-as-image + +block-as-image = +block{Blocked image.} +handle-as-image allow-all-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies} # These aliases define combinations of actions # that are useful for certain types of sites: # - fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups -prevent-compression + fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -prevent-compression - shop = -crunch-all-cookies -filter{all-popups} -kill-popups + shop = -crunch-all-cookies -filter{all-popups} # Short names for other aliases, for really lazy people ;-) # @@ -6366,7 +6177,7 @@ new action # These shops require pop-ups: # - {-kill-popups -filter{all-popups} -filter{unsolicited-popups}} + {-filter{all-popups} -filter{unsolicited-popups}} .dabs.com .overclockers.co.uk @@ -6389,24 +6200,71 @@ hal stop here linkend="actions">specified and applied to URLs, how patterns work, and how to define and use aliases. Now, let's look at an - example default.action and user.action - file and see how all these pieces come together: + example match-all.action, default.action + and user.action file and see how all these pieces come together: + + + +match-all.action + + Remember all actions are disabled when matching starts, + so we have to explicitly enable the ones we want. + + + + While the match-all.action file only contains a + single section, it is probably the most important one. It has only one + pattern, /, but this pattern + matches all URLs. Therefore, the set of + actions used in this default section will + be applied to all requests as a start. It can be partly or + wholly overridden by other actions files like default.action + and user.action, but it will still be largely responsible + for your overall browsing experience. + + + + Again, at the start of matching, all actions are disabled, so there is + no need to disable any actions here. (Remember: a + + preceding the action name enables the action, a - disables!). + Also note how this long line has been made more readable by splitting it into + multiple lines with line continuation. + + + + +{ \ + +change-x-forwarded-for{block} \ + +hide-from-header{block} \ + +set-image-blocker{pattern} \ +} +/ # Match all URLs + + + + + The default behavior is now set. + -default.action + +default.action -Every config file should start with a short comment stating its purpose: + If you aren't a developer, there's no need for you to edit the + default.action file. It is maintained by + the &my-app; developers and if you disagree with some of the + sections, you should overrule them in your user.action. - # Sample default.action file <ijbswa-developers@lists.sourceforge.net> + Understanding the default.action file can + help you with your user.action, though. -Then, since this is the default.action file, the -first section is a special section for internal use that you needn't -change or worry about: + The first section in this file is a special section for internal use + that prevents older &my-app; versions from reading the file: @@ -6414,15 +6272,14 @@ change or worry about: ########################################################################## # Settings -- Don't change! For internal Privoxy use ONLY. ########################################################################## - {{settings}} -for-privoxy-version=3.0 +for-privoxy-version=3.0.11 -After that comes the (optional) alias section. We'll use the example -section from the above chapter on aliases, -that also explains why and how aliases are used: + After that comes the (optional) alias section. We'll use the example + section from the above chapter on aliases, + that also explains why and how aliases are used: @@ -6437,120 +6294,14 @@ that also explains why and how aliases are used: # +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies - +block-as-image = +block +handle-as-image + +block-as-image = +block{Blocked image.} +handle-as-image mercy-for-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies} # These aliases define combinations of actions # that are useful for certain types of sites: # - fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups - shop = -crunch-all-cookies -filter{all-popups} -kill-popups - - - - Now come the regular sections, i.e. sets of actions, accompanied - by URL patterns to which they apply. Remember all actions - are disabled when matching starts, so we have to explicitly - enable the ones we want. - - - - The first regular section is probably the most important. It has only - one pattern, /, but this pattern - matches all URLs. Therefore, the - set of actions used in this default section will - be applied to all requests as a start. It can be partly or - wholly overridden by later matches further down this file, or in user.action, - but it will still be largely responsible for your overall browsing - experience. - - - - Again, at the start of matching, all actions are disabled, so there is - no real need to disable any actions here, but we will do that nonetheless, - to have a complete listing for your reference. (Remember: a + - preceding the action name enables the action, a - disables!). - Also note how this long line has been made more readable by splitting it into - multiple lines with line continuation. - - - - -########################################################################## -# "Defaults" section: -########################################################################## - { \ - -add-header \ - -client-header-filter{hide-tor-exit-notation} \ - -block \ - -content-type-overwrite \ - -crunch-client-header \ - -crunch-if-none-match \ - -crunch-incoming-cookies \ - -crunch-server-header \ - -crunch-outgoing-cookies \ - +deanimate-gifs \ - -downgrade-http-version \ - -fast-redirects{check-decoded-url} \ - -filter{js-annoyances} \ - -filter{js-events} \ - +filter{html-annoyances} \ - -filter{content-cookies} \ - +filter{refresh-tags} \ - -filter{unsolicited-popups} \ - -filter{all-popups} \ - -filter{img-reorder} \ - -filter{banners-by-size} \ - -filter{banners-by-link} \ - +filter{webbugs} \ - -filter{tiny-textforms} \ - -filter{jumping-windows} \ - -filter{frameset-borders} \ - -filter{demoronizer} \ - -filter{shockwave-flash} \ - -filter{quicktime-kioskmode} \ - -filter{fun} \ - -filter{crude-parental} \ - +filter{ie-exploits} \ - -filter{google} \ - -filter{yahoo} \ - -filter{msn} \ - -filter{blogspot} \ - -filter{no-ping} \ - -force-text-mode \ - -handle-as-empty-document \ - -handle-as-image \ - -hide-accept-language \ - -hide-content-disposition \ - -hide-if-modified-since \ - +hide-forwarded-for-headers \ - +hide-from-header{block} \ - +hide-referrer{forge} \ - -hide-user-agent \ - -inspect-jpegs \ - -kill-popups \ - -limit-connect \ - +prevent-compression \ - -overwrite-last-modified \ - -redirect \ - -send-vanilla-wafer \ - -send-wafer \ - -server-header-filter{xml-to-html} \ - -server-header-filter{html-to-xml} \ - +session-cookies-only \ - +set-image-blocker{pattern} \ - -treat-forbidden-connects-like-blocks \ - } - / # forward slash will match *all* potential URL patterns. - - - - The default behavior is now set. Note that some actions, like not hiding - the user agent, are part of a general policy that applies - universally and won't get any exceptions defined later. Other choices, - like not blocking (which is understandably the - default!) need exceptions, i.e. we need to specify explicitly what we - want to block in later sections. + fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer + shop = -crunch-all-cookies -filter{all-popups} @@ -6593,37 +6344,10 @@ mail.google.com .scan.co.uk - - The fast-redirects - action, which we enabled per default above, breaks some sites. So disable - it for popular sites where we know it misbehaves: + action, which may have been enabled in match-all.action, + breaks some sites. So disable it for popular sites where we know it misbehaves: @@ -6643,8 +6367,8 @@ edit.*.yahoo.com be blocked, a substitute image can be sent, rather than an HTML page. Contacting the remote site to find out is not an option, since it would destroy the loading time advantage of banner blocking, and it - would feed the advertisers (in terms of money and - information). We can mark any URL as an image with the handle-as-image action, and marking all URLs that end in a known image file extension is a good start: @@ -6715,7 +6439,7 @@ bs*.gsanet.com ########################################################################## # Block these fine banners: ########################################################################## -{ +block } +{ +block{Banner ads.} } # Generic patterns: # @@ -6839,7 +6563,7 @@ wiki. -# My user.action file. <fred@foobar.com> +# My user.action file. <fred@example.com> @@ -6861,14 +6585,14 @@ wiki. +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies allow-all-cookies = -crunch-all-cookies -session-cookies-only - allow-popups = -filter{all-popups} -kill-popups -+block-as-image = +block +handle-as-image + allow-popups = -filter{all-popups} ++block-as-image = +block{Blocked as image.} +handle-as-image -block-as-image = -block # These aliases define combinations of actions that are useful for # certain types of sites: # -fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups +fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer shop = -crunch-all-cookies allow-popups # Allow ads for selected useful free sites: @@ -6932,7 +6656,7 @@ stupid-server.example.com/ seen an ad on your favourite page on example.com that you want to get rid of. You have right-clicked the image, selected copy image location and pasted the URL below while removing the leading http://, into a - { +block } section. Note that { +handle-as-image + { +block{} } section. Note that { +handle-as-image } need not be specified, since all URLs ending in .gif will be tagged as images by the general rules as set in default.action anyway: @@ -6940,9 +6664,9 @@ stupid-server.example.com/ -{ +block } +{ +block{Nasty ads.} } www.example.com/nasty-ads/sponsor\.gif - another.popular.site.net/more/junk/here/ + another.example.net/more/junk/here/ @@ -6988,8 +6712,8 @@ stupid-server.example.com/ You like the fun text replacements in default.filter, - but it is disabled in the distributed actions file. (My colleagues on the team just - don't have a sense of humour, that's why! ;-). So you'd like to turn it on in your private, + but it is disabled in the distributed actions file. + So you'd like to turn it on in your private, update-safe config, once and for all: @@ -7085,7 +6809,7 @@ stupid-server.example.com/ client-header-filter to rewrite headers that are send by the client, and server-header-filter - to rewrite headers that are send by the server, and + to rewrite headers that are send by the server. @@ -7093,7 +6817,7 @@ stupid-server.example.com/ client-header-tagger and server-header-tagger. - Taggers and filters use the same syntax in the filter files, the differnce + Taggers and filters use the same syntax in the filter files, the difference is that taggers don't modify the text they are filtering, but use a rewritten version of the filtered text as tag. The tags can then be used to change the applying actions through sections with tag-patterns. @@ -7103,15 +6827,14 @@ stupid-server.example.com/ Multiple filter files can be defined through the filterfile config directive. The filters - as supplied by the developers will be found in + as supplied by the developers are located in default.filter. It is recommended that any locally defined or modified filters go in a separately defined file such as user.filter. - - + - Command tasks for content filters are to eliminate common annoyances in + Common tasks for content filters are to eliminate common annoyances in HTML and JavaScript, such as pop-up windows, exit consoles, crippled windows without navigation tools, the infamous <BLINK> tag etc, to suppress images with certain @@ -7120,9 +6843,14 @@ stupid-server.example.com/ - Content filtering works on any text-based document type, including - HTML, JavaScript, CSS etc. (all text/* - MIME types, except text/plain). + Enabled content filters are applied to any content whose + Content Type header is recognised as a sign + of text-based content, with the exception of text/plain. + Use the force-text-mode action + to also filter other content. + + + Substitutions are made at the source level, so if you want to roll your own filters, you should first be familiar with HTML syntax, and, of course, regular expressions. @@ -8557,13 +8285,6 @@ Requests actions. - - - If the +kill-popups - action applies, and it is an HTML or JavaScript document, the popup-code in the - response is filtered on-the-fly as it is received. - - If any +filter action @@ -8681,7 +8402,8 @@ Requests In file: default.action [ View ] [ Edit ] - {+deanimate-gifs {last} + {+change-x-forwarded-for{block} + +deanimate-gifs {last} +fast-redirects {check-decoded-url} +filter {refresh-tags} +filter {img-reorder} @@ -8689,7 +8411,6 @@ Requests +filter {webbugs} +filter {jumping-windows} +filter {ie-exploits} - +hide-forwarded-for-headers +hide-from-header {block} +hide-referrer {forge} +session-cookies-only @@ -8771,6 +8492,7 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ] + +set-image-blocker {pattern} @@ -8846,21 +8562,21 @@ In file: user.action [ View ] [ Edit ] - { +block } + { +block{Domains starts with "ad"} } ad*. - { +block } + { +block{Domain contains "ad"} } .ad. - { +block +handle-as-image } + { +block{Doubleclick banner server} +handle-as-image } .[a-vx-z]*.doubleclick.net We'll just show the interesting part here - the explicit matches. It is - matched three different times. Two +block sections, - and a +block +handle-as-image, + matched three different times. Two +block{} sections, + and a +block{} +handle-as-image, which is the expanded form of one of our aliases that had been defined as: +block-as-image. (Aliases are defined in @@ -8875,7 +8591,7 @@ In file: user.action [ View ] [ Edit ]ad.doubleclick.net is done here -- as both a +block + linkend="BLOCK">+block{} and an +handle-as-image. The custom alias +block-as-image just @@ -8896,6 +8612,7 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ] @@ -8997,7 +8708,7 @@ In file: user.action [ View ] [ Edit ] - { +block +handle-as-image } + { +block{Path starts with "ads".} +handle-as-image } /ads @@ -9078,8 +8789,8 @@ In file: user.action [ View ] [ Edit ] Remember to flush caches! Note that the mail.google reference lacks the TLD portion (e.g. - .com. This will effectively match any TLD with - google in it, such as mail.google.de, + .com). This will effectively match any TLD with + google in it, such as mail.google.de., just as an example. @@ -9113,6 +8824,266 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ][ View ] [ Edit ][ View ] [ Edit ][ View ] [ Edit ]