X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=doc%2Fsource%2Fuser-manual.sgml;h=06daeb7a8a0e6de951b064327297394c177986c1;hb=b713238ef11e017be4b4489789dfc8d491698ec5;hp=32c0171040046d993a600babf16cdd25050f5a83;hpb=e1efc2ecd4db05418776e31a0169ba23574cb3d8;p=privoxy.git diff --git a/doc/source/user-manual.sgml b/doc/source/user-manual.sgml index 32c01710..06daeb7a 100644 --- a/doc/source/user-manual.sgml +++ b/doc/source/user-manual.sgml @@ -1,5 +1,5 @@ + @@ -15,6 +15,7 @@ + ]> - Introduction - This documentation is included with the current &p-status; version of Privoxy, v.&p-version;soon ;-)]]>. - + Since this is a &p-status; version, not all new features are well tested. This documentation may be slightly out of sync as a result (especially with @@ -123,16 +122,13 @@ ]]> - -New Features +Features In addition to Internet Junkbuster's traditional features of ad and banner blocking and cookie management, Privoxy provides new features: - - &newfeatures; @@ -150,7 +146,9 @@ Privoxy is available both in convenient pre-compiled packages for a wide range of operating systems, and as raw source code. For most users, we recommend using the packages, which can be downloaded from our - Privoxy Project Page. + Privoxy Project + Page. For installing and compiling the source code, please look + into our Developer Manual. @@ -159,81 +157,94 @@ version directly from the CVS repository or simply download the nightly CVS - tarball. + tarball. Again, we refer you to the Developer Manual. &supported; - -Binary Packages - Note: If you have a previous Junkbuster or Privoxy installation on your system, you - will either need to remove it, or that might be done by the setup - procedure. (See below for your platform). + will need to remove it. Some platforms do this for you as part + of their installation procedure. (See below for your platform). In any case be sure to backup your old configuration - if it is valuable to you. In that case, also see the - note to upgraders. + if it is valuable to you. See the + note to upgraders section + below. + +Red Hat and SuSE RPMs + - How to install the binary packages depends on your operating system: + RPMs can be installed with rpm -Uvh privoxy-&p-version;-1.rpm, + and will use /etc/privoxy for the location + of configuration files. - -Redhat and SuSE RPMs + + Note that on Red Hat, Privoxy will + not be automatically started on system boot. You will + need to enable that using chkconfig, + ntsysv, or similar methods. Note that SuSE will +automatically start Privoxy in the boot process. + - RPMs can be installed with rpm -Uvh <name-of-rpm.rpm>, - and will use /etc/privoxy for configuration files. + If you have problems with failed dependencies, try rebuilding the SRC RPM: + rpm --rebuild privoxy-&p-version;-1.src.rpm;. This + will use your locally installed libraries and RPM version. - Note that if you have a Junkbuster RPM installed + Also note that if you have a Junkbuster RPM installed on your system, you need to remove it first, because the packages conflict. + Otherwise, RPM will try to remove Junkbuster + automatically, before installing Privoxy. - + -Debian +Debian FIXME. - + -Windows +Windows Just double-click the installer, which will guide you through - the installation process. + the installation process. You will find the configuration files + in the same directory as you installed Privoxy in. We do not + use the registry of Windows. - + -Solaris, NetBSD, FreeBSD, HP-UX +Solaris, NetBSD, FreeBSD, HP-UX Create a new directory, cd to it, then unzip and untar the archive. For the most part, you'll have to figure out where things go. FIXME. - + -OS/2 +OS/2 First, make sure that no previous installations of Junkbuster and / or Privoxy are left on your - system. + system. You can do this by @@ -247,43 +258,47 @@ The directory you choose to install Privoxy into will contain all of the configuration files. - + -Max OSX - - FIXME. +Max OSX + + Unzip the downloaded package (you can either double-click on the file + in the finder, or on the desktop if you downloaded it there). Then, + double-click on the package installer icon and follow the installation + process. + Privoxy will be installed in the subdirectory + /Applications/Privoxy.app. + Privoxy will set itself up to start + automatically on system bring-up via + /System/Library/StartupItems/Privoxy. - + -AmigaOS +AmigaOS - Unpack the .lha archive, then FIXME. + Copy and then unpack the lha archive to a suitable location. + All necessary files will be installed into Privoxy + directory, including all configuration and log files. To uninstall, just + remove this directory. + + + Start Privoxy (with RUN <>NIL:) in your + startnet script (AmiTCP), in + s:user-startup (RoadShow), as startup program in your + startup script (Genesis), or as startup action (Miami and MiamiDx). + Privoxy will automatically quit when you quit your + TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that + Privoxy is still running). - - - - -Building from Source - - -&buildsource; - - - - - -Quickstart to Using <application>Privoxy</application> - - - + Note to Upgraders There are very significant changes from older versions of @@ -293,23 +308,23 @@ configuration files will not migrate. The functionality of the old blockfile, cookiefile and imagelist, are now combined into the - actions file (default.action - for most installations). + actions files. + default.action, is the main actions file. Local + exceptions should best be put into user.action. - A filter file (typically default.filter) - is new with Privoxy 2.9.x, and provides some - of the new sophistication (explained below). config is - much the same as before. + A filter file (typically + default.filter) is new as of Privoxy + 2.9.x, and provides some of the new sophistication (explained + below). config is much the same as before. If upgrading from a 2.0.x version, you will have to use the new config files, and possibly adapt any personal rules from your older files. When porting personal rules over from the old blockfile - to the new actions file, please note that even the pattern syntax has - changed. - If upgrading from 2.9.x development versions, it is still recommended - to use the new configuration files. + to the new actions files, please note that even the pattern syntax has + changed. If upgrading from 2.9.x development versions, it is still + recommended to use the new configuration files. A quick list of things to be aware of before upgrading: @@ -344,9 +359,10 @@ The primary configuration file for cookie management, ad and banner blocking, and many other aspects of Privoxy - configuration is default.action. It is strongly - recommended to become familiar with the new actions concept below, - before modifying this file. + configuration is in the actions + files. It is strongly recommended to become familiar with the new + actions concept below, before modifying these files. Locally defined rules + should go into user.action. @@ -360,18 +376,56 @@ + - + +Quickstart to Using <application>Privoxy</application> + + + + + + Install Privoxy. See the section Installing. + + + + + + Start Privoxy. See the section Starting Privoxy. + + + + + + Change your browser's configuration to use the proxy localhost on port + 8118. See the section Starting Privoxy. + + + + + + Enjoy surfing with enhanced comfort and privacy. Please see the section + Contacting the Developers on how to report + bugs or problems with websites or to get help. You may want to change the + file user.action to further tweak your new browsing + experience. + + + + + + + - + Starting <application>Privoxy</application> - Before launching Privoxy for the first time, you - will want to configure your browser(s) to use Privoxy - as a HTTP and HTTPS proxy. The default is localhost for the proxy address, - and port 8118 (earlier versions used port 8000). This is the one required - configuration that must be done! + Before launching Privoxy for the first time, you + will want to configure your browser(s) to use + Privoxy as a HTTP and HTTPS proxy. The default is + localhost for the proxy address, and port 8118 (earlier versions used port + 8000). This is the one configuration step that must be done! @@ -388,73 +442,127 @@ After doing this, flush your browser's disk and memory caches to force a re-reading of all pages and to get rid of any ads that may be cached. You are now ready to start enjoying the benefits of using - Privoxy. + Privoxy! - Privoxy is typically started by specifying the - main configuration file to be used on the command line. Example Unix startup - command: + main configuration file to be used on the command line. If no configuration + file is specified on the command line, Privoxy + will look for a file named config in the current + directory. Except on Win32 where it will try config.txt. + +RedHat and Debian + +We use a script. Note that RedHat does not start Privoxy upon booting per +default. It will use the file /etc/privoxy/config as its +main configuration file. FIXME: Debian?? + + + + # /etc/rc.d/init.d/privoxy start + + + + + +SuSE + +We use a script. It will use the file /etc/privoxy/config +as its main configuration file. Note that SuSE starts Privoxy upon booting +your PC. + + + + # rcprivoxy start + + + + + +Windows + +Click on the Privoxy Icon to start Privoxy. If no configuration file is + specified on the command line, Privoxy will look + for a file named config.txt. Note that Windows will + automatically start Privoxy upon booting you PC. + + + + +Solaris, NetBSD, FreeBSD, HP-UX and others + +Example Unix startup command: + - # /usr/sbin/privoxy /etc/privoxy/config - - + + + +OS/2 - An init script is provided for SuSE and Redhat. +FIXME. + + +MAX OSX - For for SuSE: rcprivoxy start +FIXME. + + + +AmigaOS - For RedHat: /etc/rc.d/init.d/privoxy start +FIXME. + + - + Command Line Options Privoxy may be invoked with the following @@ -533,7 +641,7 @@ --version - Print version info and exit, Unix only. + Print version info and exit. Unix only. @@ -541,7 +649,7 @@ --help - Print a short usage info and exit, Unix only. + Print short usage info and exit. Unix only. @@ -550,7 +658,7 @@ Don't become a daemon, i.e. don't fork and become process group - leader, don't detach from controlling tty. Unix only. + leader, and don't detach from controlling tty. Unix only. @@ -585,7 +693,8 @@ Privoxy will look for a file named config in the current directory (except on Win32 where it will look for config.txt instead). Specify - full path to avoid confusion. + full path to avoid confusion. If no config file is found, + Privoxy will fail to start. @@ -606,7 +715,6 @@ in text files. These files can be edited with a text editor. Many important aspects of Privoxy can also be controlled easily with a web browser. - @@ -623,25 +731,35 @@ - - - -Please choose from the following options: + + + + Privoxy Menu - * Privoxy main page - * Show information about the current configuration - * Show the source code version numbers - * Show the request headers. - * Show which actions apply to a URL and why - * Toggle Privoxy on or off - * Edit the actions list + + +         ▪  View & change the current configuration + + +         ▪  View the source code version numbers + + +         ▪  View the request headers. + + +         ▪  Look up which actions apply to a URL and why + + +         ▪  Toggle Privoxy on or off + + + + - - - This should be self-explanatory. Note the last item is an editor for the - actions list, which is where much of the ad, banner, cookie, + This should be self-explanatory. Note the first item leads to an editor for the + actions list, which is where the ad, banner, cookie, and URL blocking magic is configured as well as other advanced features of Privoxy. This is an easy way to adjust various aspects of Privoxy configuration. The actions @@ -654,9 +772,9 @@ Please choose from the following options: it as a test to see whether it is Privoxy causing the problem or not. Privoxy continues to run as a proxy in this case, but all filtering is disabled. There - is even a toggle Bookmarklet offered, so that you can toggle - Privoxy with one click from your browser. - + is even a toggle Bookmarklet offered, so + that you can toggle Privoxy with one click from + your browser. @@ -668,7 +786,7 @@ Please choose from the following options: - + Configuration Files Overview For Unix, *BSD and Linux, all configuration files are located in @@ -680,9 +798,9 @@ Please choose from the following options: - The installed defaults provide a reasonable starting point, though possibly - aggressive by some standards. For the time being, there are only three - default configuration files (this may change in time): + The installed defaults provide a reasonable starting point, though + some settings may be aggressive by some standards. For the time being, the + principle configuration files are: @@ -690,31 +808,44 @@ Please choose from the following options: - The main configuration file is named config + The main configuration file is named config on Linux, Unix, BSD, OS/2, and AmigaOS and config.txt - on Windows. + on Windows. This is a required file. - default.action (the actions file) is used to define - which of a set of various actions relating to images, banners, - pop-ups, access restrictions, banners and cookies are to be applied where. - There is a web based editor for this file that can be accessed at http://config.privoxy.org/edit-actions/ - (Shortcut: http://p.p/edit-actions/). - (Other actions files are included as well with differing levels of filtering - and blocking, e.g. basic.action.) + default.action (the main actions file) is used to define + the default settings for various actions relating to images, banners, + pop-ups, access restrictions, banners and cookies. + + + 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 are probably best applied in + user.action, which should be preserved across + upgrades. standard.action is also included. This is mostly + for Privoxy's internal use. + + + There is also a web based editor that can be accessed from + http://config.privoxy.org/show-status/ + (Shortcut: http://p.p/show-status/) for the + various actions files. - default.filter (the filter file) can be used to re-write the raw - page content, including viewable text as well as embedded HTML and JavaScript, - and whatever else lurks on any given web page. The filtering jobs are only - pre-defined here; whether to apply them or not is up to the actions file. + default.filter (the filter + file) can be used to re-write the raw page content, including + viewable text as well as embedded HTML and JavaScript, and whatever else + lurks on any given web page. The filtering jobs are only pre-defined here; + whether to apply them or not is up to the actions files. @@ -723,7 +854,7 @@ Please choose from the following options: All files use the # character to denote a - comment (the rest of the line will be ignored) and understand line continuation + comment (the rest of the line will be ignored) angd understand line continuation through placing a backslash ("\") as the very last character in a line. If the # is preceded by a backslash, it looses its special function. Placing a # in front of an otherwise @@ -732,8 +863,9 @@ Please choose from the following options: - default.action and default.filter - can use Perl style regular expressions for maximum flexibility. + The actions files and default.filter + can use Perl style regular expressions for + maximum flexibility. @@ -754,13 +886,17 @@ Please choose from the following options: please check all your configuration files on important issues. ]]> + + + - + - + The Main Configuration File + Again, the main configuration file is named config on Linux/Unix/BSD and OS/2, and config.txt on Windows. @@ -800,18 +936,78 @@ Please choose from the following options: - + Configuration and Log File Locations Privoxy can (and normally does) use a number of - other files for additional configuration and logging. + other files for additional configuration, help and logging. This section of the configuration file tells Privoxy where to find those other files. + + The user running Privoxy, must have read permission for all + configuration files, and write permission to any files that would + be modified, such as log files. + + +user-manual + + + Specifies: + + + Location of the Privoxy User Manual. + + + + + Type of value: + + A fully qualified URI + + + + Default value: + + http://www.privoxy.org/user-manual/ + + + + Effect if unset: + + + The default will be used. + + + + + Notes: + + + The User Manual is used for help hints from some of the internal CGI pages. + It is normally packaged with the binary distributions, and would make more + sense to have this pointed at a locally installed copy. + + + A more useful example (Unix): + + +   user-manual  file:///usr/share/doc/privoxy-&p-version;/user-manual/ + + + + If this option is defined, it must come first! It is needed before the rest of + config is read. + + + + + + -confdir +confdir @@ -854,10 +1050,10 @@ Please choose from the following options: - + -logdir +logdir @@ -896,16 +1092,21 @@ Please choose from the following options: - - -actionsfile + + +actionsfile + + + + + Specifies: - The actions file to use + The actions file(s) to use @@ -918,14 +1119,24 @@ Please choose from the following options: Default value: - default.action (Unix) or default.action.txt (Windows) + + + standard # Internal purposes, recommended not editing + + + default # Main actions file + + + user # User customizations + + Effect if unset: - No action is taken at all. Simple neutral proxying. + No actions are taken at all. Simple neutral proxying. @@ -933,25 +1144,33 @@ Please choose from the following options: Notes: - There is no point in using Privoxy without - an actions file. There are three different actions files included in the - distribution, with varying degrees of aggressiveness: - default.action, intermediate.action and - advanced.action. + Multiple actionsfile lines are permitted, and are in fact recommended! + + + The default values include standard.action, which is used for internal + purposes and should be loaded, default.action, which is the + main actions file maintained by the developers, and + user.action, where you can make your personal additions. + + + Actions files are where all the per site and per URL configuration is done for + ad blocking, cookie management, privacy considerations, etc. + There is no point in using Privoxy without at + least one actions file. - - -filterfile + +filterfile + Specifies: - The filter file to use + The filter file to use @@ -973,7 +1192,7 @@ Please choose from the following options: No textual content filtering takes place, i.e. all +filter{name} - actions in the actions file are turned off + actions in the actions files are turned off @@ -991,9 +1210,9 @@ Please choose from the following options: - + -logfile +logfile @@ -1040,7 +1259,7 @@ Please choose from the following options: Your logfile will grow indefinitely, and you will probably want to periodically remove it. On Unix systems, you can do this with a cron job - (see man cron). For Redhat, a logrotate + (see man cron). For Red Hat, a logrotate script has been included. @@ -1049,12 +1268,16 @@ Please choose from the following options: the effect that cron.daily will automatically archive, gzip, and empty the log, when it exceeds 1M size. + + Any log files must be writable by whatever user Privoxy + is being run as (default on UNIX, user id is privoxy). + - + -jarfile +jarfile @@ -1094,10 +1317,9 @@ Please choose from the following options: - - -trustfile + +trustfile Specifies: @@ -1149,17 +1371,17 @@ Please choose from the following options: - - + + - + Local Set-up Documentation @@ -1168,7 +1390,7 @@ Please choose from the following options: you, what you block and why you do that, your policies etc. -trust-info-url +trust-info-url @@ -1218,9 +1440,9 @@ Please choose from the following options: - + -admin-address +admin-address @@ -1262,9 +1484,9 @@ Please choose from the following options: - + -proxy-info-url +proxy-info-url @@ -1310,14 +1532,14 @@ Please choose from the following options: - - + + - + Debugging @@ -1327,7 +1549,7 @@ Please choose from the following options: command line option when debugging. -debug +debug @@ -1379,7 +1601,7 @@ Please choose from the following options: debug 1024 # debug kill pop-ups debug 4096 # Startup banner and warnings. debug 8192 # Non-fatal errors - + To select multiple debug levels, you can either add them or use @@ -1404,9 +1626,9 @@ Please choose from the following options: - + -single-threaded +single-threaded @@ -1448,13 +1670,13 @@ Please choose from the following options: - - + + - + Access Control and Security @@ -1462,7 +1684,7 @@ Please choose from the following options: of Privoxy's configuration. -listen-address +listen-address @@ -1480,6 +1702,7 @@ Please choose from the following options: [IP-Address]:Port + Default value: @@ -1510,7 +1733,7 @@ Please choose from the following options: If you leave out the IP address, Privoxy will bind to all interfaces (addresses) on your machine and may become reachable - from the Internet. In that case, consider using access control lists (acl's) + from the Internet. In that case, consider using access control lists (ACL's) (see ACLs below), or a firewall. @@ -1527,14 +1750,14 @@ Please choose from the following options: listen-address 192.168.0.1:8118 - + - + -toggle +toggle @@ -1574,7 +1797,7 @@ Please choose from the following options: proxy. See enable-remote-toggle below. This is not really useful anymore, since toggling is much easier via the web - interface then via editing the conf file. + interface than via editing the conf file. The windows version will only display the toggle icon in the system tray @@ -1583,10 +1806,10 @@ Please choose from the following options: - + -enable-remote-toggle +enable-remote-toggle Specifies: @@ -1640,16 +1863,16 @@ Please choose from the following options: - + -enable-edit-actions +enable-edit-actions Specifies: - Whether or not the web-based actions + Whether or not the web-based actions file editor may be used @@ -1692,9 +1915,13 @@ Please choose from the following options: - + + + +ACLs: permit-access and deny-access + + -ACLs: permit-access and deny-access Specifies: @@ -1789,7 +2016,7 @@ Please choose from the following options: permit-access localhost - + Allow any host on the same class C subnet as www.privoxy.org access to @@ -1798,7 +2025,7 @@ Please choose from the following options: permit-access www.privoxy.org/24 www.example.com/32 - + Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere, @@ -1808,14 +2035,14 @@ Please choose from the following options: permit-access 192.168.45.64/26 deny-access 192.168.45.73 www.dirty-stuff.example.com - + - + -buffer-limit +buffer-limit @@ -1868,16 +2095,16 @@ Please choose from the following options: - - + + - + Forwarding @@ -1897,7 +2124,7 @@ Please choose from the following options: supports the SOCKS 4 and SOCKS 4A protocols. -forward +forward Specifies: @@ -1916,7 +2143,7 @@ Please choose from the following options: Where target_domain is a domain name pattern (see the - chapter on domain matching in the actions file), + chapter on domain matching in the default.action file), http_parent is the address of the parent HTTP proxy as an IP addresses in dotted decimal notation or as a valid DNS name (or . to denote no forwarding, and the optional @@ -1961,7 +2188,7 @@ Please choose from the following options: forward .* anon-proxy.example.org:8080 forward :443 . - + Everything goes to our example ISP's caching proxy, except for requests @@ -1971,14 +2198,18 @@ Please choose from the following options: forward .*. caching-proxy.example-isp.net:8000 forward .example-isp.net . - + - + + + +forward-socks4 and forward-socks4a + + -forward-socks4 and forward-socks4a Specifies: @@ -1998,7 +2229,7 @@ Please choose from the following options: Where target_domain is a domain name pattern (see the - chapter on domain matching in the actions file), + chapter on domain matching in the default.action file), http_parent and socks_proxy are IP addresses in dotted decimal notation or valid DNS names (http_parent may be . to denote no HTTP forwarding), and the optional @@ -2051,7 +2282,7 @@ Please choose from the following options: forward-socks4a .*. socks-gw.example.com:1080 www-cache.example-isp.net:8080 forward .example.com . - + A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this: @@ -2059,14 +2290,14 @@ Please choose from the following options: forward-socks4 .*. socks-gw.example.com:1080 . - + - + -Advanced Forwarding Examples +Advanced Forwarding Examples If you have links to multiple ISPs that provide various special content @@ -2089,7 +2320,7 @@ Please choose from the following options: forward .*. . forward .isp-b.net host-b:8118 - + @@ -2100,7 +2331,7 @@ Please choose from the following options: forward .*. . forward .isp-a.net host-a:8118 - + @@ -2132,8 +2363,7 @@ Please choose from the following options: always_direct allow ftp # Forward all the rest to Privoxy - never_direct allow all - + never_direct allow all @@ -2141,25 +2371,23 @@ Please choose from the following options: Squid normally uses port 3128. If unsure consult http_port in squid.conf. - - + + - + Windows GUI Options - Privoxy has a number of options specific to the Windows GUI interface: + If activity-animation is set to 1, the Privoxy icon will animate when @@ -2176,6 +2404,7 @@ Removed references to Win32. HB 09/23/01 + If log-messages is set to 1, Privoxy will log messages to the console @@ -2192,6 +2421,7 @@ Removed references to Win32. HB 09/23/01 + If log-buffer-size is set to 1, the size of the log buffer, i.e. the amount of memory used for the log messages displayed in the @@ -2213,6 +2443,7 @@ Removed references to Win32. HB 09/23/01 + log-max-lines is the maximum number of lines held in the log buffer. See above. @@ -2228,6 +2459,7 @@ Removed references to Win32. HB 09/23/01 + If log-highlight-messages is set to 1, Privoxy will highlight portions of the log @@ -2244,6 +2476,7 @@ Removed references to Win32. HB 09/23/01 + The font used in the console window: @@ -2258,6 +2491,7 @@ Removed references to Win32. HB 09/23/01 + Font size used in the console window: @@ -2272,6 +2506,7 @@ Removed references to Win32. HB 09/23/01 + show-on-task-bar controls whether or not Privoxy will appear as a button on the Task bar @@ -2288,6 +2523,7 @@ Removed references to Win32. HB 09/23/01 + If close-button-minimizes is set to 1, the Windows close button will minimize Privoxy instead of closing @@ -2304,6 +2540,7 @@ Removed references to Win32. HB 09/23/01 + The hide-console option is specific to the MS-Win console version of Privoxy. If this option is used, @@ -2315,85 +2552,133 @@ Removed references to Win32. HB 09/23/01 - #hide-console + #hide-console - + - - -The Actions File + + + +Actions Files + + + The actions files are used to define what actions + Privoxy takes for which URLs, and thus determines + how ad images, cookies and various other aspects of HTTP content and + transactions are handled, and on which sites (or even parts thereof). There + are three such files included with Privoxy (as of + version 2.9.15), with differing purposes: + + + + + + + standard.action - is used by the web based editor, + to set various pre-defined sets of rules for the default actions section + in default.action. These have increasing levels of + aggressiveness. It is not recommend to edit this file. + + + + + 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 for users everywhere. + This is the file that the developers are keeping updated, and making + available to users. + + + + + 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. + + + + + + + The list of actions files to be used are defined in the main configuration + file, and are processed in the order they are defined. The content of these + can all be viewed and edited from http://config.privoxy.org/show-status. + - The actions file (default.action, formerly: - actionsfile or ijb.action) is used - to define what actions Privoxy takes for which - URLs, and thus determines how ad images, cookies and various other aspects - of HTTP content and transactions are handled on which sites (or even parts - thereof). + An actions file typically has sections. Near the top, aliases are + optionally defined (discussed below), then the default set of rules + which will apply universally to all sites and pages. And then below that, + exceptions to the defined universal policies. - Anything you want can blocked, including ads, banners, or just some obnoxious - URL that you would rather not see. Cookies can be accepted or rejected, or - accepted only during the current browser session (i.e. not written to disk), - content can be modified, JavaScripts tamed, user-tracking fooled, and much more. - See below for a complete list of available actions. + Actions can be used to block anything you want, including ads, banners, or + just some obnoxious URL that you would rather not see. Cookies can be accepted + or rejected, or accepted only during the current browser session (i.e. not + written to disk), content can be modified, JavaScripts tamed, user-tracking + fooled, and much more. See below for a complete list of actions. - + Finding the Right Mix - Note that some actions like cookie suppression or script disabling may - render some sites unusable, which rely on these techniques to work properly. - Finding the right mix of actions is not easy and certainly a matter of personal - taste. In general, it can be said that the more aggressive - your default settings (in the top section of the actions file) are, - the more exceptions for trusted sites you will have to - make later. If, for example, you want to kill popup windows per default, you'll - have to make exceptions from that rule for sites that you regularly use - and that require popups for actually useful content, like maybe your bank, - favorite shop, or newspaper. + Note that some actions, like cookie suppression + or script disabling, may render some sites unusable that rely on these + techniques to work properly. Finding the right mix of actions is not always easy and + certainly a matter of personal taste. In general, it can be said that the more + aggressive your default settings (in the top section of the + actions file) are, the more exceptions for trusted sites you + will have to make later. If, for example, you want to kill popup windows per + default, you'll have to make exceptions from that rule for sites that you + regularly use and that require popups for actually useful content, like maybe + your bank, favorite shop, or newspaper. We have tried to provide you with reasonable rules to start from in the - distribution actions file. But there is no general rule of thumb on these + distribution actions files. But there is no general rule of thumb on these things. There just are too many variables, and sites are constantly changing. - Sooner or later you will want to change the rules (and read this chapter). + Sooner or later you will want to change the rules (and read this chapter again :). - + - + How to Edit - The easiest way to edit the actions file is with a browser by - using our browser-based editor, which is available at http://config.privoxy.org/edit-actions. + The easiest way to edit the actions files is with a browser by + using our browser-based editor, which can be reached from http://config.privoxy.org/show-status. If you prefer plain text editing to GUIs, you can of course also directly edit the - default.action file. + the actions files. - + - + How Actions are Applied to URLs - The actions file is divided into sections. There are special sections, - like the alias sections which will be discussed later. For now let's - concentrate on regular sections: They have a heading line (often split + Actions files are divided into sections. There are special sections, + like the alias sections which will be discussed later. For now + let's concentrate on regular sections: They have a heading line (often split up to multiple lines for readability) which consist of a list of actions, separated by whitespace and enclosed in curly braces. Below that, there is a list of URL patterns, each on a separate line. @@ -2404,7 +2689,11 @@ Removed references to Win32. HB 09/23/01 compared to all patterns in this file. Every time it matches, the list of applicable actions for the URL is incrementally updated, using the heading of the section in which the pattern is located. If multiple matches for - the same URL set the same action differently, the last match wins. + the same URL set the same action differently, the last match wins. If not, + the effects are aggregated (e.g. a URL might match both the + +handle-as-image + and +block actions). + @@ -2416,10 +2705,10 @@ Removed references to Win32. HB 09/23/01 More detail on this is provided in the Appendix, Anatomy of an Action. - + - + Patterns Generally, a pattern has the form <domain>/<path>, @@ -2475,7 +2764,9 @@ Removed references to Win32. HB 09/23/01 -The Domain Pattern + + +The Domain Pattern The matching of the domain part offers some flexible options: if the @@ -2561,9 +2852,13 @@ Removed references to Win32. HB 09/23/01 - + + + + -The Path Pattern + +The Path Pattern Privoxy uses Perl compatible regular expressions @@ -2582,7 +2877,8 @@ Removed references to Win32. HB 09/23/01 Note that the path pattern is automatically left-anchored at the /, - i.e. it matches as if it would start with a ^. + i.e. it matches as if it would start with a ^ (regular expression speak + for the beginning of a line). @@ -2594,23 +2890,30 @@ Removed references to Win32. HB 09/23/01 documents whose path starts with PaTtErN in exactly this capitalization. - - - + + - + Actions - Actions are enabled if preceded with a +, and disabled if - preceded with a -. Actions are invoked by enclosing the - action name in curly braces (e.g. {+some_action}), followed by a list of - URLs to which the action applies. There are three classes of actions: + All actions are disabled by default, until they are explicitly enabled + somewhere in an actions file. Actions are turned on if preceded with a + +, and turned off if preceded with a -. So a + +action means do that action, e.g. + +block means please block the following URL + patterns. + + + + Actions are invoked by enclosing the action name in curly braces (e.g. + {+some_action}), followed by a list of URLs (or patterns that match URLs) to + which the action applies. There are three classes of actions: @@ -2618,8 +2921,9 @@ Removed references to Win32. HB 09/23/01 - Boolean (e.g. +/-block): - + Boolean, i.e the action can only be on or + off. Examples: + @@ -2635,14 +2939,16 @@ Removed references to Win32. HB 09/23/01 - parameterized (e.g. +/-hide-user-agent): + Parameterized, e.g. +/-hide-user-agent{ Mozilla 1.0 }, + where some value is required in order to enable this type of action. + Examples: {+name{param}} # enable action and set parameter to param - {-name} # disable action + {-name} # disable action (parameter) can be omitted @@ -2651,15 +2957,18 @@ Removed references to Win32. HB 09/23/01 - Multi-value (e.g. {+/-add-header{Name: value}}, {+/-wafer{name=value}}): + + Multi-value, e.g. {+/-add-header{Name: value}} or + {+/-send-wafer{name=value}}), where some value needs to be defined + in addition to simply enabling the action. Examples: - {+name{param}} # enable action and add parameter param - {-name{param}} # remove the parameter param - {-name} # disable this action totally + {+name{param=value}} # enable action and set param to value + {-name{param=value}} # remove the parameter param completely + {-name} # disable this action totally and remove param too @@ -2670,733 +2979,1683 @@ Removed references to Win32. HB 09/23/01 - If nothing is specified in this file, no actions are taken. - So in this case Privoxy would just be a - normal, non-blocking, non-anonymizing proxy. You must specifically - enable the privacy and blocking features you need (although the - provided default default.action file will - give a good starting point). + If nothing is specified in any actions file, no actions are + taken. So in this case Privoxy would just be a + normal, non-blocking, non-anonymizing proxy. You must specifically enable the + privacy and blocking features you need (although the provided default actions + files will give a good starting point). Later defined actions always over-ride earlier ones. So exceptions - to any rules you make, should come in the latter part of the file. For - multi-valued actions, the actions are applied in the order they are - specified. + to any rules you make, should come in the latter part of the file (or + in a file that is processed later when using multiple actions files). For + multi-valued actions, the actions are applied in the order they are specified. + Actions files are processed in the order they are defined in + config (the default installation has three actions + files). It also quite possible for any given URL pattern to match more than + one action! + The list of valid Privoxy actions are: - - - - - - Add the specified HTTP header, which is not checked for validity. - You may specify this many times to specify many different headers: - - - - - - +add-header{Name: value} - - - - - - - - - - Block this URL totally. In a default installation, a blocked - URL will result in bright red banner that says BLOCKED, - with a reason why it is being blocked, and an option to see it anyway. - The page displayed for this is the blocked template - file. - - - - - - +block - - - - - - + + + + + + + + + + + +<emphasis>+add-header</emphasis> + + + + Type: + + + Multi-value. + + - - - De-animate all animated GIF images, i.e. reduce them to their last frame. - This will also shrink the images considerably (in bytes, not pixels!). If - the option first is given, the first frame of the animation - is used as the replacement. If last is given, the last frame - of the animation is used instead, which probably makes more sense for most - banner animations, but also has the risk of not showing the entire last - frame (if it is only a delta to an earlier frame). - - - - - - +deanimate-gifs{last} - +deanimate-gifs{first} - - - - - + + Typical uses: + + + Send a user defined HTTP header to the web server. + + + + + + Possible values: + + + Any value is possible. Validity of the defined HTTP headers is not checked. + + + - - - +downgrade will downgrade HTTP/1.1 client requests to - HTTP/1.0 and downgrade the responses as well. Use this action for servers - that use HTTP/1.1 protocol features that - Privoxy doesn't handle well yet. HTTP/1.1 - is only partially implemented. Default is not to downgrade requests. - - - - - - +downgrade - - - - - + + Example usage: + + + {+add-header{X-User-Tracking: sucks}} + .example.com + + + + + + Notes: + + + This action may be specified multiple times, in order to define multiple + headers. This is rarely needed for the typical user. If you don't know what + HTTP headers are, you definitely don't need to worry about this + one. + + + + + + + + + +<emphasis>+block</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Used to block a URL from reaching your browser. The URL may be + anything, but is typically used to block ads or other obnoxious + content. + + + + + + Possible values: + + N/A + + - - - Many sites, like yahoo.com, don't just link to other sites. Instead, they - will link to some script on their own server, giving the destination as a - parameter, which will then redirect you to the final target. URLs resulting - from this scheme typically look like: - http://some.place/some_script?http://some.where-else. - - - Sometimes, there are even multiple consecutive redirects encoded in the - URL. These redirections via scripts make your web browsing more traceable, - since the server from which you follow such a link can see where you go to. - Apart from that, valuable bandwidth and time is wasted, while your browser - ask the server for one redirect after the other. Plus, it feeds the - advertisers. - - - The +fast-redirects option enables interception of these - types of requests by Privoxy, who will cut off - all but the last valid URL in the request and send a local redirect back to - your browser without contacting the intermediate site(s). - - - - - - +fast-redirects - - - - - + + Example usage: + + + {+block} + .banners.example.com + .ads.r.us + + + - - - Apply the filters in the section_header - section of the default.filter file to the site(s). - default.filter sections are grouped according to like - functionality. Filters can be used to - re-write any of the raw page content. This is a potentially a - very powerful feature! - - - - - - - +filter{section_header} - - - - + + Notes: + + + If a URL matches one of the blocked patterns, Privoxy + will intercept the URL and display its special BLOCKED page + instead. If there is sufficient space, a large red banner will appear with + a friendly message about why the page was blocked, and a way to go there + anyway. If there is insufficient space a smaller BLOCKED + page will appear without the red banner. + Click here + to view the default blocked HTML page (Privoxy must be running + for this to work as intended!). + - - Filter sections that are pre-defined in the supplied - default.filter include: - + + A very important exception is if the URL matches both + +block and +handle-as-image, + then it will be handled by + +set-image-blocker + (see below). It is important to understand this process, in order + to understand how Privoxy is able to deal with + ads and other objectionable content. + + + The +filter + action can also perform some of the + same functionality as +block, but by virtue of very + different programming techniques, and is most often used for different + reasons. + + + -
- - - html-annoyances: Get rid of particularly annoying HTML abuse. - - - - - js-annoyances: Get rid of particularly annoying JavaScript abuse - - - - - content-cookies: Kill cookies that come in the HTML or JS content - - - - - popups: Kill all popups in JS and HTML - - - - - frameset-borders: Give frames a border and make them resizable - - - - - webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking) - - - - - refresh-tags: Kill automatic refresh tags (for dial-on-demand setups) - - - - - fun: Text replacements for subversive browsing fun! - - - - - nimda: Remove Nimda (virus) code. - - - - - banners-by-size: Kill banners by size (very efficient!) - - - - - shockwave-flash: Kill embedded Shockwave Flash objects - - - - - crude-parental: Kill all web pages that contain the words "sex" or "warez" - - -
+
+
- - Note: Filtering requires buffering the page content, which may appear to slow down - page rendering since nothing is displayed until all content has passed - the filters. (It does not really take longer, but seems that way since - the page is not incrementally displayed.) This effect will be more noticeable - on slower connections. - + + +<emphasis>+deanimate-gifs</emphasis> -
+ + + Type: + + + Parameterized. + + - - - Block any existing X-Forwarded-for header, and do not add a new one: - - - - - - +hide-forwarded - - - - - + + Typical uses: + + + To stop those annoying, distracting animated GIF images. + + + - - - If the browser sends a From: header containing your e-mail - address, this either completely removes the header (block), or - changes it to the specified e-mail address. - - - - - - +hide-from{block} - +hide-from{spam@sittingduck.xqq} - - - - - - - - - Don't send the Referer: (sic) header to the web site. You - can block it, forge a URL to the same server as the request (which is - preferred because some sites will not send images otherwise) or set it to a - constant, user defined string of your choice. - - - - - - +hide-referer{block} - +hide-referer{forge} - +hide-referer{http://nowhere.com} - - - - - + + Possible values: + + + last or first + + + - - - Alternative spelling of +hide-referer. It has the same - parameters, and can be freely mixed with, +hide-referer. - (referrer is the correct English spelling, however the HTTP - specification has a bug - it requires it to be spelled referer.) - - - - - - +hide-referrer{...} - - - - - + + Example usage: + + + {+deanimate-gifs{last}} + .example.com + + + - - - Change the User-Agent: header so web servers can't tell your - browser type. Warning! This breaks many web sites. Specify the - user-agent value you want. Example, pretend to be using Netscape on - Linux: - - - - - - +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)} - - - - - - + + Notes: + + + De-animate all animated GIF images, i.e. reduce them to their last frame. + This will also shrink the images considerably (in bytes, not pixels!). If + the option first is given, the first frame of the animation + is used as the replacement. If last is given, the last + frame of the animation is used instead, which probably makes more sense for + most banner animations, but also has the risk of not showing the entire + last frame (if it is only a delta to an earlier frame). + + + - - - Treat this URL as an image. This only matters if it's also +blocked, - in which case a blocked image can be sent rather than a HTML page. - See +image-blocker{} below for the control over what is actually sent. - If you want invisible ads, they should be defined as - images and blocked. And also, - image-blocker should be set to blank. Note you - cannot treat HTML pages as images in most cases. For instance, frames - require an HTML page to display. So a frame that is an ad, cannot be - treated as an image. Forcing an image in this - situation just will not work. - - - - - - +image - - - - - - - - Decides what to do with URLs that end up tagged with {+block - +image}, e.g an advertisement. There are four options. - -image-blocker will send a HTML blocked page, - usually resulting in a broken image icon. - - - -+image-blocker{blank} will send a 1x1 transparent GIF -image. And finally, +image-blocker{http://xyz.com} will send a -HTTP temporary redirect to the specified image. This has the advantage of the -icon being being cached by the browser, which will speed up the display. -+image-blocker{pattern} will send a checkerboard type pattern: - - - - - - - - - - +image-blocker{blank} - +image-blocker{pattern} - +image-blocker{http://p.p/send-banner} - - - - - - - - - By default (i.e. in the absence of a +limit-connect - action), Privoxy will only allow CONNECT - requests to port 443, which is the standard port for https as a - precaution. - - - - 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 proxy. - This can be a big security hole, since CONNECT-enabled proxies can - be abused as TCP relays very easily. - - - - If you want to allow CONNECT for more ports than this, or want to forbid - CONNECT altogether, you can specify a comma separated list of ports and - port ranges (the latter using dashes, with the minimum defaulting to 0 and - max to 65K): - + +
- - - - - +limit-connect{443} # This is the default and need no be specified. - +limit-connect{80,443} # Ports 80 and 443 are OK. - +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100 - #and above 500 are OK. - - - - + + +<emphasis>+downgrade-http-version</emphasis> - + + + Type: + + + Boolean. + + + + + Typical uses: + + + +downgrade-http-version will downgrade HTTP/1.1 client requests to + HTTP/1.0 and downgrade the responses as well. + + + + + + Possible values: + + + N/A + + + - - - +no-compression prevents the website from compressing the - data. Some websites do this, which can be a problem for - Privoxy, since +filter, - +no-popup and +gif-deanimate will not work on - compressed data. This will slow down connections to those websites, - though. Default is no-compression is turned on. - + + Example usage: + + + {+downgrade-http-version} + .example.com + + + - - - - - +nocompression - - - - - + + Notes: + + + Use this action for servers that use HTTP/1.1 protocol features that + Privoxy doesn't handle well yet. HTTP/1.1 is + only partially implemented. Default is not to downgrade requests. This is + an infrequently needed action, and is used to help with rare problem sites only. + + + + + + + + + +<emphasis>+fast-redirects</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + The +fast-redirects action enables interception of + redirect requests from one server to another, which + are used to track users.Privoxy can cut off + all but the last valid URL in a redirect request and send a local redirect + back to your browser without contacting the intermediate site(s). + + + + + + Possible values: + + + N/A + + + - - - If the website sets cookies, no-cookies-keep will make sure - they are erased when you exit and restart your web browser. This makes - profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. Default: on. - - - - - - +no-cookies-keep - - - + + Example usage: + + + {+fast-redirects} + .example.com + + + + + + Notes: + + + Many sites, like yahoo.com, don't just link to other sites. Instead, they + will link to some script on their own server, giving the destination as a + parameter, which will then redirect you to the final target. URLs + resulting from this scheme typically look like: + http://some.place/some_script?http://some.where-else. - + + Sometimes, there are even multiple consecutive redirects encoded in the + URL. These redirections via scripts make your web browsing more traceable, + since the server from which you follow such a link can see where you go + to. Apart from that, valuable bandwidth and time is wasted, while your + browser ask the server for one redirect after the other. Plus, it feeds + the advertisers. + + + This is a normally on feature, and often requires exceptions + for sites that are sensitive to defeating this mechanism. + + + + + + + + + + +<emphasis>+filter</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + Apply page filtering as defined by named sections of the + default.filter file to the specified site(s). + Filtering can be any modification of the raw + page content, including re-writing or deletion of content. + + + + + + Possible values: + + + +filter must include the name of one of the section identifiers + from default.filter (or whatever + filterfile is specified in config). + + + - - - Prevent the website from reading cookies: - - - - - - +no-cookies-read - - - - - + + Example usage (from the current default.filter): + + + + + +filter{html-annoyances}: Get rid of particularly annoying HTML abuse. + + + + + + +filter{js-annoyances}: Get rid of particularly annoying JavaScript abuse + + + + + + +filter{content-cookies}: Kill cookies that come in the HTML or JS content + + + + + + +filter{popups}: Kill all popups in JS and HTML + + + + + + +filter{frameset-borders}: Give frames a border and make them resizable + + + + + + +filter{webbugs}: Squish WebBugs (1x1 invisible GIFs used for user tracking) + + + + + + +filter{refresh-tags}: Kill automatic refresh tags (for dial-on-demand setups) + + + + + + +filter{fun}: Text replacements for subversive browsing fun! + + + + + + +filter{nimda}: Remove Nimda (virus) code. + + + + + + +filter{banners-by-size}: Kill banners by size (very efficient!) + + + + + + +filter{shockwave-flash}: Kill embedded Shockwave Flash objects + + + + + + +filter{crude-parental}: Kill all web pages that contain the words "sex" or "warez" + + + + + + + Notes: + + + This is potentially a very powerful feature! And requires a knowledge + of regular expressions if you want to roll your own. + Filtering operates on a line by line basis throughout the entire page. + + + Filtering requires buffering the page content, which may appear to + slow down page rendering since nothing is displayed until all content has + passed the filters. (It does not really take longer, but seems that way + since the page is not incrementally displayed.) This effect will be more + noticeable on slower connections. + + + Filtering can achieve some of the effects as the + +block + action, i.e. it can be used to block ads and banners. In the overall + scheme of things, filtering is one of the first things Privoxy + does with a web page. So other most other actions are applied to the + already filtered page. + + + + + + + + + + +<emphasis>+hide-forwarded-for-headers</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Block any existing X-Forwarded-for HTTP header, and do not add a new one. + + + + + + Possible values: + + + N/A + + + - - - Prevent the website from setting cookies: - - - - - - +no-cookies-set - - - - - + + Example usage: + + + {+hide-forwarded-for-headers} + .example.com + + + + + + Notes: + + + It is fairly safe to leave this on. It does not seem to break many sites. + + + + + + + + + + +<emphasis>+hide-from-header</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + To block the browser from sending your email address in a From: + header. + + + + + + Possible values: + + + Keyword: block, or any user defined value. + + + - - - Filter the website through a built-in filter to disable those obnoxious - JavaScript pop-up windows via window.open(), etc. The two alternative - spellings are equivalent. - - - - - - +no-popup - +no-popups - - - - - + + Example usage: + + + {+hide-from-header{block}} + .example.com + + + + + + Notes: + + + The keyword block will completely remove the header + (not to be confused with the +block action). + Alternately, you can specify any value you prefer to send to the web + server. + + + + + + + + + + +<emphasis>+hide-referer</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + Don't send the Referer: (sic) HTTP header to the web site. + Or, alternately send a forged header instead. + + + + + + Possible values: + + + Prevent the header from being sent with the keyword, block. + Or, forge a URL to one from the same server as the request. + Or, set to user defined value of your choice. + + + - + + Example usage: + + + {+hide-referer{forge}} + .example.com + + + + + + Notes: + + + forge is the preferred option here, since some servers will + not send images back otherwise. + - This action only applies if you are using a jarfile - for saving cookies. It sends a cookie to every site stating that you do not - accept any copyright on cookies sent to you, and asking them not to track - you. Of course, this is a (relatively) unique header they could use to - track you. - - - - - - +vanilla-wafer - - - + +hide-referrer is an alternate spelling of + +hide-referer. It has the exact same parameters, and can be freely + mixed with, +hide-referer. (referrer is the + correct English spelling, however the HTTP specification has a bug - it + requires it to be spelled as referer.) - + + + + + + + + + +<emphasis>+hide-user-agent</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + To change the User-Agent: header so web servers can't tell + your browser type. Who's business is it anyway? + + + + + + Possible values: + + + Any user defined string. + + + - - - This allows you to add an arbitrary cookie. It can be specified multiple - times in order to add as many cookies as you like. - - - - - - +wafer{name=value} - - - - - + + Example usage: + + + {+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}} + .msn.com + + + + + + Notes: + + + Warning! This breaks many web sites that depend on this in order + to determine how the target browser will respond to various + requests. Use with caution. + + + + + + + + + +<emphasis>+handle-as-image</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + To define what Privoxy should treat + automatically as an image, and is an important ingredient of how + ads are handled. + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+handle-as-image} + /.*\.(gif|jpg|jpeg|png|bmp|ico) + + + + + + Notes: + + + This only has meaning if the URL (or pattern) also is + +blocked, in which case a user definable image can + be sent rather than a HTML page. This is integral to the whole concept of + ad blocking: the URL must match both a +block rule, + and +handle-as-image. + (See +set-image-blocker + below for control over what will actually be displayed by the browser.) + + + There is little reason to change the default definition for this action. + + + + + + + + + + +<emphasis>+set-image-blocker</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + Decide what to do with URLs that end up tagged with both + +block + and +handle-as-image, + e.g an advertisement. + + + + + + Possible values: + + + There are four available options: -set-image-blocker will send a HTML + blocked page, usually resulting in a broken + image icon. + +set-image-blocker{blank} will send a + 1x1 transparent GIF image. + +set-image-blocker{pattern} will send a + checkerboard type pattern (the default). And finally, + +set-image-blocker{http://xyz.com} will + send a HTTP temporary redirect to the specified image. This has the + advantage of the icon being being cached by the browser, which will speed + up the display. + + + + + + Example usage: + + + {+set-image-blocker{blank}} + .example.com + + + + + + Notes: + + + If you want invisible ads, they need to meet + criteria as matching both images and blocked + actions. And then, image-blocker should be set to + blank for invisibility. Note you cannot treat HTML pages as + images in most cases. For instance, frames require an HTML page to + display. So a frame that is an ad, typically cannot be treated as an image. + Forcing an image in this situation just will not work + reliably. + + + + + + + + + +<emphasis>+limit-connect</emphasis> + + + + Type: + + + Parameterized. + + + + + Typical uses: + + + By default, Privoxy only allows HTTP CONNECT + requests to port 443 (the standard, secure HTTPS port). Use + +limit-connect to disable this altogether, or to allow + more ports. + + + + + + Possible values: + + + Any valid port number, or port number range. + + + + + + Example usages: + + + + + + +limit-connect{443} # This is the default and need not be specified. + +limit-connect{80,443} # Ports 80 and 443 are OK. + +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100 and above 500 are OK. + + + + + + Notes: + + + 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 proxy. + This can be a big security hole, since CONNECT-enabled proxies can be + abused as TCP relays very easily. + + + If you want to allow CONNECT for more ports than this, or want to forbid + CONNECT altogether, you can specify a comma separated list of ports and + port ranges (the latter using dashes, with the minimum defaulting to 0 and + max to 65K). + + + If you don't know what any of this means, there probably is no reason to + change this one. + + + + + + + + + +<emphasis>+prevent-compression</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Prevent the specified websites from compressing HTTP data. + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+prevent-compression} + .example.com + + + + + + Notes: + + + Some websites do this, which can be a problem for + Privoxy, since + +filter, + +kill-popups + and +gif-deanimate + will not work on compressed data. This will slow down connections to those + websites, though. Default typically is to turn + prevent-compression on. + + + + + + + + + +<emphasis>+session-cookies-only</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Allow cookies for the current browser session only. + + + + + + Possible values: + + + N/A + + + + + + Example usage (disabling): + + + {-session-cookies-only} + .example.com + + + + + + Notes: + + + If websites set cookies, +session-cookies-only will make sure + they are erased when you exit and restart your web browser. This makes + profiling cookies useless, but won't break sites which require cookies so + that you can log in for transactions. This is generally turned on for all + sites, and is the recommended setting. + + + +prevent-*-cookies actions should be turned off as well (see + below), for +session-cookies-only to work. Or, else no cookies + will get through at all. For, persistent cookies that survive + across browser sessions, see below as well. + + + + + + + + + + +<emphasis>+prevent-reading-cookies</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Explicitly prevent the web server from reading any cookies on your + system. + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+prevent-reading-cookies} + .example.com + + + + + + Notes: + + + Often used in conjunction with +prevent-setting-cookies to + disable cookies completely. Note that + +session-cookies-only + requires these to both be disabled (or else it never gets any cookies to cache). + + + For persistent cookies to work (i.e. they survive across browser + sessions and reboots), all three cookie settings should be off + for the specified sites. + + + + + + + + + + +<emphasis>+prevent-setting-cookies</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Explicitly block the web server from storing cookies on your + system. + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+prevent-setting-cookies} + .example.com + + + + + + Notes: + + + Often used in conjunction with +prevent-reading-cookies to + disable cookies completely (see above). + + + + + + + + + + +<emphasis>+kill-popups<anchor id="kill-popups"></emphasis> + + + Type: + + + Boolean. + + + + + Typical uses: + + + Stop those annoying JavaScript pop-up windows! + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+kill-popups} + .example.com + + + + + + Notes: + + + +kill-popups uses a built in filter to disable pop-ups + that use the window.open() function, etc. This is + one of the first actions processed by Privoxy + as it contacts the remote web server. This action is not always 100% reliable, + and is supplemented by +filter{popups}. + + + + + + + + + + + +<emphasis>+send-vanilla-wafer</emphasis> + + + + Type: + + + Boolean. + + + + + Typical uses: + + + Sends a cookie for every site stating that you do not accept any copyright + on cookies sent to you, and asking them not to track you. + + + + + + Possible values: + + + N/A + + + + + + Example usage: + + + {+send-vanilla-wafer} + .example.com + + + + + + Notes: + + + This action only applies if you are using a jarfile + for saving cookies. Of course, this is a (relatively) unique header and + could conceivably be used to track you. + + + + + + + + + + +<emphasis>+send-wafer</emphasis> + + + + Type: + + + Multi-value. + + + + + Typical uses: + + + This allows you to send an arbitrary, user definable cookie. + + + + + + Possible values: + + + User specified cookie name and corresponding value. + + + + + + Example usage: + + + {+send-wafer{name=value}} + .example.com + + + - + + Notes: + + + This can be specified multiple times in order to add as many cookies as you + like. + + + + + + + + + + +Summary + + Note that many of these actions have the potential to cause a page to + misbehave, possibly even not to display at all. There are many ways + a site designer may choose to design his site, and what HTTP header + content, and other criteria, he may depend on. There is no way to have hard + and fast rules for all sites. See the Appendix for a brief example on troubleshooting + actions. + + + + +Sample Actions Files - The meaning of any of the above is reversed by preceding the action with a - -, in place of the +. + Remember that the meaning of any of the above references is reversed by preceding + the action with a -, in place of the +. Also, + that some actions are turned on in the default section of the actions file, + and require little to no additional configuration. These are just on. - Some examples: + But, other actions that are turned on in the default section do + typically require exceptions to be listed in the latter sections of + one of our actions file. For instance, by default no URLs are + blocked (i.e. in the default definitions of + default.action). We need exceptions to this in order to + enable ad blocking in the lower sections. But we need to + be very selective about what we do block. Thus, the default is off + for blocking. - Turn off cookies by default, then allow a few through for specified sites: + Below is a liberally commented sample default.action file + to demonstrate how all the pieces come together. And to show how exceptions + to the default policies can be handled. This is followed by a brief + user.action with similar examples. - + - # Turn off all persistent cookies - { +no-cookies-read } - { +no-cookies-set } - # Allow cookies for this browser session ONLY - { +no-cookies-keep } - - # Exceptions to the above, sites that benefit from persistent cookies - { -no-cookies-read } - { -no-cookies-set } - { -no-cookies-keep } - .javasoft.com - .sun.com - .yahoo.com - .msdn.microsoft.com - .redhat.com +# Sample default.action file <developers@privoxy.org> + +# Settings -- Don't change! For internal Privoxy use ONLY. +{{settings}} +for-privoxy-version=3.0 + + +########################################################################## +# Aliases must be defined *before* they are used. These are +# easier to remember, and can combine several actions into one. Once +# defined they can be used just like any built-in action -- but within +# this file only! Aliases do not require a + or - sign. +########################################################################## + +# Some useful aliases. +# Alias to turn off cookie handling, ie allow all cookies unmolested. + -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies \ + -session-cookies-only + +# Alias to both block and treat as if an image for ad blocking +# purposes. + +imageblock = +block +handle-as-image + +# Fragile sites should have the minimum changes: + fragile = -block -deanimate-gifs -fast-redirects -filter -hide-referer \ + -prevent-cookies -kill-popups + +# Shops should be allowed to set persistent cookies + shop = -filter -prevent-cookies -session-cookies-only + + +########################################################################## +# Begin default action settings. Anything in this section will match +# all URLs -- UNLESS we have exceptions that also match, defined below this +# section. We will show all potential actions here whether they are on +# or off. We could omit any disabled action if we wanted, since all +# actions are 'off' by default anyway. Shown for completeness only. +# Actions are enabled if preceded by a '+', otherwise they are disabled +# (unless an alias has been defined without this). +########################################################################## + { \ + -add-header \ + -block \ + -deanimate-gifs \ + -downgrade-http-version \ + +fast-redirects \ + +filter{html-annoyances} \ + +filter{js-annoyances} \ + -filter{content-cookies} \ + -filter{popups} \ + +filter{webbugs} \ + -filter{refresh-tags} \ + -filter{fun} \ + +filter{nimda} \ + +filter{banners-by-size} \ + -filter{shockwave-flash} \ + -filter{crude-prental} \ + +hide-forwarded-for-headers \ + +hide-from-header{block} \ + -hide-referrer \ + -hide-user-agent \ + -handle-as-image \ + +set-image-blocker{pattern} \ + -limit-connect \ + +prevent-compression \ + -session-cookies-only \ + -prevent-reading-cookies \ + -prevent-setting-cookies \ + -kill-popups \ + -send-vanilla-wafer \ + -send-wafer \ + } + / # forward slash will match *all* potential URL patterns. + +########################################################################## +# Default behavior is now set. Now we will define some exceptions to our +# default action policies. +########################################################################## + +# These sites are very complex and require very minimal interference. +# We'll disable most actions with our 'fragile' alias: + { fragile } + .office.microsoft.com # surprise, surprise! + .windowsupdate.microsoft.com + + +# Shopping sites - not as fragile but require some special +# handling. We still want to block ads, and we will allow +# persistant cookies via the 'shop' alias: + { shop } + .quietpc.com + .worldpay.com # for quietpc.com + .jungle.com + .scan.co.uk + + +# These sites require pop-ups too :( We'll combine our 'shop' +# alias with two other actions into one rule to allow all popups. + { shop -kill-popups -filter{popups} } + .dabs.com + .overclockers.co.uk + + +# The 'Fast-redirects' action breaks some sites. Disable this action +# for these known sensitive sites: + { -fast-redirects } + login.yahoo.com + edit.europe.yahoo.com + .google.com + .altavista.com/.*(like|url|link):http + .altavista.com/trans.*urltext=http + .nytimes.com + - # Alternative way of saying the same thing - {-no-cookies-set -no-cookies-read -no-cookies-keep} +# Define which file types will be treated as images. Important +# for ad blocking. + { +handle-as-image } + /.*\.(gif|jpe?g|png|bmp|ico) + + +# Now lets list some domains that are known ad generators. And +# our alias that we use here will block these as well as force +# them to be treated as images. This combination of actions is +# important for ad blocking. What the browser will show instead is +# determined by the setting of +set-image-blocker + { +imageblock } + ar.atwola.com + .ad.doubleclick.net + .a.yimg.com/(?:(?!/i/).)*$ + .a[0-9].yimg.com/(?:(?!/i/).)*$ + bs*.gsanet.com + bs*.einets.com + .qkimg.net + ad.*.doubleclick.net + + +# These will just simply be blocked. They will generate the BLOCKED +# banner page, if matched. Heavy use of wildcards and regular +# expressions in this example. Enable block action: + { +block } + ad*. + .*ads. + banner?. + count*. + /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?) + /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/ + .hitbox.com + + +# The above block section will probably inadvertantly catch some +# sites we DO NOT want blocked via the wildcards and regular expressions. +# Now let's set exceptions to the exceptions so the good guys get better +# treatment. Disable block action: + { -block } + advogato.org + adsl. + ad[ud]*. + advice. +# Let's just trust all .edu top level domains. + .edu + www.ugu.com/sui/ugu/adv +# We'll need to access to path names containing 'download' + .*downloads. + /downloads/ +# 'adv' is for globalintersec and means advanced, not advertisement + www.globalintersec.com/adv + + +# Don't filter *anything* from our friends at sourceforge. +# Notice we don't have to name the individual filter +# identifiers -- we just turn them all off in one fell swoop. +# Disable all filters for this one site: + { -filter } .sourceforge.net - .sf.net - Now turn off fast redirects, and then we allow two exceptions: + So far we are painting with a broad brush by setting general policies. + The above would be a reasonable starting point for many situations. Now, + we want to be more specific and have customized rules that are more suitable + to our personal habits and preferences. These would be for narrowly defined + situations like your ISP or your bank, and should be placed in + user.action, which is parsed after all other + actions files and should not be clobbered by upgrades. So any settings here, + will have the last word and over-ride any previously defined actions. - - - - # Turn them off! - {+fast-redirects} - - # Reverse it for these two sites, which don't work right without it. - {-fast-redirects} - www.ukc.ac.uk/cgi-bin/wac\.cgi\? - login.yahoo.com - - - + Now a few examples of some things that one might do with a + user.action file. - - Turn on page filtering according to rules in the defined sections - of default.filter, and make one exception for - Sourceforge: - + - # Run everything through the filter file, using only the - # specified sections: - +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}\ - +filter{webbugs} +filter{nimda} +filter{banners-by-size} - - # Then disable filtering of code from sourceforge! - {-filter} - .cvs.sourceforge.net - - - - +# Sample user.action file. + +# Any aliases you want to use need to be re-defined here. +# Alias to turn off cookie handling, ie allow all cookies unmolested. + -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies \ + -session-cookies-only + +# Fragile sites should have the minimum changes: + fragile = -block -deanimate-gifs -fast-redirects -filter -hide-referer \ + -prevent-cookies -kill-popups + +# Allow persistent cookies for a few regular sites that we +# trust via our above alias. These will be saved from one browser session +# to the next. We are explicity turning off any and all cookie handling, +# even though the prevent-*-cookie settings were disabled in our above +# default.action anyway. So cookies from these domains will come through +# unmolested. + { -prevent-cookies } + .sun.com + .yahoo.com + .msdn.microsoft.com + .redhat.com - - Now some URLs that we want blocked (normally generates - the blocked banner). Many of these use regular expressions - that will expand to match multiple URLs: - - - - - - # Blocklist: - {+block} - /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g)) - /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/]) - /.*/(ng)?adclient\.cgi - /.*/(plain|live|rotate)[-_.]?ads?/ - /.*/(sponsor)s?[0-9]?/ - /.*/_?(plain|live)?ads?(-banners)?/ - /.*/abanners/ - /.*/ad(sdna_image|gifs?)/ - /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe) - /.*/adbanners/ - /.*/adserver - /.*/adstream\.cgi - /.*/adv((er)?ts?|ertis(ing|ements?))?/ - /.*/banner_?ads/ - /.*/banners?/ - /.*/banners?\.cgi/ - /.*/cgi-bin/centralad/getimage - /.*/images/addver\.gif - /.*/images/marketing/.*\.(gif|jpe?g) - /.*/popupads/ - /.*/siteads/ - /.*/sponsor.*\.gif - /.*/sponsors?[0-9]?/ - /.*/advert[0-9]+\.jpg - /Media/Images/Adds/ - /ad_images/ - /adimages/ - /.*/ads/ - /bannerfarm/ - /grafikk/annonse/ - /graphics/defaultAd/ - /image\.ng/AdType - /image\.ng/transactionID - /images/.*/.*_anim\.gif # alvin brattli - /ip_img/.*\.(gif|jpe?g) - /rotateads/ - /rotations/ - /worldnet/ad\.cgi - /cgi-bin/nph-adclick.exe/ - /.*/Image/BannerAdvertising/ - /.*/ad-bin/ - /.*/adlib/server\.cgi - /autoads/ +# My ISP uses obnoxious self promoting images on many pages. +# Nuke them :) Note that +handle-as-image need not be specified, +# since all URLs ending in .gif will be tagged as images by the +# general rules in default.action anyway. + { +block } + www.my-isp-example.com/logo[0-9].gif + + +# Say the site where you do your homebanking needs to open +# popup windows, but you have chosen to kill popups by +# default. This will allow it for your-example-bank.com: +# + { -filter{popups} -kill-popups } + .my-example-bank.com + + +# This site is delicate, and requires kid-glove +# treatment. + { fragile } + .forbes.com - - Note that many of these actions have the potential to cause a page to - misbehave, possibly even not to display at all. There are many ways - a site designer may choose to design his site, and what HTTP header - content he may depend on. There is no way to have hard and fast rules - for all sites. See the Appendix - for a brief example on troubleshooting actions. - - + - + Aliases Custom actions, known to Privoxy @@ -3406,9 +4665,11 @@ icon being being cached by the browser, which will speed up the display. { or }. But please use only a- z, 0-9, +, and -. Alias names are not case sensitive, and - must be defined before anything else in the - default.actionfile! And there can only be one set of - aliases defined. + must be defined before other actions in the + actions file! And there can only be one set of aliases + defined per file. Each actions file may have its own aliases, but they are + only visible within that file. Aliases do not requir a + or + - sign in front, since they are merely expanded. @@ -3421,17 +4682,16 @@ icon being being cached by the browser, which will speed up the display. # Useful custom aliases we can use later. These must come first! {{alias}} - +no-cookies = +no-cookies-set +no-cookies-read - -no-cookies = -no-cookies-set -no-cookies-read - fragile = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups - shop = -no-cookies -filter -fast-redirects - +imageblock = +block +image - - #For people who don't like to type too much: ;-) - c0 = +no-cookies - c1 = -no-cookies - c2 = -no-cookies-set +no-cookies-read - c3 = +no-cookies-set -no-cookies-read + +prevent-cookies = +prevent-setting-cookies +prevent-reading-cookies + -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies + fragile = -block -prevent-cookies -filter -fast-redirects -hide-referer -kill-popups + shop = -prevent-cookies -filter -fast-redirects + +imageblock = +block +handle-as-image + + # Aliases defined from other aliases, for people who don't like to type + # too much: ;-) + c0 = +prevent-cookies + c1 = -prevent-cookies #... etc. Customize to your heart's content. @@ -3440,7 +4700,9 @@ icon being being cached by the browser, which will speed up the display. Some examples using our shop and fragile - aliases from above: + aliases from above. These would appear in the lower sections of an + actions file as exceptions to the default actions (as defined in the + upper section): @@ -3450,21 +4712,20 @@ icon being being cached by the browser, which will speed up the display. # These sites are very complex and require # minimal interference. {fragile} - .office.microsoft.com - .windowsupdate.microsoft.com - .nytimes.com + .office.microsoft.com + .windowsupdate.microsoft.com + .nytimes.com - # Shopping sites - still want to block ads. + # Shopping sites - but we still want to block ads. {shop} - .quietpc.com - .worldpay.com # for quietpc.com - .jungle.com - .scan.co.uk - - # These shops require pop-ups - {shop -no-popups} - .dabs.com - .overclockers.co.uk + .quietpc.com + .worldpay.com # for quietpc.com + .scan.co.uk + + # These shops require pop-ups also + {shop -kill-popups} + .dabs.com + .overclockers.co.uk @@ -3477,20 +4738,23 @@ icon being being cached by the browser, which will speed up the display. - + - - + + + + The Filter File Any web page can be dynamically modified with the filter file. This modification can be removal, or re-writing, of any web page content, including tags and non-visible content. The default filter file is - default.filter, located in the config directory. + oddly enough default.filter, located in the config + directory. @@ -3583,32 +4847,58 @@ icon being being cached by the browser, which will speed up the display. + + + +The <emphasis>+filter</emphasis> Action + + Filters are enabled with the +filter action from within + one of the actions files. +filter requires one parameter, which + should match one of the section identifiers in the filter file itself. Example: + + + + +filter{html-annoyances} + + + + This would activate that particular filter. Similarly, +filter + can be turned off for selected sites as: + -filter{html-annoyances}. Remember too, all actions are off by + default, unless they are explicity enabled in one of the actions files. + + + + - + Templates When Privoxy displays one of its internal - pages, such as a 404 Not Found error page, it uses the appropriate template. - On Linux, BSD, and Unix, these are located in - /etc/privoxy/templates by default. These may be - customized, if desired. cgi-style.css is - used to control the HTML attributes (fonts, etc). - - - The default Blocked banner page with the bright red top + pages, such as a 404 Not Found error page + (Privoxy must be running for link to work as + intended), it uses the appropriate template. On Linux, BSD, and Unix, these + are located in /etc/privoxy/templates by default. These + may be customized, if desired. cgi-style.css is used to + control the HTML attributes (fonts, etc). + + + The default +Blocked +(Privoxy needs to be running for page to display) + banner page with the bright red top banner, is called just blocked. This may be customized or replaced with something else if desired. - - @@ -3624,37 +4914,6 @@ Requests &contacting; - - - -Submitting Ads and <quote>Action</quote> Problems - - Ads and banners that are not stopped by Privoxy - can be submitted to the developers by accessing a special page and filling - out the brief, required form. Conversely, you can also report pages, images, - etc. that Privoxy is blocking, but should not. - The form itself does require Internet access. - - - To do this, point your browser to Privoxy - at http://config.privoxy.org/ - (shortcut: http://p.p/), and then select - Actions file feedback system, - near the bottom of the page. Paste in the URL that is the cause of the - unwanted behavior, and follow the prompts. The developers will - try to incorporate a fix for the problem you reported into future versions. - - - - New default.actions files will occasionally be made - available based on your feedback. These - will be announced on the - ijbswa-announce - list. - - - @@ -3773,14 +5032,18 @@ Requests \ - The escape character denotes that the following character should be taken literally. This is used where one of the special characters (e.g. .) needs to be taken literally and - not as a special meta-character. + not as a special meta-character. Example: example\.com, makes + sure the period is recognized only as a period (and not expanded to its + meta-character meaning of any single character). [] - Characters enclosed in brackets will be matched if - any of the enclosed characters are encountered. + any of the enclosed characters are encountered. For instance, [0-9] + matches any numeric digit (zero through nine). As an example, we can combine + this with + to match any digit one of more times: [0-9]+. @@ -3795,7 +5058,10 @@ Requests | - The bar character works like an or conditional statement. A match is successful if the - sub-expression on either side of | matches. + sub-expression on either side of | matches. As an example: + /(this|that) example/ uses grouping and the bar character + and would match either this example or that + example, and nothing else. @@ -3803,7 +5069,7 @@ Requests s/string1/string2/g - This is used to rewrite strings of text. string1 is replaced by string2 in this - example. + example. There must of course be a match on string1 first. @@ -3970,7 +5236,8 @@ Requests - Show information about the current configuration: + Show information about the current configuration, including viewing and + editing of actions files:
@@ -3992,7 +5259,7 @@ Requests - Show the client's request headers: + Show the browser's request headers:
@@ -4036,23 +5303,12 @@ Requests
- - - - Edit the actions list file: - -
- - http://config.privoxy.org/edit-actions - -
-
- These may be bookmarked for quick reference. + These may be bookmarked for quick reference. See next. @@ -4080,31 +5336,35 @@ Requests - Enable Privoxy + Privoxy - Enable - Disable Privoxy + Privoxy - Disable - Toggle Privoxy (Toggles between enabled and disabled) + Privoxy - Toggle Privoxy (Toggles between enabled and disabled) - View Privoxy Status + Privoxy- View Status - Actions file feedback system + Privoxy - Submit Filter Feedback @@ -4125,115 +5385,253 @@ Requests + + +Chain of Events + + Let's take a quick look at the basic sequence of events when a web page is + requested by your browser and Privoxy is on duty: + + + + + + + First, your web browser requests a web page. The browser knows to send + the request to Privoxy, which will in turn, + relay the request to the remote web server after passing the following + tests: + + + + + Privoxy traps any request for its own internal CGI + pages (e.g http://p.p/) and sends the CGI page back to the browser. + + + + + Next, Privoxy checks to see if the URL + matches any +block patterns. If + so, the URL is then blocked, and the remote web server will not be contacted. + +handle-as-image + is then checked and if it does not match, an + HTML BLOCKED page is sent back. Otherwise, if it does match, + an image is returned. The type of image depends on the setting of +set-image-blocker + (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere). + + + + + Untrusted URLs are blocked. If URLs are being added to the + trust file, then that is done. + + + + + If the URL pattern matches the +fast-redirects action, + it is then processed. Unwanted parts of the requested URL are stripped. + + + + + Now the rest of the client browser's request headers are processed. If any + of these match any of the relevant actions (e.g. +hide-user-agent, + etc.), headers are suppressed or forged as determined by these actions and + their parameters. + + + + + Now the web server starts sending its response back (i.e. typically a web page and related + data). + + + + + First, the server headers are read and processed to determine, among other + things, the MIME type (document type) and encoding. The headers are then + filtered as deterimed by the + +prevent-setting-cookies, + +session-cookies-only, + and +downgrade-http-version + 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 a +filter + or +deanimate-gifs + action applies (and the document type fits the action), the rest of the page is + read into memory (up to a configurable limit). Then the filter rules (from + default.filter) are processed against the buffered + content. Filters are applied in the order they are specified in the + default.filter file. Animated GIFs, if present, are + reduced to either the first or last frame, depending on the action + setting.The entire page, which is now filtered, is then sent by + Privoxy back to your browser. + + + If neither +filter + or +deanimate-gifs + matches, then Privoxy passes the raw data through + to the client browser as it becomes available. + + + + + As the browser receives the now (probably filtered) page content, it + reads and then requests any URLs that may be embedded within the page + source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g. + frames), sounds, etc. For each of these objects, the browser issues a new + request. And each such request is in turn processed as above. Note that a + complex web page may have many such embedded URLs. + + + + + + + + + Anatomy of an Action - The way Privoxy applies actions - and filters to any given URL can be complex, and not always so + The way Privoxy applies + actions + and filters + to any given URL can be complex, and not always so easy to understand what is happening. And sometimes we need to be able to see just what Privoxy is doing. Especially, if something Privoxy is doing is causing us a problem inadvertently. It can be a little daunting to look at the actions and filters files themselves, since they tend to be filled with regular expressions whose consequences are not always - so obvious. Privoxy provides the + so obvious. + + + + One quick test to see if Privoxy is causing a problem + or not, is to disable it temporarily. This should be the first troubleshooting + step. See the Bookmarklets section on a quick + and easy way to do this (be sure to flush caches afterward!). + + + + Privoxy also provides the http://config.privoxy.org/show-url-info page that can show us very specifically how actions are being applied to any given URL. This is a big help for troubleshooting. - + First, enter one URL (or partial URL) at the prompt, and then Privoxy will tell us how the current configuration will handle it. This will not - help with filtering effects from the default.filter file! It - also will not tell you about any other URLs that may be embedded within the - URL you are testing (i.e. a web page). For instance, images such as ads are expressed as URLs - within the raw page source of HTML pages. So you will only get info for the - actual URL that is pasted into the prompt area -- not any sub-URLs. If you - want to know about embedded URLs like ads, you will have to dig those out of - the HTML source. Use your browser's View Page Source option - for this. Or right click on the ad, and grab the URL. + help with filtering effects (i.e. the +filter action) from + the default.filter file since this is handled very + differently and not so easy to trap! It also will not tell you about any other + URLs that may be embedded within the URL you are testing. For instance, images + such as ads are expressed as URLs within the raw page source of HTML pages. So + you will only get info for the actual URL that is pasted into the prompt area + -- not any sub-URLs. If you want to know about embedded URLs like ads, you + will have to dig those out of the HTML source. Use your browser's View + Page Source option for this. Or right click on the ad, and grab the + URL. - Let's look at an example, google.com, - one section at a time: + Let's try an example, google.com, + and look at it one section at a time: - System default actions: - - { -add-header -block -deanimate-gifs -downgrade -fast-redirects -filter - -hide-forwarded -hide-from -hide-referer -hide-user-agent -image - -image-blocker -limit-connect -no-compression -no-cookies-keep - -no-cookies-read -no-cookies-set -no-popups -vanilla-wafer -wafer } - - - - - - This is the top section, and only tells us of the compiled in defaults. This - is basically what Privoxy would do if there - were not any actions defined, i.e. it does nothing. Every action - is disabled. This is not particularly informative for our purposes here. OK, - next section: - + Matches for http://google.com: - - +--- File standard --- +(no matches in this file) - Matches for http://google.com: +--- File default --- - { -add-header -block +deanimate-gifs -downgrade +fast-redirects - +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups} - +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal} - +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge} - -hide-user-agent -image +image-blocker{blank} +no-compression - +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups - -vanilla-wafer -wafer } - / +{ -add-header -block +deanimate-gifs{last} -downgrade-http-version +fast-redirects + -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental} + +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies} + +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size} + +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge} + -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect + +prevent-compression +session-cookies-only -prevent-reading-cookies + -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer } +/ - { -no-cookies-keep -no-cookies-read -no-cookies-set } - .google.com + { -session-cookies-only } + .google.com { -fast-redirects } - .google.com + .google.com - +--- File user --- +(no matches in this file) + - This is much more informative, and tells us how we have defined our - actions, and which ones match for our example, - google.com. The first grouping shows our default - settings, which would apply to all URLs. If you look at your actions - file, this would be the section just below the aliases section - near the top. This applies to all URLs as signified by the single forward - slash -- /. - + This tells us how we have defined our + actions, and + which ones match for our example, google.com. The first listing + is any matches for the standard.action file. No hits at + all here on standard. Then next is default, or + our default.action file. The large, multi-line listing, + is how the actions are set to match for all URLs, i.e. our default settings. + If you look at your actions file, this would be the section + just below the aliases section near the top. This will apply to + all URLs as signified by the single forward slash at the end of the listing + -- /. - These are the default actions we have enabled. But we can define additional - actions that would be exceptions to these general rules, and then list - specific URLs that these exceptions would apply to. Last match wins. - Just below this then are two explicit matches for .google.com. - The first is negating our various cookie blocking actions (i.e. we will allow - cookies here). The second is allowing fast-redirects. Note - that there is a leading dot here -- .google.com. This will - match any hosts and sub-domains, in the google.com domain also, such as - www.google.com. So, apparently, we have these actions defined - somewhere in the lower part of our actions file, and - google.com is referenced in these sections. + But we can define additional actions that would be exceptions to these general + rules, and then list specific URLs (or patterns) that these exceptions would + apply to. Last match wins. Just below this then are two explicit matches for + .google.com. The first is negating our previous cookie setting, + which was for +session-cookies-only + (i.e. not persistent). So we will allow persistent cookies for google. The + second turns off any + +fast-redirects + action, allowing this to take place unmolested. Note that there is a leading + dot here -- .google.com. This will match any hosts and + sub-domains, in the google.com domain also, such as + www.google.com. So, apparently, we have these two actions + defined somewhere in the lower part of our default.action + file, and google.com is referenced somewhere in these latter + sections. + + + Then, for our user.action file, we again have no hits. - And now we pull it altogether in the bottom section and summarize how + And finally we pull it all together in the bottom section and summarize how Privoxy is applying all its actions to google.com: @@ -4243,16 +5641,20 @@ Requests Final results: + -add-header -block +deanimate-gifs{last} -downgrade-http-version -fast-redirects + -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental} + +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies} + +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size} + +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge} + -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect + +prevent-compression -session-cookies-only -prevent-reading-cookies + -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer + + - -add-header -block -deanimate-gifs -downgrade -fast-redirects - +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups} - +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal} - +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge} - -hide-user-agent -image +image-blocker{blank} -limit-connect +no-compression - -no-cookies-keep -no-cookies-read -no-cookies-set +no-popups -vanilla-wafer - -wafer - - + + Notice the only difference here to the previous listing, is to + fast-redirects and session-cookies-only. @@ -4262,24 +5664,24 @@ Requests - { +block +image } + { +block +handle-as-image } .ad.doubleclick.net - { +block +image } + { +block +handle-as-image } ad*. - { +block +image } + { +block +handle-as-image } .doubleclick.net - - + We'll just show the interesting part here, the explicit matches. It is - matched three different times. Each as an +block +image, + matched three different times. Each as an +block +handle-as-image, which is the expanded form of one of our aliases that had been defined as: - +imageblock. (Aliases are defined in the - first section of the actions file and typically used to combine more + +imageblock. (Aliases are defined in + the first section of the actions file and typically used to combine more than one action.) @@ -4289,9 +5691,13 @@ Requests would also cover the first. No point in taking chances with these guys though ;-) Note that if you want an ad or obnoxious URL to be invisible, it should be defined as ad.doubleclick.net - is done here -- as both a +block and an - +image. The custom alias +imageblock does this - for us. + is done here -- as both a +block + and an + +handle-as-image. + The custom alias +imageblock just simplifies the process and make + it more readable. @@ -4304,27 +5710,26 @@ Requests Matches for http://www.rhapsodyk.net/adsl/HOWTO/: - { -add-header -block +deanimate-gifs -downgrade +fast-redirects - +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups} + { -add-header -block +deanimate-gifs -downgrade-http-version +fast-redirects + +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups} +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal} - +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge} - -hide-user-agent -image +image-blocker{blank} +no-compression - +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups - -vanilla-wafer -wafer } + +filter{fun} +hide-forwarded-for-headers +hide-from-header{block} + +hide-referer{forge} -hide-user-agent -handle-as-image +set-image-blocker{blank} + +prevent-compression +session-cookies-only -prevent-setting-cookies + -prevent-reading-cookies +kill-popups -send-vanilla-wafer -send-wafer } / - { +block +image } + { +block +handle-as-image } /ads - - + Ooops, the /adsl/ is matching /ads! But we did not want this at all! Now we see why we get the blank page. We could now add a new action below this that explicitly does not - block (-block) pages with adsl. There are various ways to - handle such exceptions. Example: + block ({-block}) paths with adsl. There are + various ways to handle such exceptions. Example: @@ -4332,8 +5737,7 @@ Requests { -block } /adsl - - + @@ -4349,10 +5753,9 @@ Requests - { -block } - /adsl - - + { +block +handle-as-image } + /ads + @@ -4373,14 +5776,13 @@ Requests .jungle.com .scan.co.uk .forbes.com - - + {shop} is an alias that expands to - { -filter -no-cookies -no-cookies-keep }. Or you could do - your own exception to negate filtering: + { -filter -session-cookies-only }. + Or you could do your own exception to negate filtering: @@ -4389,8 +5791,12 @@ Requests {-filter} .forbes.com - - + + + + + This would probably be most appropriately put in user.action, + for local site exceptions. @@ -4425,6 +5831,66 @@ Requests Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Log: user-manual.sgml,v $ + Revision 1.100 2002/04/29 03:05:55 hal9 + Add clarification on differences of new actions files. + + Revision 1.99 2002/04/28 16:59:05 swa + more structure in starting section + + Revision 1.98 2002/04/28 05:43:59 hal9 + This is the break up of configuration.html into multiple files. This + will probably break links elsewhere :( + + Revision 1.97 2002/04/27 21:04:42 hal9 + -Rewrite of Actions File example. + -Add section for user-manual directive in config. + + Revision 1.96 2002/04/27 05:32:00 hal9 + -Add short section to Filter Files to tie in with +filter action. + -Start rewrite of examples in Actions Examples (not finished). + + Revision 1.95 2002/04/26 17:23:29 swa + bookmarks cleaned, changed structure of user manual, screen and programlisting cleanups, and numerous other changes that I forgot + + Revision 1.94 2002/04/26 05:24:36 hal9 + -Add most of Andreas suggestions to Chain of Events section. + -A few other minor corrections and touch up. + + Revision 1.92 2002/04/25 18:55:13 hal9 + More catchups on new actions files, and new actions names. + Other assorted cleanups, and minor modifications. + + Revision 1.91 2002/04/24 02:39:31 hal9 + Add 'Chain of Events' section. + + Revision 1.90 2002/04/23 21:41:25 hal9 + Linuxconf is deprecated on RH, substitute chkconfig. + + Revision 1.89 2002/04/23 21:05:28 oes + Added hint for startup on Red Hat + + Revision 1.88 2002/04/23 05:37:54 hal9 + Add AmigaOS install stuff. + + Revision 1.87 2002/04/23 02:53:15 david__schmidt + Updated OSX installation section + Added a few English tweaks here an there + + Revision 1.86 2002/04/21 01:46:32 hal9 + Re-write actions section. + + Revision 1.85 2002/04/18 21:23:23 hal9 + Fix ugly typo (mine). + + Revision 1.84 2002/04/18 21:17:13 hal9 + Spell Redhat correctly (ie Red Hat). A few minor grammar corrections. + + Revision 1.83 2002/04/18 18:21:12 oes + Added RPM install detail + + Revision 1.82 2002/04/18 12:04:50 oes + Cosmetics + Revision 1.81 2002/04/18 11:50:24 oes Extended Install section - needs fixing by packagers