1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>Actions Files</title>
6 <meta name="GENERATOR" content=
7 "Modular DocBook HTML Stylesheet Version 1.79">
8 <link rel="HOME" title="Privoxy 3.0.27 User Manual" href="index.html">
9 <link rel="PREVIOUS" title="The Main Configuration File" href=
11 <link rel="NEXT" title="Filter Files" href="filter-file.html">
12 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
13 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14 <link rel="STYLESHEET" type="text/css" href="p_doc.css">
16 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
17 "#840084" alink="#0000FF">
18 <div class="NAVHEADER">
19 <table summary="Header navigation table" width="100%" border="0"
20 cellpadding="0" cellspacing="0">
22 <th colspan="3" align="center">Privoxy 3.0.27 User Manual</th>
25 <td width="10%" align="left" valign="bottom"><a href="config.html"
26 accesskey="P">Prev</a></td>
27 <td width="80%" align="center" valign="bottom"></td>
28 <td width="10%" align="right" valign="bottom"><a href=
29 "filter-file.html" accesskey="N">Next</a></td>
32 <hr align="left" width="100%">
35 <h1 class="SECT1"><a name="ACTIONS-FILE" id="ACTIONS-FILE">8. Actions
37 <p>The actions files are used to define what <span class=
38 "emphasis"><i class="EMPHASIS">actions</i></span> <span class=
39 "APPLICATION">Privoxy</span> takes for which URLs, and thus determines
40 how ad images, cookies and various other aspects of HTTP content and
41 transactions are handled, and on which sites (or even parts thereof).
42 There are a number of such actions, with a wide range of functionality.
43 Each action does something a little different. These actions give us a
44 veritable arsenal of tools with which to exert our control, preferences
45 and independence. Actions can be combined so that their effects are
46 aggregated when applied against a given set of URLs.</p>
47 <p>There are three action files included with <span class=
48 "APPLICATION">Privoxy</span> with differing purposes:</p>
51 <p><tt class="FILENAME">match-all.action</tt> - is used to define
52 which <span class="QUOTE">"actions"</span> relating to
53 banner-blocking, images, pop-ups, content modification, cookie
54 handling etc should be applied by default. It should be the first
55 actions file loaded</p>
58 <p><tt class="FILENAME">default.action</tt> - defines many exceptions
59 (both positive and negative) from the default set of actions that's
60 configured in <tt class="FILENAME">match-all.action</tt>. It is a set
61 of rules that should work reasonably well as-is for most users. This
62 file is only supposed to be edited by the developers. It should be
63 the second actions file loaded.</p>
66 <p><tt class="FILENAME">user.action</tt> - is intended to be for
67 local site preferences and exceptions. As an example, if your ISP or
68 your bank has specific requirements, and need special handling, this
69 kind of thing should go here. This file will not be upgraded.</p>
72 <p><span class="GUIBUTTON">Edit</span> <span class="GUIBUTTON">Set to
73 Cautious</span> <span class="GUIBUTTON">Set to Medium</span>
74 <span class="GUIBUTTON">Set to Advanced</span></p>
75 <p>These have increasing levels of aggressiveness <span class=
76 "emphasis"><i class="EMPHASIS">and have no influence on your browsing
77 unless you select them explicitly in the editor</i></span>. A default
78 installation should be pre-set to <tt class="LITERAL">Cautious</tt>.
79 New users should try this for a while before adjusting the settings
80 to more aggressive levels. The more aggressive the settings, then the
81 more likelihood there is of problems such as sites not working as
83 <p>The <span class="GUIBUTTON">Edit</span> button allows you to turn
84 each action on/off individually for fine-tuning. The <span class=
85 "GUIBUTTON">Cautious</span> button changes the actions list to
86 low/safe settings which will activate ad blocking and a minimal set
87 of <span class="APPLICATION">Privoxy</span>'s features, and
88 subsequently there will be less of a chance for accidental problems.
89 The <span class="GUIBUTTON">Medium</span> button sets the list to a
90 medium level of other features and a low level set of privacy
91 features. The <span class="GUIBUTTON">Advanced</span> button sets the
92 list to a high level of ad blocking and medium level of privacy. See
93 the chart below. The latter three buttons over-ride any changes via
94 with the <span class="GUIBUTTON">Edit</span> button. More fine-tuning
95 can be done in the lower sections of this internal page.</p>
96 <p>While the actions file editor allows to enable these settings in
97 all actions files, they are only supposed to be enabled in the first
98 one to make sure you don't unintentionally overrule earlier
100 <p>The default profiles, and their associated actions, as pre-defined
101 in <tt class="FILENAME">default.action</tt> are:</p>
103 <a name="AEN2859" id="AEN2859"></a>
104 <p><b>Table 1. Default Configurations</b></p>
105 <table border="1" frame="border" rules="all" class="CALSTABLE">
106 <col width="1*" title="C1">
107 <col width="1*" title="C2">
108 <col width="1*" title="C3">
109 <col width="1*" title="C4">
120 <td>Ad-blocking Aggressiveness</td>
126 <td>Ad-filtering by size</td>
132 <td>Ad-filtering by link</td>
138 <td>Pop-up killing</td>
144 <td>Privacy Features</td>
150 <td>Cookie handling</td>
152 <td>session-only</td>
156 <td>Referer forging</td>
162 <td>GIF de-animation</td>
168 <td>Fast redirects</td>
180 <td>JavaScript taming</td>
186 <td>Web-bug killing</td>
192 <td>Image tag reordering</td>
202 <p>The list of actions files to be used are defined in the main
203 configuration file, and are processed in the order they are defined (e.g.
204 <tt class="FILENAME">default.action</tt> is typically processed before
205 <tt class="FILENAME">user.action</tt>). The content of these can all be
206 viewed and edited from <a href="http://config.privoxy.org/show-status"
207 target="_top">http://config.privoxy.org/show-status</a>. The over-riding
208 principle when applying actions, is that the last action that matches a
209 given URL wins. The broadest, most general rules go first (defined in
210 <tt class="FILENAME">default.action</tt>), followed by any exceptions
211 (typically also in <tt class="FILENAME">default.action</tt>), which are
212 then followed lastly by any local preferences (typically in <span class=
213 "emphasis"><i class="EMPHASIS">user</i></span><tt class=
214 "FILENAME">.action</tt>). Generally, <tt class=
215 "FILENAME">user.action</tt> has the last word.</p>
216 <p>An actions file typically has multiple sections. If you want to use
217 <span class="QUOTE">"aliases"</span> in an actions file, you have to
218 place the (optional) <a href="actions-file.html#ALIASES">alias
219 section</a> at the top of that file. Then comes the default set of rules
220 which will apply universally to all sites and pages (be <span class=
221 "emphasis"><i class="EMPHASIS">very careful</i></span> with using such a
222 universal set in <tt class="FILENAME">user.action</tt> or any other
223 actions file after <tt class="FILENAME">default.action</tt>, because it
224 will override the result from consulting any previous file). And then
225 below that, exceptions to the defined universal policies. You can regard
226 <tt class="FILENAME">user.action</tt> as an appendix to <tt class=
227 "FILENAME">default.action</tt>, with the advantage that it is a separate
228 file, which makes preserving your personal settings across <span class=
229 "APPLICATION">Privoxy</span> upgrades easier.</p>
230 <p>Actions can be used to block anything you want, including ads,
231 banners, or just some obnoxious URL whose content you would rather not
232 see. Cookies can be accepted or rejected, or accepted only during the
233 current browser session (i.e. not written to disk), content can be
234 modified, some JavaScripts tamed, user-tracking fooled, and much more.
235 See below for a <a href="actions-file.html#ACTIONS">complete list of
238 <h2 class="SECT2"><a name="RIGHT-MIX" id="RIGHT-MIX">8.1. Finding the
240 <p>Note that some <a href="actions-file.html#ACTIONS">actions</a>, like
241 cookie suppression or script disabling, may render some sites unusable
242 that rely on these techniques to work properly. Finding the right mix
243 of actions is not always easy and certainly a matter of personal taste.
244 And, things can always change, requiring refinements in the
245 configuration. In general, it can be said that the more <span class=
246 "QUOTE">"aggressive"</span> your default settings (in the top section
247 of the actions file) are, the more exceptions for <span class=
248 "QUOTE">"trusted"</span> sites you will have to make later. If, for
249 example, you want to crunch all cookies per default, you'll have to
250 make exceptions from that rule for sites that you regularly use and
251 that require cookies for actually useful purposes, like maybe your
252 bank, favorite shop, or newspaper.</p>
253 <p>We have tried to provide you with reasonable rules to start from in
254 the distribution actions files. But there is no general rule of thumb
255 on these things. There just are too many variables, and sites are
256 constantly changing. Sooner or later you will want to change the rules
257 (and read this chapter again :).</p>
260 <h2 class="SECT2"><a name="HOW-TO-EDIT" id="HOW-TO-EDIT">8.2. How to
262 <p>The easiest way to edit the actions files is with a browser by using
263 our browser-based editor, which can be reached from <a href=
264 "http://config.privoxy.org/show-status" target=
265 "_top">http://config.privoxy.org/show-status</a>. Note: the config file
267 "config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions</a> must be
268 enabled for this to work. The editor allows both fine-grained control
269 over every single feature on a per-URL basis, and easy choosing from
270 wholesale sets of defaults like <span class="QUOTE">"Cautious"</span>,
271 <span class="QUOTE">"Medium"</span> or <span class=
272 "QUOTE">"Advanced"</span>. Warning: the <span class=
273 "QUOTE">"Advanced"</span> setting is more aggressive, and will be more
274 likely to cause problems for some sites. Experienced users only!</p>
275 <p>If you prefer plain text editing to GUIs, you can of course also
276 directly edit the the actions files with your favorite text editor.
277 Look at <tt class="FILENAME">default.action</tt> which is richly
278 commented with many good examples.</p>
281 <h2 class="SECT2"><a name="ACTIONS-APPLY" id="ACTIONS-APPLY">8.3. How
282 Actions are Applied to Requests</a></h2>
283 <p>Actions files are divided into sections. There are special sections,
284 like the <span class="QUOTE">"<a href=
285 "actions-file.html#ALIASES">alias</a>"</span> sections which will be
286 discussed later. For now let's concentrate on regular sections: They
287 have a heading line (often split up to multiple lines for readability)
288 which consist of a list of actions, separated by whitespace and
289 enclosed in curly braces. Below that, there is a list of URL and tag
290 patterns, each on a separate line.</p>
291 <p>To determine which actions apply to a request, the URL of the
292 request is compared to all URL patterns in each <span class=
293 "QUOTE">"action file"</span>. Every time it matches, the list of
294 applicable actions for the request is incrementally updated, using the
295 heading of the section in which the pattern is located. The same is
296 done again for tags and tag patterns later on.</p>
297 <p>If multiple applying sections set the same action differently, the
298 last match wins. If not, the effects are aggregated. E.g. a URL might
299 match a regular section with a heading line of <tt class="LITERAL">{
300 +<a href="actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a>
301 }</tt>, then later another one with just <tt class="LITERAL">{
302 +<a href="actions-file.html#BLOCK">block</a> }</tt>, resulting in
303 <span class="emphasis"><i class="EMPHASIS">both</i></span> actions to
304 apply. And there may well be cases where you will want to combine
305 actions together. Such a section then might look like:</p>
306 <table border="0" bgcolor="#E0E0E0" width="100%">
309 <pre class="SCREEN"> { +<tt class=
310 "LITERAL">handle-as-image</tt> +<tt class=
311 "LITERAL">block{Banner ads.}</tt> }
312 # Block these as if they were images. Send no block page.
314 media.example.com/.*banners
315 .example.com/images/ads/</pre>
319 <p>You can trace this process for URL patterns and any given URL by
320 visiting <a href="http://config.privoxy.org/show-url-info" target=
321 "_top">http://config.privoxy.org/show-url-info</a>.</p>
322 <p>Examples and more detail on this is provided in the Appendix,
323 <a href="appendix.html#ACTIONSANAT">Troubleshooting: Anatomy of an
324 Action</a> section.</p>
327 <h2 class="SECT2"><a name="AF-PATTERNS" id="AF-PATTERNS">8.4.
329 <p>As mentioned, <span class="APPLICATION">Privoxy</span> uses
330 <span class="QUOTE">"patterns"</span> to determine what <span class=
331 "emphasis"><i class="EMPHASIS">actions</i></span> might apply to which
332 sites and pages your browser attempts to access. These <span class=
333 "QUOTE">"patterns"</span> use wild card type <span class=
334 "emphasis"><i class="EMPHASIS">pattern</i></span> matching to achieve a
335 high degree of flexibility. This allows one expression to be expanded
336 and potentially match against many similar patterns.</p>
337 <p>Generally, an URL pattern has the form <tt class=
338 "LITERAL"><host><port>/<path></tt>, where the
339 <tt class="LITERAL"><host></tt>, the <tt class=
340 "LITERAL"><port></tt> and the <tt class=
341 "LITERAL"><path></tt> are optional. (This is why the special
342 <tt class="LITERAL">/</tt> pattern matches all URLs). Note that the
343 protocol portion of the URL pattern (e.g. <tt class=
344 "LITERAL">http://</tt>) should <span class="emphasis"><i class=
345 "EMPHASIS">not</i></span> be included in the pattern. This is assumed
347 <p>The pattern matching syntax is different for the host and path parts
348 of the URL. The host part uses a simple globbing type matching
349 technique, while the path part uses more flexible <a href=
350 "http://en.wikipedia.org/wiki/Regular_expressions" target=
351 "_top"><span class="QUOTE">"Regular Expressions"</span></a> (POSIX
353 <p>The port part of a pattern is a decimal port number preceded by a
354 colon (<tt class="LITERAL">:</tt>). If the host part contains a
355 numerical IPv6 address, it has to be put into angle brackets
356 (<tt class="LITERAL"><</tt>, <tt class="LITERAL">></tt>).</p>
357 <div class="VARIABLELIST">
359 <dt><tt class="LITERAL">www.example.com/</tt></dt>
361 <p>is a host-only pattern and will match any request to
362 <tt class="LITERAL">www.example.com</tt>, regardless of which
363 document on that server is requested. So ALL pages in this domain
364 would be covered by the scope of this action. Note that a simple
365 <tt class="LITERAL">example.com</tt> is different and would NOT
368 <dt><tt class="LITERAL">www.example.com</tt></dt>
370 <p>means exactly the same. For host-only patterns, the trailing
371 <tt class="LITERAL">/</tt> may be omitted.</p>
373 <dt><tt class="LITERAL">www.example.com/index.html</tt></dt>
375 <p>matches all the documents on <tt class=
376 "LITERAL">www.example.com</tt> whose name starts with <tt class=
377 "LITERAL">/index.html</tt>.</p>
379 <dt><tt class="LITERAL">www.example.com/index.html$</tt></dt>
381 <p>matches only the single document <tt class=
382 "LITERAL">/index.html</tt> on <tt class=
383 "LITERAL">www.example.com</tt>.</p>
385 <dt><tt class="LITERAL">/index.html$</tt></dt>
387 <p>matches the document <tt class="LITERAL">/index.html</tt>,
388 regardless of the domain, i.e. on <span class=
389 "emphasis"><i class="EMPHASIS">any</i></span> web server
392 <dt><tt class="LITERAL">/</tt></dt>
394 <p>Matches any URL because there's no requirement for either the
395 domain or the path to match anything.</p>
397 <dt><tt class="LITERAL">:8000/</tt></dt>
399 <p>Matches any URL pointing to TCP port 8000.</p>
401 <dt><tt class="LITERAL">10.0.0.1/</tt></dt>
403 <p>Matches any URL with the host address <tt class=
404 "LITERAL">10.0.0.1</tt>. (Note that the real URL uses plain
405 brackets, not angle brackets.)</p>
407 <dt><tt class="LITERAL"><2001:db8::1>/</tt></dt>
409 <p>Matches any URL with the host address <tt class=
410 "LITERAL">2001:db8::1</tt>. (Note that the real URL uses plain
411 brackets, not angle brackets.)</p>
413 <dt><tt class="LITERAL">index.html</tt></dt>
415 <p>matches nothing, since it would be interpreted as a domain
416 name and there is no top-level domain called <tt class=
417 "LITERAL">.html</tt>. So its a mistake.</p>
422 <h3 class="SECT3"><a name="HOST-PATTERN" id="HOST-PATTERN">8.4.1. The
423 Host Pattern</a></h3>
424 <p>The matching of the host part offers some flexible options: if the
425 host pattern starts or ends with a dot, it becomes unanchored at that
426 end. The host pattern is often referred to as domain pattern as it is
427 usually used to match domain names and not IP addresses. For
429 <div class="VARIABLELIST">
431 <dt><tt class="LITERAL">.example.com</tt></dt>
433 <p>matches any domain with first-level domain <tt class=
434 "LITERAL">com</tt> and second-level domain <tt class=
435 "LITERAL">example</tt>. For example <tt class=
436 "LITERAL">www.example.com</tt>, <tt class=
437 "LITERAL">example.com</tt> and <tt class=
438 "LITERAL">foo.bar.baz.example.com</tt>. Note that it wouldn't
439 match if the second-level domain was <tt class=
440 "LITERAL">another-example</tt>.</p>
442 <dt><tt class="LITERAL">www.</tt></dt>
444 <p>matches any domain that <span class="emphasis"><i class=
445 "EMPHASIS">STARTS</i></span> with <tt class="LITERAL">www.</tt>
446 (It also matches the domain <tt class="LITERAL">www</tt> but
447 most of the time that doesn't matter.)</p>
449 <dt><tt class="LITERAL">.example.</tt></dt>
451 <p>matches any domain that <span class="emphasis"><i class=
452 "EMPHASIS">CONTAINS</i></span> <tt class=
453 "LITERAL">.example.</tt>. And, by the way, also included would
454 be any files or documents that exist within that domain since
455 no path limitations are specified. (Correctly speaking: It
456 matches any FQDN that contains <tt class="LITERAL">example</tt>
457 as a domain.) This might be <tt class=
458 "LITERAL">www.example.com</tt>, <tt class=
459 "LITERAL">news.example.de</tt>, or <tt class=
460 "LITERAL">www.example.net/cgi/testing.pl</tt> for instance. All
461 these cases are matched.</p>
465 <p>Additionally, there are wild-cards that you can use in the domain
466 names themselves. These work similarly to shell globbing type
467 wild-cards: <span class="QUOTE">"*"</span> represents zero or more
468 arbitrary characters (this is equivalent to the <a href=
469 "http://en.wikipedia.org/wiki/Regular_expressions" target=
470 "_top"><span class="QUOTE">"Regular Expression"</span></a> based
471 syntax of <span class="QUOTE">".*"</span>), <span class=
472 "QUOTE">"?"</span> represents any single character (this is
473 equivalent to the regular expression syntax of a simple <span class=
474 "QUOTE">"."</span>), and you can define <span class=
475 "QUOTE">"character classes"</span> in square brackets which is
476 similar to the same regular expression technique. All of this can be
478 <div class="VARIABLELIST">
480 <dt><tt class="LITERAL">ad*.example.com</tt></dt>
482 <p>matches <span class="QUOTE">"adserver.example.com"</span>,
483 <span class="QUOTE">"ads.example.com"</span>, etc but not
484 <span class="QUOTE">"sfads.example.com"</span></p>
486 <dt><tt class="LITERAL">*ad*.example.com</tt></dt>
488 <p>matches all of the above, and then some.</p>
490 <dt><tt class="LITERAL">.?pix.com</tt></dt>
492 <p>matches <tt class="LITERAL">www.ipix.com</tt>, <tt class=
493 "LITERAL">pictures.epix.com</tt>, <tt class=
494 "LITERAL">a.b.c.d.e.upix.com</tt> etc.</p>
496 <dt><tt class="LITERAL">www[1-9a-ez].example.c*</tt></dt>
498 <p>matches <tt class="LITERAL">www1.example.com</tt>,
499 <tt class="LITERAL">www4.example.cc</tt>, <tt class=
500 "LITERAL">wwwd.example.cy</tt>, <tt class=
501 "LITERAL">wwwz.example.com</tt> etc., but <span class=
502 "emphasis"><i class="EMPHASIS">not</i></span> <tt class=
503 "LITERAL">wwww.example.com</tt>.</p>
507 <p>While flexible, this is not the sophistication of full regular
508 expression based syntax.</p>
511 <h3 class="SECT3"><a name="PATH-PATTERN" id="PATH-PATTERN">8.4.2. The
512 Path Pattern</a></h3>
513 <p><span class="APPLICATION">Privoxy</span> uses <span class=
514 "QUOTE">"modern"</span> POSIX 1003.2 <a href=
515 "http://en.wikipedia.org/wiki/Regular_expressions" target=
516 "_top"><span class="QUOTE">"Regular Expressions"</span></a> for
517 matching the path portion (after the slash), and is thus more
519 <p>There is an <a href="appendix.html#REGEX">Appendix</a> with a
520 brief quick-start into regular expressions, you also might want to
521 have a look at your operating system's documentation on regular
522 expressions (try <tt class="LITERAL">man re_format</tt>).</p>
523 <p>Note that the path pattern is automatically left-anchored at the
524 <span class="QUOTE">"/"</span>, i.e. it matches as if it would start
525 with a <span class="QUOTE">"^"</span> (regular expression speak for
526 the beginning of a line).</p>
527 <p>Please also note that matching in the path is <span class=
528 "emphasis"><i class="EMPHASIS">CASE INSENSITIVE</i></span> by
529 default, but you can switch to case sensitive at any point in the
530 pattern by using the <span class="QUOTE">"(?-i)"</span> switch:
531 <tt class="LITERAL">www.example.com/(?-i)PaTtErN.*</tt> will match
532 only documents whose path starts with <tt class=
533 "LITERAL">PaTtErN</tt> in <span class="emphasis"><i class=
534 "EMPHASIS">exactly</i></span> this capitalization.</p>
535 <div class="VARIABLELIST">
537 <dt><tt class="LITERAL">.example.com/.*</tt></dt>
539 <p>Is equivalent to just <span class=
540 "QUOTE">".example.com"</span>, since any documents within that
541 domain are matched with or without the <span class=
542 "QUOTE">".*"</span> regular expression. This is redundant</p>
544 <dt><tt class="LITERAL">.example.com/.*/index.html$</tt></dt>
546 <p>Will match any page in the domain of <span class=
547 "QUOTE">"example.com"</span> that is named <span class=
548 "QUOTE">"index.html"</span>, and that is part of some path. For
549 example, it matches <span class=
550 "QUOTE">"www.example.com/testing/index.html"</span> but NOT
551 <span class="QUOTE">"www.example.com/index.html"</span> because
552 the regular expression called for at least two <span class=
553 "QUOTE">"/'s"</span>, thus the path requirement. It also would
555 "QUOTE">"www.example.com/testing/index_html"</span>, because of
556 the special meta-character <span class="QUOTE">"."</span>.</p>
558 <dt><tt class="LITERAL">.example.com/(.*/)?index\.html$</tt></dt>
560 <p>This regular expression is conditional so it will match any
561 page named <span class="QUOTE">"index.html"</span> regardless
562 of path which in this case can have one or more <span class=
563 "QUOTE">"/'s"</span>. And this one must contain exactly
564 <span class="QUOTE">".html"</span> (and end with that!).</p>
567 "LITERAL">.example.com/(.*/)(ads|banners?|junk)</tt></dt>
569 <p>This regular expression will match any path of <span class=
570 "QUOTE">"example.com"</span> that contains any of the words
571 <span class="QUOTE">"ads"</span>, <span class=
572 "QUOTE">"banner"</span>, <span class="QUOTE">"banners"</span>
573 (because of the <span class="QUOTE">"?"</span>) or <span class=
574 "QUOTE">"junk"</span>. The path does not have to end in these
575 words, just contain them. The path has to contain at least two
576 slashes (including the one at the beginning).</p>
579 "LITERAL">.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</tt></dt>
581 <p>This is very much the same as above, except now it must end
582 in either <span class="QUOTE">".jpg"</span>, <span class=
583 "QUOTE">".jpeg"</span>, <span class="QUOTE">".gif"</span> or
584 <span class="QUOTE">".png"</span>. So this one is limited to
585 common image formats.</p>
589 <p>There are many, many good examples to be found in <tt class=
590 "FILENAME">default.action</tt>, and more tutorials below in <a href=
591 "appendix.html#REGEX">Appendix on regular expressions</a>.</p>
594 <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The
595 Request Tag Pattern</a></h3>
596 <p>Request tag patterns are used to change the applying actions based
597 on the request's tags. Tags can be created based on HTTP headers with
599 "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or
601 "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
603 <p>Request tag patterns have to start with <span class=
604 "QUOTE">"TAG:"</span>, so <span class="APPLICATION">Privoxy</span>
605 can tell them apart from other patterns. Everything after the colon
606 including white space, is interpreted as a regular expression with
607 path pattern syntax, except that tag patterns aren't left-anchored
608 automatically (<span class="APPLICATION">Privoxy</span> doesn't
609 silently add a <span class="QUOTE">"^"</span>, you have to do it
610 yourself if you need it).</p>
611 <p>To match all requests that are tagged with <span class=
612 "QUOTE">"foo"</span> your pattern line should be <span class=
613 "QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span>
614 would work as well, but it would also match requests whose tags
615 contain <span class="QUOTE">"foo"</span> somewhere. <span class=
616 "QUOTE">"TAG: foo"</span> wouldn't work as it requires white
618 <p>Sections can contain URL and request tag patterns at the same
619 time, but request tag patterns are checked after the URL patterns and
620 thus always overrule them, even if they are located before the URL
622 <p>Once a new request tag is added, Privoxy checks right away if it's
623 matched by one of the request tag patterns and updates the action
624 settings accordingly. As a result request tags can be used to
625 activate other tagger actions, as long as these other taggers look
626 for headers that haven't already be parsed.</p>
627 <p>For example you could tag client requests which use the <tt class=
628 "LITERAL">POST</tt> method, then use this tag to activate another
629 tagger that adds a tag if cookies are sent, and then use a block
630 action based on the cookie tag. This allows the outcome of one
631 action, to be input into a subsequent action. However if you'd
632 reverse the position of the described taggers, and activated the
633 method tagger based on the cookie tagger, no method tags would be
634 created. The method tagger would look for the request line, but at
635 the time the cookie tag is created, the request line has already been
637 <p>While this is a limitation you should be aware of, this kind of
638 indirection is seldom needed anyway and even the example doesn't make
642 <h3 class="SECT3"><a name="NEGATIVE-TAG-PATTERNS" id=
643 "NEGATIVE-TAG-PATTERNS">8.4.4. The Negative Request Tag
645 <p>To match requests that do not have a certain request tag, specify
646 a negative tag pattern by prefixing the tag pattern line with either
647 <span class="QUOTE">"NO-REQUEST-TAG:"</span> or <span class=
648 "QUOTE">"NO-RESPONSE-TAG:"</span> instead of <span class=
649 "QUOTE">"TAG:"</span>.</p>
650 <p>Negative request tag patterns created with <span class=
651 "QUOTE">"NO-REQUEST-TAG:"</span> are checked after all client headers
652 are scanned, the ones created with <span class=
653 "QUOTE">"NO-RESPONSE-TAG:"</span> are checked after all server
654 headers are scanned. In both cases all the created tags are
658 <h3 class="SECT3"><a name="CLIENT-TAG-PATTERN" id=
659 "CLIENT-TAG-PATTERN">8.4.5. The Client Tag Pattern</a></h3>
660 <div class="WARNING">
661 <table class="WARNING" border="1" width="100%">
663 <td align="center"><b>Warning</b></td>
667 <p>This is an experimental feature. The syntax is likely to
668 change in future versions.</p>
673 <p>Client tag patterns are not set based on HTTP headers but based on
674 the client's IP address. Users can enable them themselves, but the
675 Privoxy admin controls which tags are available and what their effect
677 <p>After a client-specific tag has been defined with the <a href=
678 "config.html#CLIENT-SPECIFIC-TAG">client-specific-tag</a>, directive,
679 action sections can be activated based on the tag by using a
680 CLIENT-TAG pattern. The CLIENT-TAG pattern is evaluated at the same
681 priority as URL patterns, as a result the last matching pattern wins.
682 Tags that are created based on client or server headers are evaluated
683 later on and can overrule CLIENT-TAG and URL patterns!</p>
684 <p>The tag is set for all requests that come from clients that
685 requested it to be set. Note that "clients" are differentiated by IP
686 address, if the IP address changes the tag has to be requested
688 <p>Clients can request tags to be set by using the CGI interface
689 <a href="http://config.privoxy.org/client-tags" target=
690 "_top">http://config.privoxy.org/client-tags</a>.</p>
692 <table border="0" bgcolor="#E0E0E0" width="100%">
696 # If the admin defined the client-specific-tag circumvent-blocks,
697 # and the request comes from a client that previously requested
698 # the tag to be set, overrule all previous +block actions that
699 # are enabled based on URL to CLIENT-TAG patterns.
701 CLIENT-TAG:^circumvent-blocks$
703 # This section is not overruled because it's located after
705 {+block{Nobody is supposed to request this.}}
706 example.org/blocked-example-page</pre>
713 <h2 class="SECT2"><a name="ACTIONS" id="ACTIONS">8.5. Actions</a></h2>
714 <p>All actions are disabled by default, until they are explicitly
715 enabled somewhere in an actions file. Actions are turned on if preceded
716 with a <span class="QUOTE">"+"</span>, and turned off if preceded with
717 a <span class="QUOTE">"-"</span>. So a <tt class="LITERAL">+action</tt>
718 means <span class="QUOTE">"do that action"</span>, e.g. <tt class=
719 "LITERAL">+block</tt> means <span class="QUOTE">"please block URLs that
720 match the following patterns"</span>, and <tt class=
721 "LITERAL">-block</tt> means <span class="QUOTE">"don't block URLs that
722 match the following patterns, even if <tt class="LITERAL">+block</tt>
723 previously applied."</span></p>
724 <p>Again, actions are invoked by placing them on a line, enclosed in
725 curly braces and separated by whitespace, like in <tt class=
726 "LITERAL">{+some-action -some-other-action{some-parameter}}</tt>,
727 followed by a list of URL patterns, one per line, to which they apply.
728 Together, the actions line and the following pattern lines make up a
729 section of the actions file.</p>
730 <p>Actions fall into three categories:</p>
733 <p>Boolean, i.e the action can only be <span class=
734 "QUOTE">"enabled"</span> or <span class="QUOTE">"disabled"</span>.
736 <table border="0" bgcolor="#E0E0E0" width="90%">
739 <pre class="SCREEN"> +<tt class=
740 "REPLACEABLE"><i>name</i></tt> # enable action <tt class=
741 "REPLACEABLE"><i>name</i></tt>
743 "REPLACEABLE"><i>name</i></tt> # disable action <tt class="REPLACEABLE"><i>name</i></tt></pre>
747 <p>Example: <tt class="LITERAL">+handle-as-image</tt></p>
750 <p>Parameterized, where some value is required in order to enable
751 this type of action. Syntax:</p>
752 <table border="0" bgcolor="#E0E0E0" width="90%">
755 <pre class="SCREEN"> +<tt class=
756 "REPLACEABLE"><i>name</i></tt>{<tt class=
757 "REPLACEABLE"><i>param</i></tt>} # enable action and set parameter to <tt class="REPLACEABLE"><i>param</i></tt>,
758 # overwriting parameter from previous match if necessary
760 "REPLACEABLE"><i>name</i></tt> # disable action. The parameter can be omitted</pre>
764 <p>Note that if the URL matches multiple positive forms of a
765 parameterized action, the last match wins, i.e. the params from
766 earlier matches are simply ignored.</p>
767 <p>Example: <tt class="LITERAL">+hide-user-agent{Mozilla/5.0 (X11;
768 U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602
769 Firefox/2.0.0.4}</tt></p>
772 <p>Multi-value. These look exactly like parameterized actions, but
773 they behave differently: If the action applies multiple times to
774 the same URL, but with different parameters, <span class=
775 "emphasis"><i class="EMPHASIS">all</i></span> the parameters from
776 <span class="emphasis"><i class="EMPHASIS">all</i></span> matches
777 are remembered. This is used for actions that can be executed for
778 the same request repeatedly, like adding multiple headers, or
779 filtering through multiple filters. Syntax:</p>
780 <table border="0" bgcolor="#E0E0E0" width="90%">
783 <pre class="SCREEN"> +<tt class=
784 "REPLACEABLE"><i>name</i></tt>{<tt class=
785 "REPLACEABLE"><i>param</i></tt>} # enable action and add <tt class=
786 "REPLACEABLE"><i>param</i></tt> to the list of parameters
787 -<tt class="REPLACEABLE"><i>name</i></tt>{<tt class=
788 "REPLACEABLE"><i>param</i></tt>} # remove the parameter <tt class=
789 "REPLACEABLE"><i>param</i></tt> from the list of parameters
790 # If it was the last one left, disable the action.
792 "REPLACEABLE"><i>-name</i></tt> # disable this action completely and remove all parameters from the list</pre>
796 <p>Examples: <tt class="LITERAL">+add-header{X-Fun-Header: Some
797 text}</tt> and <tt class=
798 "LITERAL">+filter{html-annoyances}</tt></p>
801 <p>If nothing is specified in any actions file, no <span class=
802 "QUOTE">"actions"</span> are taken. So in this case <span class=
803 "APPLICATION">Privoxy</span> would just be a normal, non-blocking,
804 non-filtering proxy. You must specifically enable the privacy and
805 blocking features you need (although the provided default actions files
806 will give a good starting point).</p>
807 <p>Later defined action sections always over-ride earlier ones of the
808 same type. So exceptions to any rules you make, should come in the
809 latter part of the file (or in a file that is processed later when
810 using multiple actions files such as <tt class=
811 "FILENAME">user.action</tt>). For multi-valued actions, the actions are
812 applied in the order they are specified. Actions files are processed in
813 the order they are defined in <tt class="FILENAME">config</tt> (the
814 default installation has three actions files). It also quite possible
815 for any given URL to match more than one <span class=
816 "QUOTE">"pattern"</span> (because of wildcards and regular
817 expressions), and thus to trigger more than one set of actions! Last
819 <p>The list of valid <span class="APPLICATION">Privoxy</span> actions
822 <h4 class="SECT3"><a name="ADD-HEADER" id="ADD-HEADER">8.5.1.
824 <div class="VARIABLELIST">
826 <dt>Typical use:</dt>
828 <p>Confuse log analysis, custom applications</p>
832 <p>Sends a user defined HTTP header to the web server.</p>
840 <p>Any string value is possible. Validity of the defined HTTP
841 headers is not checked. It is recommended that you use the
842 <span class="QUOTE">"<tt class="LITERAL">X-</tt>"</span> prefix
843 for custom headers.</p>
847 <p>This action may be specified multiple times, in order to
848 define multiple headers. This is rarely needed for the typical
849 user. If you don't know what <span class="QUOTE">"HTTP
850 headers"</span> are, you definitely don't need to worry about
852 <p>Headers added by this action are not modified by other
855 <dt>Example usage:</dt>
857 <table border="0" bgcolor="#E0E0E0" width="90%">
861 # Add a DNT ("Do not track") header to all requests,
862 # event to those that already have one.
864 # This is just an example, not a recommendation.
866 # There is no reason to believe that user-tracking websites care
867 # about the DNT header and depending on the User-Agent, adding the
868 # header may make user-tracking easier.
869 {+add-header{DNT: 1}}
879 <h4 class="SECT3"><a name="BLOCK" id="BLOCK">8.5.2. block</a></h4>
880 <div class="VARIABLELIST">
882 <dt>Typical use:</dt>
884 <p>Block ads or other unwanted content</p>
888 <p>Requests for URLs to which this action applies are blocked,
889 i.e. the requests are trapped by <span class=
890 "APPLICATION">Privoxy</span> and the requested URL is never
891 retrieved, but is answered locally with a substitute page or
892 image, as determined by the <tt class="LITERAL"><a href=
893 "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
894 <tt class="LITERAL"><a href=
895 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>,
896 and <tt class="LITERAL"><a href=
897 "actions-file.html#HANDLE-AS-EMPTY-DOCUMENT">handle-as-empty-document</a></tt>
902 <p>Parameterized.</p>
906 <p>A block reason that should be given to the user.</p>
910 <p><span class="APPLICATION">Privoxy</span> sends a special
911 <span class="QUOTE">"BLOCKED"</span> page for requests to
912 blocked pages. This page contains the block reason given as
913 parameter, a link to find out why the block action applies, and
914 a click-through to the blocked content (the latter only if the
915 force feature is available and enabled).</p>
916 <p>A very important exception occurs if <span class=
917 "emphasis"><i class="EMPHASIS">both</i></span> <tt class=
918 "LITERAL">block</tt> and <tt class="LITERAL"><a href=
919 "actions-file.html#HANDLE-AS-IMAGE">handle-as-image</a></tt>,
920 apply to the same request: it will then be replaced by an
921 image. If <tt class="LITERAL"><a href=
922 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
923 (see below) also applies, the type of image will be determined
924 by its parameter, if not, the standard checkerboard pattern is
926 <p>It is important to understand this process, in order to
927 understand how <span class="APPLICATION">Privoxy</span> deals
928 with ads and other unwanted content. Blocking is a core
929 feature, and one upon which various other features depend.</p>
930 <p>The <tt class="LITERAL"><a href=
931 "actions-file.html#FILTER">filter</a></tt> action can perform a
932 very similar task, by <span class="QUOTE">"blocking"</span>
933 banner images and other content through rewriting the relevant
934 URLs in the document's HTML source, so they don't get requested
935 in the first place. Note that this is a totally different
936 technique, and it's easy to confuse the two.</p>
938 <dt>Example usage (section):</dt>
940 <table border="0" bgcolor="#E0E0E0" width="90%">
943 <pre class="SCREEN">{+block{No nasty stuff for you.}}
944 # Block and replace with "blocked" page
945 .nasty-stuff.example.com
947 {+block{Doubleclick banners.} +handle-as-image}
948 # Block and replace with image
952 {+block{Layered ads.} +handle-as-empty-document}
953 # Block and then ignore
954 adserver.example.net/.*\.js$</pre>
963 <h4 class="SECT3"><a name="CHANGE-X-FORWARDED-FOR" id=
964 "CHANGE-X-FORWARDED-FOR">8.5.3. change-x-forwarded-for</a></h4>
965 <div class="VARIABLELIST">
967 <dt>Typical use:</dt>
969 <p>Improve privacy by not forwarding the source of the request
970 in the HTTP headers.</p>
974 <p>Deletes the <span class="QUOTE">"X-Forwarded-For:"</span>
975 HTTP header from the client request, or adds a new one.</p>
979 <p>Parameterized.</p>
985 <p><span class="QUOTE">"block"</span> to delete the
989 <p><span class="QUOTE">"add"</span> to create the header
990 (or append the client's IP address to an already existing
997 <p>It is safe and recommended to use <tt class=
998 "LITERAL">block</tt>.</p>
999 <p>Forwarding the source address of the request may make sense
1000 in some multi-user setups but is also a privacy risk.</p>
1002 <dt>Example usage:</dt>
1004 <table border="0" bgcolor="#E0E0E0" width="90%">
1007 <pre class="SCREEN">+change-x-forwarded-for{block}</pre>
1016 <h4 class="SECT3"><a name="CLIENT-HEADER-FILTER" id=
1017 "CLIENT-HEADER-FILTER">8.5.4. client-header-filter</a></h4>
1018 <div class="VARIABLELIST">
1020 <dt>Typical use:</dt>
1022 <p>Rewrite or remove single client headers.</p>
1026 <p>All client headers to which this action applies are filtered
1027 on-the-fly through the specified regular expression based
1036 <p>The name of a client-header filter, as defined in one of the
1037 <a href="filter-file.html">filter files</a>.</p>
1041 <p>Client-header filters are applied to each header on its own,
1042 not to all at once. This makes it easier to diagnose problems,
1043 but on the downside you can't write filters that only change
1044 header x if header y's value is z. You can do that by using
1046 <p>Client-header filters are executed after the other header
1047 actions have finished and use their output as input.</p>
1048 <p>If the request URI gets changed, <span class=
1049 "APPLICATION">Privoxy</span> will detect that and use the new
1050 one. This can be used to rewrite the request destination behind
1051 the client's back, for example to specify a Tor exit relay for
1052 certain requests.</p>
1053 <p>Please refer to the <a href="filter-file.html">filter file
1054 chapter</a> to learn which client-header filters are available
1055 by default, and how to create your own.</p>
1057 <dt>Example usage (section):</dt>
1059 <table border="0" bgcolor="#E0E0E0" width="90%">
1062 <pre class="SCREEN">
1063 # Hide Tor exit notation in Host and Referer Headers
1064 {+client-header-filter{hide-tor-exit-notation}}
1075 <h4 class="SECT3"><a name="CLIENT-HEADER-TAGGER" id=
1076 "CLIENT-HEADER-TAGGER">8.5.5. client-header-tagger</a></h4>
1077 <div class="VARIABLELIST">
1079 <dt>Typical use:</dt>
1081 <p>Block requests based on their headers.</p>
1085 <p>Client headers to which this action applies are filtered
1086 on-the-fly through the specified regular expression based
1087 substitutions, the result is used as tag.</p>
1095 <p>The name of a client-header tagger, as defined in one of the
1096 <a href="filter-file.html">filter files</a>.</p>
1100 <p>Client-header taggers are applied to each header on its own,
1101 and as the header isn't modified, each tagger <span class=
1102 "QUOTE">"sees"</span> the original.</p>
1103 <p>Client-header taggers are the first actions that are
1104 executed and their tags can be used to control every other
1107 <dt>Example usage (section):</dt>
1109 <table border="0" bgcolor="#E0E0E0" width="90%">
1112 <pre class="SCREEN">
1113 # Tag every request with the User-Agent header
1114 {+client-header-tagger{user-agent}}
1117 # Tagging itself doesn't change the action
1118 # settings, sections with TAG patterns do:
1120 # If it's a download agent, use a different forwarding proxy,
1121 # show the real User-Agent and make sure resume works.
1122 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
1123 -hide-if-modified-since \
1124 -overwrite-last-modified \
1129 TAG:^User-Agent: NetBSD-ftp/
1130 TAG:^User-Agent: Novell ZYPP Installer
1131 TAG:^User-Agent: RPM APT-HTTP/
1132 TAG:^User-Agent: fetch libfetch/
1133 TAG:^User-Agent: Ubuntu APT-HTTP/
1134 TAG:^User-Agent: MPlayer/
1139 <table border="0" bgcolor="#E0E0E0" width="90%">
1142 <pre class="SCREEN">
1143 # Tag all requests with the Range header set
1144 {+client-header-tagger{range-requests}}
1147 # Disable filtering for the tagged requests.
1149 # With filtering enabled Privoxy would remove the Range headers
1150 # to be able to filter the whole response. The downside is that
1151 # it prevents clients from resuming downloads or skipping over
1152 # parts of multimedia files.
1153 {-filter -deanimate-gifs}
1159 <table border="0" bgcolor="#E0E0E0" width="90%">
1162 <pre class="SCREEN">
1163 # Tag all requests with the client IP address
1165 # (Technically the client IP address isn't included in the
1166 # client headers but client-header taggers can set it anyway.
1167 # For details see the tagger in default.filter)
1168 {+client-header-tagger{client-ip-address}}
1171 # Change forwarding settings for requests coming from address 10.0.0.1
1172 {+forward-override{forward-socks5 127.0.1.2:2222 .}}
1173 TAG:^IP-ADDRESS: 10\.0\.0\.1$
1183 <h4 class="SECT3"><a name="CONTENT-TYPE-OVERWRITE" id=
1184 "CONTENT-TYPE-OVERWRITE">8.5.6. content-type-overwrite</a></h4>
1185 <div class="VARIABLELIST">
1187 <dt>Typical use:</dt>
1189 <p>Stop useless download menus from popping up, or change the
1190 browser's rendering mode</p>
1194 <p>Replaces the <span class="QUOTE">"Content-Type:"</span> HTTP
1199 <p>Parameterized.</p>
1207 <p>The <span class="QUOTE">"Content-Type:"</span> HTTP server
1208 header is used by the browser to decide what to do with the
1209 document. The value of this header can cause the browser to
1210 open a download menu instead of displaying the document by
1211 itself, even if the document's format is supported by the
1213 <p>The declared content type can also affect which rendering
1214 mode the browser chooses. If XHTML is delivered as <span class=
1215 "QUOTE">"text/html"</span>, many browsers treat it as yet
1216 another broken HTML document. If it is send as <span class=
1217 "QUOTE">"application/xml"</span>, browsers with XHTML support
1218 will only display it, if the syntax is correct.</p>
1219 <p>If you see a web site that proudly uses XHTML buttons, but
1220 sets <span class="QUOTE">"Content-Type: text/html"</span>, you
1221 can use <span class="APPLICATION">Privoxy</span> to overwrite
1222 it with <span class="QUOTE">"application/xml"</span> and
1223 validate the web master's claim inside your XHTML-supporting
1224 browser. If the syntax is incorrect, the browser will complain
1226 <p>You can also go the opposite direction: if your browser
1227 prints error messages instead of rendering a document falsely
1228 declared as XHTML, you can overwrite the content type with
1229 <span class="QUOTE">"text/html"</span> and have it rendered as
1230 broken HTML document.</p>
1231 <p>By default <tt class="LITERAL">content-type-overwrite</tt>
1232 only replaces <span class="QUOTE">"Content-Type:"</span>
1233 headers that look like some kind of text. If you want to
1234 overwrite it unconditionally, you have to combine it with
1235 <tt class="LITERAL"><a href=
1236 "actions-file.html#FORCE-TEXT-MODE">force-text-mode</a></tt>.
1237 This limitation exists for a reason, think twice before
1238 circumventing it.</p>
1239 <p>Most of the time it's easier to replace this action with a
1240 custom <tt class="LITERAL"><a href=
1241 "actions-file.html#SERVER-HEADER-FILTER">server-header
1242 filter</a></tt>. It allows you to activate it for every
1243 document of a certain site and it will still only replace the
1244 content types you aimed at.</p>
1245 <p>Of course you can apply <tt class=
1246 "LITERAL">content-type-overwrite</tt> to a whole site and then
1247 make URL based exceptions, but it's a lot more work to get the
1250 <dt>Example usage (sections):</dt>
1252 <table border="0" bgcolor="#E0E0E0" width="90%">
1255 <pre class="SCREEN">
1256 # Check if www.example.net/ really uses valid XHTML
1257 { +content-type-overwrite{application/xml} }
1260 # but leave the content type unmodified if the URL looks like a style sheet
1261 {-content-type-overwrite}
1262 www.example.net/.*\.css$
1263 www.example.net/.*style</pre>
1272 <h4 class="SECT3"><a name="CRUNCH-CLIENT-HEADER" id=
1273 "CRUNCH-CLIENT-HEADER">8.5.7. crunch-client-header</a></h4>
1274 <div class="VARIABLELIST">
1276 <dt>Typical use:</dt>
1278 <p>Remove a client header <span class=
1279 "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1283 <p>Deletes every header sent by the client that contains the
1284 string the user supplied as parameter.</p>
1288 <p>Parameterized.</p>
1296 <p>This action allows you to block client headers for which no
1297 dedicated <span class="APPLICATION">Privoxy</span> action
1298 exists. <span class="APPLICATION">Privoxy</span> will remove
1299 every client header that contains the string you supplied as
1301 <p>Regular expressions are <span class="emphasis"><i class=
1302 "EMPHASIS">not supported</i></span> and you can't use this
1303 action to block different headers in the same request, unless
1304 they contain the same string.</p>
1305 <p><tt class="LITERAL">crunch-client-header</tt> is only meant
1306 for quick tests. If you have to block several different
1307 headers, or only want to modify parts of them, you should use a
1308 <tt class="LITERAL"><a href=
1309 "actions-file.html#CLIENT-HEADER-FILTER">client-header
1310 filter</a></tt>.</p>
1311 <div class="WARNING">
1312 <table class="WARNING" border="1" width="90%">
1314 <td align="center"><b>Warning</b></td>
1318 <p>Don't block any header without understanding the
1325 <dt>Example usage (section):</dt>
1327 <table border="0" bgcolor="#E0E0E0" width="90%">
1330 <pre class="SCREEN">
1331 # Block the non-existent "Privacy-Violation:" client header
1332 { +crunch-client-header{Privacy-Violation:} }
1343 <h4 class="SECT3"><a name="CRUNCH-IF-NONE-MATCH" id=
1344 "CRUNCH-IF-NONE-MATCH">8.5.8. crunch-if-none-match</a></h4>
1345 <div class="VARIABLELIST">
1347 <dt>Typical use:</dt>
1349 <p>Prevent yet another way to track the user's steps between
1354 <p>Deletes the <span class="QUOTE">"If-None-Match:"</span> HTTP
1367 <p>Removing the <span class="QUOTE">"If-None-Match:"</span>
1368 HTTP client header is useful for filter testing, where you want
1369 to force a real reload instead of getting status code
1370 <span class="QUOTE">"304"</span> which would cause the browser
1371 to use a cached copy of the page.</p>
1372 <p>It is also useful to make sure the header isn't used as a
1373 cookie replacement (unlikely but possible).</p>
1374 <p>Blocking the <span class="QUOTE">"If-None-Match:"</span>
1375 header shouldn't cause any caching problems, as long as the
1376 <span class="QUOTE">"If-Modified-Since:"</span> header isn't
1377 blocked or missing as well.</p>
1378 <p>It is recommended to use this action together with
1379 <tt class="LITERAL"><a href=
1380 "actions-file.html#HIDE-IF-MODIFIED-SINCE">hide-if-modified-since</a></tt>
1381 and <tt class="LITERAL"><a href=
1382 "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>.</p>
1384 <dt>Example usage (section):</dt>
1386 <table border="0" bgcolor="#E0E0E0" width="90%">
1389 <pre class="SCREEN">
1390 # Let the browser revalidate cached documents but don't
1391 # allow the server to use the revalidation headers for user tracking.
1392 {+hide-if-modified-since{-60} \
1393 +overwrite-last-modified{randomize} \
1394 +crunch-if-none-match}
1404 <h4 class="SECT3"><a name="CRUNCH-INCOMING-COOKIES" id=
1405 "CRUNCH-INCOMING-COOKIES">8.5.9. crunch-incoming-cookies</a></h4>
1406 <div class="VARIABLELIST">
1408 <dt>Typical use:</dt>
1410 <p>Prevent the web server from setting HTTP cookies on your
1415 <p>Deletes any <span class="QUOTE">"Set-Cookie:"</span> HTTP
1416 headers from server replies.</p>
1428 <p>This action is only concerned with <span class=
1429 "emphasis"><i class="EMPHASIS">incoming</i></span> HTTP
1430 cookies. For <span class="emphasis"><i class=
1431 "EMPHASIS">outgoing</i></span> HTTP cookies, use <tt class=
1433 "actions-file.html#CRUNCH-OUTGOING-COOKIES">crunch-outgoing-cookies</a></tt>.
1434 Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1435 to disable HTTP cookies completely.</p>
1436 <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1437 at all</i></span> to use this action in conjunction with the
1438 <tt class="LITERAL"><a href=
1439 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1440 action, since it would prevent the session cookies from being
1441 set. See also <tt class="LITERAL"><a href=
1442 "actions-file.html#FILTER-CONTENT-COOKIES">filter-content-cookies</a></tt>.</p>
1444 <dt>Example usage:</dt>
1446 <table border="0" bgcolor="#E0E0E0" width="90%">
1449 <pre class="SCREEN">+crunch-incoming-cookies</pre>
1458 <h4 class="SECT3"><a name="CRUNCH-SERVER-HEADER" id=
1459 "CRUNCH-SERVER-HEADER">8.5.10. crunch-server-header</a></h4>
1460 <div class="VARIABLELIST">
1462 <dt>Typical use:</dt>
1464 <p>Remove a server header <span class=
1465 "APPLICATION">Privoxy</span> has no dedicated action for.</p>
1469 <p>Deletes every header sent by the server that contains the
1470 string the user supplied as parameter.</p>
1474 <p>Parameterized.</p>
1482 <p>This action allows you to block server headers for which no
1483 dedicated <span class="APPLICATION">Privoxy</span> action
1484 exists. <span class="APPLICATION">Privoxy</span> will remove
1485 every server header that contains the string you supplied as
1487 <p>Regular expressions are <span class="emphasis"><i class=
1488 "EMPHASIS">not supported</i></span> and you can't use this
1489 action to block different headers in the same request, unless
1490 they contain the same string.</p>
1491 <p><tt class="LITERAL">crunch-server-header</tt> is only meant
1492 for quick tests. If you have to block several different
1493 headers, or only want to modify parts of them, you should use a
1494 custom <tt class="LITERAL"><a href=
1495 "actions-file.html#SERVER-HEADER-FILTER">server-header
1496 filter</a></tt>.</p>
1497 <div class="WARNING">
1498 <table class="WARNING" border="1" width="90%">
1500 <td align="center"><b>Warning</b></td>
1504 <p>Don't block any header without understanding the
1511 <dt>Example usage (section):</dt>
1513 <table border="0" bgcolor="#E0E0E0" width="90%">
1516 <pre class="SCREEN">
1517 # Crunch server headers that try to prevent caching
1518 { +crunch-server-header{no-cache} }
1528 <h4 class="SECT3"><a name="CRUNCH-OUTGOING-COOKIES" id=
1529 "CRUNCH-OUTGOING-COOKIES">8.5.11. crunch-outgoing-cookies</a></h4>
1530 <div class="VARIABLELIST">
1532 <dt>Typical use:</dt>
1534 <p>Prevent the web server from reading any HTTP cookies from
1539 <p>Deletes any <span class="QUOTE">"Cookie:"</span> HTTP
1540 headers from client requests.</p>
1552 <p>This action is only concerned with <span class=
1553 "emphasis"><i class="EMPHASIS">outgoing</i></span> HTTP
1554 cookies. For <span class="emphasis"><i class=
1555 "EMPHASIS">incoming</i></span> HTTP cookies, use <tt class=
1557 "actions-file.html#CRUNCH-INCOMING-COOKIES">crunch-incoming-cookies</a></tt>.
1558 Use <span class="emphasis"><i class="EMPHASIS">both</i></span>
1559 to disable HTTP cookies completely.</p>
1560 <p>It makes <span class="emphasis"><i class="EMPHASIS">no sense
1561 at all</i></span> to use this action in conjunction with the
1562 <tt class="LITERAL"><a href=
1563 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>
1564 action, since it would prevent the session cookies from being
1567 <dt>Example usage:</dt>
1569 <table border="0" bgcolor="#E0E0E0" width="90%">
1572 <pre class="SCREEN">+crunch-outgoing-cookies</pre>
1581 <h4 class="SECT3"><a name="DEANIMATE-GIFS" id=
1582 "DEANIMATE-GIFS">8.5.12. deanimate-gifs</a></h4>
1583 <div class="VARIABLELIST">
1585 <dt>Typical use:</dt>
1587 <p>Stop those annoying, distracting animated GIF images.</p>
1591 <p>De-animate GIF animations, i.e. reduce them to their first
1596 <p>Parameterized.</p>
1600 <p><span class="QUOTE">"last"</span> or <span class=
1601 "QUOTE">"first"</span></p>
1605 <p>This will also shrink the images considerably (in bytes, not
1606 pixels!). If the option <span class="QUOTE">"first"</span> is
1607 given, the first frame of the animation is used as the
1608 replacement. If <span class="QUOTE">"last"</span> is given, the
1609 last frame of the animation is used instead, which probably
1610 makes more sense for most banner animations, but also has the
1611 risk of not showing the entire last frame (if it is only a
1612 delta to an earlier frame).</p>
1613 <p>You can safely use this action with patterns that will also
1614 match non-GIF objects, because no attempt will be made at
1615 anything that doesn't look like a GIF.</p>
1617 <dt>Example usage:</dt>
1619 <table border="0" bgcolor="#E0E0E0" width="90%">
1622 <pre class="SCREEN">+deanimate-gifs{last}</pre>
1631 <h4 class="SECT3"><a name="DOWNGRADE-HTTP-VERSION" id=
1632 "DOWNGRADE-HTTP-VERSION">8.5.13. downgrade-http-version</a></h4>
1633 <div class="VARIABLELIST">
1635 <dt>Typical use:</dt>
1637 <p>Work around (very rare) problems with HTTP/1.1</p>
1641 <p>Downgrades HTTP/1.1 client requests and server replies to
1654 <p>This is a left-over from the time when <span class=
1655 "APPLICATION">Privoxy</span> didn't support important HTTP/1.1
1656 features well. It is left here for the unlikely case that you
1657 experience HTTP/1.1-related problems with some server out
1659 <p>Note that enabling this action is only a workaround. It
1660 should not be enabled for sites that work without it. While it
1661 shouldn't break any pages, it has an (usually negative)
1662 performance impact.</p>
1663 <p>If you come across a site where enabling this action helps,
1664 please report it, so the cause of the problem can be analyzed.
1665 If the problem turns out to be caused by a bug in <span class=
1666 "APPLICATION">Privoxy</span> it should be fixed so the
1667 following release works without the work around.</p>
1669 <dt>Example usage (section):</dt>
1671 <table border="0" bgcolor="#E0E0E0" width="90%">
1674 <pre class="SCREEN">{+downgrade-http-version}
1675 problem-host.example.com</pre>
1684 <h4 class="SECT3"><a name="EXTERNAL-FILTER" id=
1685 "EXTERNAL-FILTER">8.5.14. external-filter</a></h4>
1686 <div class="VARIABLELIST">
1688 <dt>Typical use:</dt>
1690 <p>Modify content using a programming language of your
1695 <p>All instances of text-based type, most notably HTML and
1696 JavaScript, to which this action applies, can be filtered
1697 on-the-fly through the specified external filter. By default
1698 plain text documents are exempted from filtering, because web
1699 servers often use the <tt class="LITERAL">text/plain</tt> MIME
1700 type for all files whose type they don't know.)</p>
1708 <p>The name of an external content filter, as defined in the
1709 <a href="filter-file.html">filter file</a>. External filters
1710 can be defined in one or more files as defined by the
1711 <tt class="LITERAL"><a href=
1712 "config.html#FILTERFILE">filterfile</a></tt> option in the
1713 <a href="config.html">config file</a>.</p>
1714 <p>When used in its negative form, and without parameters,
1715 <span class="emphasis"><i class="EMPHASIS">all</i></span>
1716 filtering with external filters is completely disabled.</p>
1720 <p>External filters are scripts or programs that can modify the
1721 content in case common <tt class="LITERAL"><a href=
1722 "actions-file.html#FILTER">filters</a></tt> aren't powerful
1723 enough. With the exception that this action doesn't use
1724 pcrs-based filters, the notes in the <tt class=
1725 "LITERAL"><a href="actions-file.html#FILTER">filter</a></tt>
1727 <div class="WARNING">
1728 <table class="WARNING" border="1" width="90%">
1730 <td align="center"><b>Warning</b></td>
1734 <p>Currently external filters are executed with
1735 <span class="APPLICATION">Privoxy</span>'s privileges.
1736 Only use external filters you understand and trust.</p>
1741 <p>This feature is experimental, the <tt class=
1743 "filter-file.html#EXTERNAL-FILTER-SYNTAX">syntax</a></tt> may
1744 change in the future.</p>
1746 <dt>Example usage:</dt>
1748 <table border="0" bgcolor="#E0E0E0" width="90%">
1751 <pre class="SCREEN">+external-filter{fancy-filter}</pre>
1760 <h4 class="SECT3"><a name="FAST-REDIRECTS" id=
1761 "FAST-REDIRECTS">8.5.15. fast-redirects</a></h4>
1762 <div class="VARIABLELIST">
1764 <dt>Typical use:</dt>
1766 <p>Fool some click-tracking scripts and speed up indirect
1771 <p>Detects redirection URLs and redirects the browser without
1772 contacting the redirection server first.</p>
1776 <p>Parameterized.</p>
1782 <p><span class="QUOTE">"simple-check"</span> to just search
1783 for the string <span class="QUOTE">"http://"</span> to
1784 detect redirection URLs.</p>
1787 <p><span class="QUOTE">"check-decoded-url"</span> to decode
1788 URLs (if necessary) before searching for redirection
1795 <p>Many sites, like yahoo.com, don't just link to other sites.
1796 Instead, they will link to some script on their own servers,
1797 giving the destination as a parameter, which will then redirect
1798 you to the final target. URLs resulting from this scheme
1799 typically look like: <span class=
1800 "QUOTE">"http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/"</span>.</p>
1801 <p>Sometimes, there are even multiple consecutive redirects
1802 encoded in the URL. These redirections via scripts make your
1803 web browsing more traceable, since the server from which you
1804 follow such a link can see where you go to. Apart from that,
1805 valuable bandwidth and time is wasted, while your browser asks
1806 the server for one redirect after the other. Plus, it feeds the
1808 <p>This feature is currently not very smart and is scheduled
1809 for improvement. If it is enabled by default, you will have to
1810 create some exceptions to this action. It can lead to failures
1811 in several ways:</p>
1812 <p>Not every URLs with other URLs as parameters is evil. Some
1813 sites offer a real service that requires this information to
1814 work. For example a validation service needs to know, which
1815 document to validate. <tt class="LITERAL">fast-redirects</tt>
1816 assumes that every URL parameter that looks like another URL is
1817 a redirection target, and will always redirect to the last one.
1818 Most of the time the assumption is correct, but if it isn't,
1819 the user gets redirected anyway.</p>
1820 <p>Another failure occurs if the URL contains other parameters
1821 after the URL parameter. The URL: <span class=
1822 "QUOTE">"http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar"</span>.
1823 contains the redirection URL <span class=
1824 "QUOTE">"http://www.example.net/"</span>, followed by another
1825 parameter. <tt class="LITERAL">fast-redirects</tt> doesn't know
1826 that and will cause a redirect to <span class=
1827 "QUOTE">"http://www.example.net/&foo=bar"</span>. Depending
1828 on the target server configuration, the parameter will be
1829 silently ignored or lead to a <span class="QUOTE">"page not
1830 found"</span> error. You can prevent this problem by first
1831 using the <tt class="LITERAL"><a href=
1832 "actions-file.html#REDIRECT">redirect</a></tt> action to remove
1833 the last part of the URL, but it requires a little effort.</p>
1834 <p>To detect a redirection URL, <tt class=
1835 "LITERAL">fast-redirects</tt> only looks for the string
1836 <span class="QUOTE">"http://"</span>, either in plain text
1837 (invalid but often used) or encoded as <span class=
1838 "QUOTE">"http%3a//"</span>. Some sites use their own URL
1839 encoding scheme, encrypt the address of the target server or
1840 replace it with a database id. In theses cases <tt class=
1841 "LITERAL">fast-redirects</tt> is fooled and the request reaches
1842 the redirection server where it probably gets logged.</p>
1844 <dt>Example usage:</dt>
1846 <table border="0" bgcolor="#E0E0E0" width="90%">
1849 <pre class="SCREEN"> { +fast-redirects{simple-check} }
1852 { +fast-redirects{check-decoded-url} }
1853 another.example.com/testing</pre>
1862 <h4 class="SECT3"><a name="FILTER" id="FILTER">8.5.16.
1864 <div class="VARIABLELIST">
1866 <dt>Typical use:</dt>
1868 <p>Get rid of HTML and JavaScript annoyances, banner
1869 advertisements (by size), do fun text replacements, add
1870 personalized effects, etc.</p>
1874 <p>All instances of text-based type, most notably HTML and
1875 JavaScript, to which this action applies, can be filtered
1876 on-the-fly through the specified regular expression based
1877 substitutions. (Note: as of version 3.0.3 plain text documents
1878 are exempted from filtering, because web servers often use the
1879 <tt class="LITERAL">text/plain</tt> MIME type for all files
1880 whose type they don't know.)</p>
1888 <p>The name of a content filter, as defined in the <a href=
1889 "filter-file.html">filter file</a>. Filters can be defined in
1890 one or more files as defined by the <tt class=
1891 "LITERAL"><a href="config.html#FILTERFILE">filterfile</a></tt>
1892 option in the <a href="config.html">config file</a>. <tt class=
1893 "FILENAME">default.filter</tt> is the collection of filters
1894 supplied by the developers. Locally defined filters should go
1895 in their own file, such as <tt class=
1896 "FILENAME">user.filter</tt>.</p>
1897 <p>When used in its negative form, and without parameters,
1898 <span class="emphasis"><i class="EMPHASIS">all</i></span>
1899 filtering is completely disabled.</p>
1903 <p>For your convenience, there are a number of pre-defined
1904 filters available in the distribution filter file that you can
1905 use. See the examples below for a list.</p>
1906 <p>Filtering requires buffering the page content, which may
1907 appear to slow down page rendering since nothing is displayed
1908 until all content has passed the filters. (The total time until
1909 the page is completely rendered doesn't change much, but it may
1910 be perceived as slower since the page is not incrementally
1911 displayed.) This effect will be more noticeable on slower
1913 <p><span class="QUOTE">"Rolling your own"</span> filters
1914 requires a knowledge of <a href=
1915 "http://en.wikipedia.org/wiki/Regular_expressions" target=
1916 "_top"><span class="QUOTE">"Regular Expressions"</span></a> and
1917 <a href="http://en.wikipedia.org/wiki/Html" target=
1918 "_top"><span class="QUOTE">"HTML"</span></a>. This is very
1919 powerful feature, and potentially very intrusive. Filters
1920 should be used with caution, and where an equivalent
1921 <span class="QUOTE">"action"</span> is not available.</p>
1922 <p>The amount of data that can be filtered is limited to the
1923 <tt class="LITERAL"><a href=
1924 "config.html#BUFFER-LIMIT">buffer-limit</a></tt> option in the
1925 main <a href="config.html">config file</a>. The default is 4096
1926 KB (4 Megs). Once this limit is exceeded, the buffered data,
1927 and all pending data, is passed through unfiltered.</p>
1928 <p>Inappropriate MIME types, such as zipped files, are not
1929 filtered at all. (Again, only text-based types except plain
1930 text). Encrypted SSL data (from HTTPS servers) cannot be
1931 filtered either, since this would violate the integrity of the
1932 secure transaction. In some situations it might be necessary to
1933 protect certain text, like source code, from filtering by
1934 defining appropriate <tt class="LITERAL">-filter</tt>
1936 <p>Compressed content can't be filtered either, but if
1937 <span class="APPLICATION">Privoxy</span> is compiled with zlib
1938 support and a supported compression algorithm is used (gzip or
1939 deflate), <span class="APPLICATION">Privoxy</span> can first
1940 decompress the content and then filter it.</p>
1941 <p>If you use a <span class="APPLICATION">Privoxy</span>
1942 version without zlib support, but want filtering to work on as
1943 much documents as possible, even those that would normally be
1944 sent compressed, you must use the <tt class="LITERAL"><a href=
1945 "actions-file.html#PREVENT-COMPRESSION">prevent-compression</a></tt>
1946 action in conjunction with <tt class="LITERAL">filter</tt>.</p>
1947 <p>Content filtering can achieve some of the same effects as
1948 the <tt class="LITERAL"><a href=
1949 "actions-file.html#BLOCK">block</a></tt> action, i.e. it can be
1950 used to block ads and banners. But the mechanism works quite
1951 differently. One effective use, is to block ad banners based on
1952 their size (see below), since many of these seem to be somewhat
1954 <p><a href="contact.html">Feedback</a> with suggestions for new
1955 or improved filters is particularly welcome!</p>
1956 <p>The below list has only the names and a one-line description
1957 of each predefined filter. There are <a href=
1958 "filter-file.html#PREDEFINED-FILTERS">more verbose
1959 explanations</a> of what these filters do in the <a href=
1960 "filter-file.html">filter file chapter</a>.</p>
1962 <dt>Example usage (with filters from the distribution <tt class=
1963 "FILENAME">default.filter</tt> file). See <a href=
1964 "filter-file.html#PREDEFINED-FILTERS">the Predefined Filters
1965 section</a> for more explanation on each:</dt>
1967 <p><a name="FILTER-JS-ANNOYANCES" id=
1968 "FILTER-JS-ANNOYANCES"></a></p>
1969 <table border="0" bgcolor="#E0E0E0" width="90%">
1972 <pre class="SCREEN">
1973 +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse.</pre>
1977 <p><a name="FILTER-JS-EVENTS" id="FILTER-JS-EVENTS"></a></p>
1978 <table border="0" bgcolor="#E0E0E0" width="90%">
1981 <pre class="SCREEN">
1982 +filter{js-events} # Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites).</pre>
1986 <p><a name="FILTER-HTML-ANNOYANCES" id=
1987 "FILTER-HTML-ANNOYANCES"></a></p>
1988 <table border="0" bgcolor="#E0E0E0" width="90%">
1991 <pre class="SCREEN">
1992 +filter{html-annoyances} # Get rid of particularly annoying HTML abuse.</pre>
1996 <p><a name="FILTER-CONTENT-COOKIES" id=
1997 "FILTER-CONTENT-COOKIES"></a></p>
1998 <table border="0" bgcolor="#E0E0E0" width="90%">
2001 <pre class="SCREEN">
2002 +filter{content-cookies} # Kill cookies that come in the HTML or JS content.</pre>
2006 <p><a name="FILTER-REFRESH-TAGS" id=
2007 "FILTER-REFRESH-TAGS"></a></p>
2008 <table border="0" bgcolor="#E0E0E0" width="90%">
2011 <pre class="SCREEN">
2012 +filter{refresh-tags} # Kill automatic refresh tags if refresh time is larger than 9 seconds.</pre>
2016 <p><a name="FILTER-UNSOLICITED-POPUPS" id=
2017 "FILTER-UNSOLICITED-POPUPS"></a></p>
2018 <table border="0" bgcolor="#E0E0E0" width="90%">
2021 <pre class="SCREEN">
2022 +filter{unsolicited-popups} # Disable only unsolicited pop-up windows.</pre>
2026 <p><a name="FILTER-ALL-POPUPS" id="FILTER-ALL-POPUPS"></a></p>
2027 <table border="0" bgcolor="#E0E0E0" width="90%">
2030 <pre class="SCREEN">
2031 +filter{all-popups} # Kill all popups in JavaScript and HTML.</pre>
2035 <p><a name="FILTER-IMG-REORDER" id=
2036 "FILTER-IMG-REORDER"></a></p>
2037 <table border="0" bgcolor="#E0E0E0" width="90%">
2040 <pre class="SCREEN">
2041 +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective.</pre>
2045 <p><a name="FILTER-BANNERS-BY-SIZE" id=
2046 "FILTER-BANNERS-BY-SIZE"></a></p>
2047 <table border="0" bgcolor="#E0E0E0" width="90%">
2050 <pre class="SCREEN">
2051 +filter{banners-by-size} # Kill banners by size.</pre>
2055 <p><a name="FILTER-BANNERS-BY-LINK" id=
2056 "FILTER-BANNERS-BY-LINK"></a></p>
2057 <table border="0" bgcolor="#E0E0E0" width="90%">
2060 <pre class="SCREEN">
2061 +filter{banners-by-link} # Kill banners by their links to known clicktrackers.</pre>
2065 <p><a name="FILTER-WEBBUGS" id="FILTER-WEBBUGS"></a></p>
2066 <table border="0" bgcolor="#E0E0E0" width="90%">
2069 <pre class="SCREEN">
2070 +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking).</pre>
2074 <p><a name="FILTER-TINY-TEXTFORMS" id=
2075 "FILTER-TINY-TEXTFORMS"></a></p>
2076 <table border="0" bgcolor="#E0E0E0" width="90%">
2079 <pre class="SCREEN">
2080 +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap.</pre>
2084 <p><a name="FILTER-JUMPING-WINDOWS" id=
2085 "FILTER-JUMPING-WINDOWS"></a></p>
2086 <table border="0" bgcolor="#E0E0E0" width="90%">
2089 <pre class="SCREEN">
2090 +filter{jumping-windows} # Prevent windows from resizing and moving themselves.</pre>
2094 <p><a name="FILTER-FRAMESET-BORDERS" id=
2095 "FILTER-FRAMESET-BORDERS"></a></p>
2096 <table border="0" bgcolor="#E0E0E0" width="90%">
2099 <pre class="SCREEN">
2100 +filter{frameset-borders} # Give frames a border and make them resizable.</pre>
2104 <p><a name="FILTER-IFRAMES" id="FILTER-IFRAMES"></a></p>
2105 <table border="0" bgcolor="#E0E0E0" width="90%">
2108 <pre class="SCREEN">
2109 +filter{iframes} # Removes all detected iframes. Should only be enabled for individual sites.</pre>
2113 <p><a name="FILTER-DEMORONIZER" id=
2114 "FILTER-DEMORONIZER"></a></p>
2115 <table border="0" bgcolor="#E0E0E0" width="90%">
2118 <pre class="SCREEN">
2119 +filter{demoronizer} # Fix MS's non-standard use of standard charsets.</pre>
2123 <p><a name="FILTER-SHOCKWAVE-FLASH" id=
2124 "FILTER-SHOCKWAVE-FLASH"></a></p>
2125 <table border="0" bgcolor="#E0E0E0" width="90%">
2128 <pre class="SCREEN">
2129 +filter{shockwave-flash} # Kill embedded Shockwave Flash objects.</pre>
2133 <p><a name="FILTER-QUICKTIME-KIOSKMODE" id=
2134 "FILTER-QUICKTIME-KIOSKMODE"></a></p>
2135 <table border="0" bgcolor="#E0E0E0" width="90%">
2138 <pre class="SCREEN">
2139 +filter{quicktime-kioskmode} # Make Quicktime movies saveable.</pre>
2143 <p><a name="FILTER-FUN" id="FILTER-FUN"></a></p>
2144 <table border="0" bgcolor="#E0E0E0" width="90%">
2147 <pre class="SCREEN">
2148 +filter{fun} # Text replacements for subversive browsing fun!</pre>
2152 <p><a name="FILTER-CRUDE-PARENTAL" id=
2153 "FILTER-CRUDE-PARENTAL"></a></p>
2154 <table border="0" bgcolor="#E0E0E0" width="90%">
2157 <pre class="SCREEN">
2158 +filter{crude-parental} # Crude parental filtering. Note that this filter doesn't work reliably.</pre>
2162 <p><a name="FILTER-IE-EXPLOITS" id=
2163 "FILTER-IE-EXPLOITS"></a></p>
2164 <table border="0" bgcolor="#E0E0E0" width="90%">
2167 <pre class="SCREEN">
2168 +filter{ie-exploits} # Disable some known Internet Explorer bug exploits.</pre>
2172 <p><a name="FILTER-SITE-SPECIFICS" id=
2173 "FILTER-SITE-SPECIFICS"></a></p>
2174 <table border="0" bgcolor="#E0E0E0" width="90%">
2177 <pre class="SCREEN">
2178 +filter{site-specifics} # Cure for site-specific problems. Don't apply generally!</pre>
2182 <p><a name="FILTER-NO-PING" id="FILTER-NO-PING"></a></p>
2183 <table border="0" bgcolor="#E0E0E0" width="90%">
2186 <pre class="SCREEN">
2187 +filter{no-ping} # Removes non-standard ping attributes in <a> and <area> tags.</pre>
2191 <p><a name="FILTER-GOOGLE" id="FILTER-GOOGLE"></a></p>
2192 <table border="0" bgcolor="#E0E0E0" width="90%">
2195 <pre class="SCREEN">
2196 +filter{google} # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.</pre>
2200 <p><a name="FILTER-YAHOO" id="FILTER-YAHOO"></a></p>
2201 <table border="0" bgcolor="#E0E0E0" width="90%">
2204 <pre class="SCREEN">
2205 +filter{yahoo} # CSS-based block for Yahoo text ads. Also removes a width limitation.</pre>
2209 <p><a name="FILTER-MSN" id="FILTER-MSN"></a></p>
2210 <table border="0" bgcolor="#E0E0E0" width="90%">
2213 <pre class="SCREEN">
2214 +filter{msn} # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.</pre>
2218 <p><a name="FILTER-BLOGSPOT" id="FILTER-BLOGSPOT"></a></p>
2219 <table border="0" bgcolor="#E0E0E0" width="90%">
2222 <pre class="SCREEN">
2223 +filter{blogspot} # Cleans up some Blogspot blogs. Read the fine print before using this.</pre>
2232 <h4 class="SECT3"><a name="FORCE-TEXT-MODE" id=
2233 "FORCE-TEXT-MODE">8.5.17. force-text-mode</a></h4>
2234 <div class="VARIABLELIST">
2236 <dt>Typical use:</dt>
2238 <p>Force <span class="APPLICATION">Privoxy</span> to treat a
2239 document as if it was in some kind of <span class=
2240 "emphasis"><i class="EMPHASIS">text</i></span> format.</p>
2244 <p>Declares a document as text, even if the <span class=
2245 "QUOTE">"Content-Type:"</span> isn't detected as such.</p>
2257 <p>As explained <tt class="LITERAL"><a href=
2258 "actions-file.html#FILTER">above</a></tt>, <span class=
2259 "APPLICATION">Privoxy</span> tries to only filter files that
2260 are in some kind of text format. The same restrictions apply to
2261 <tt class="LITERAL"><a href=
2262 "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite</a></tt>.
2263 <tt class="LITERAL">force-text-mode</tt> declares a document as
2264 text, without looking at the <span class=
2265 "QUOTE">"Content-Type:"</span> first.</p>
2266 <div class="WARNING">
2267 <table class="WARNING" border="1" width="90%">
2269 <td align="center"><b>Warning</b></td>
2273 <p>Think twice before activating this action. Filtering
2274 binary data with regular expressions can cause file
2281 <dt>Example usage:</dt>
2283 <table border="0" bgcolor="#E0E0E0" width="90%">
2286 <pre class="SCREEN">+force-text-mode
2296 <h4 class="SECT3"><a name="FORWARD-OVERRIDE" id=
2297 "FORWARD-OVERRIDE">8.5.18. forward-override</a></h4>
2298 <div class="VARIABLELIST">
2300 <dt>Typical use:</dt>
2302 <p>Change the forwarding settings based on User-Agent or
2307 <p>Overrules the forward directives in the configuration
2312 <p>Parameterized.</p>
2318 <p><span class="QUOTE">"forward ."</span> to use a direct
2319 connection without any additional proxies.</p>
2322 <p><span class="QUOTE">"forward 127.0.0.1:8123"</span> to
2323 use the HTTP proxy listening at 127.0.0.1 port 8123.</p>
2326 <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2327 ."</span> to use the socks4a proxy listening at 127.0.0.1
2328 port 9050. Replace <span class=
2329 "QUOTE">"forward-socks4a"</span> with <span class=
2330 "QUOTE">"forward-socks4"</span> to use a socks4 connection
2331 (with local DNS resolution) instead, use <span class=
2332 "QUOTE">"forward-socks5"</span> for socks5 connections
2333 (with remote DNS resolution).</p>
2336 <p><span class="QUOTE">"forward-socks4a 127.0.0.1:9050
2337 proxy.example.org:8000"</span> to use the socks4a proxy
2338 listening at 127.0.0.1 port 9050 to reach the HTTP proxy
2339 listening at proxy.example.org port 8000. Replace
2340 <span class="QUOTE">"forward-socks4a"</span> with
2341 <span class="QUOTE">"forward-socks4"</span> to use a socks4
2342 connection (with local DNS resolution) instead, use
2343 <span class="QUOTE">"forward-socks5"</span> for socks5
2344 connections (with remote DNS resolution).</p>
2347 <p><span class="QUOTE">"forward-webserver
2348 127.0.0.1:80"</span> to use the HTTP server listening at
2349 127.0.0.1 port 80 without adjusting the request
2351 <p>This makes it more convenient to use Privoxy to make
2352 existing websites available as onion services as well.</p>
2353 <p>Many websites serve content with hardcoded URLs and
2354 can't be easily adjusted to change the domain based on the
2355 one used by the client.</p>
2356 <p>Putting Privoxy between Tor and the webserver (or an
2357 stunnel that forwards to the webserver) allows to rewrite
2358 headers and content to make client and server happy at the
2360 <p>Using Privoxy for webservers that are only reachable
2361 through onion addresses and whose location is supposed to
2362 be secret is not recommended and should not be necessary
2369 <p>This action takes parameters similar to the <a href=
2370 "config.html#FORWARDING">forward</a> directives in the
2371 configuration file, but without the URL pattern. It can be used
2372 as replacement, but normally it's only used in cases where
2373 matching based on the request URL isn't sufficient.</p>
2374 <div class="WARNING">
2375 <table class="WARNING" border="1" width="90%">
2377 <td align="center"><b>Warning</b></td>
2381 <p>Please read the description for the <a href=
2382 "config.html#FORWARDING">forward</a> directives before
2383 using this action. Forwarding to the wrong people will
2384 reduce your privacy and increase the chances of
2385 man-in-the-middle attacks.</p>
2386 <p>If the ports are missing or invalid, default values
2387 will be used. This might change in the future and you
2388 shouldn't rely on it. Otherwise incorrect syntax causes
2389 Privoxy to exit. Due to design limitations, invalid
2390 parameter syntax isn't detected until the action is
2391 used the first time.</p>
2393 "http://config.privoxy.org/show-url-info" target=
2394 "_top">show-url-info CGI page</a> to verify that your
2395 forward settings do what you thought the do.</p>
2401 <dt>Example usage:</dt>
2403 <table border="0" bgcolor="#E0E0E0" width="90%">
2406 <pre class="SCREEN">
2407 # Use an ssh tunnel for requests previously tagged as
2408 # <span class="QUOTE">"User-Agent: fetch libfetch/2.0"</span> and make sure
2409 # resuming downloads continues to work.
2411 # This way you can continue to use Tor for your normal browsing,
2412 # without overloading the Tor network with your FreeBSD ports updates
2413 # or downloads of bigger files like ISOs.
2415 # Note that HTTP headers are easy to fake and therefore their
2416 # values are as (un)trustworthy as your clients and users.
2417 {+forward-override{forward-socks5 10.0.0.2:2222 .} \
2418 -hide-if-modified-since \
2419 -overwrite-last-modified \
2421 TAG:^User-Agent: fetch libfetch/2\.0$
2431 <h4 class="SECT3"><a name="HANDLE-AS-EMPTY-DOCUMENT" id=
2432 "HANDLE-AS-EMPTY-DOCUMENT">8.5.19. handle-as-empty-document</a></h4>
2433 <div class="VARIABLELIST">
2435 <dt>Typical use:</dt>
2437 <p>Mark URLs that should be replaced by empty documents
2438 <span class="emphasis"><i class="EMPHASIS">if they get
2439 blocked</i></span></p>
2443 <p>This action alone doesn't do anything noticeable. It just
2444 marks URLs. If the <tt class="LITERAL"><a href=
2445 "actions-file.html#BLOCK">block</a></tt> action <span class=
2446 "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2447 presence or absence of this mark decides whether an HTML
2448 <span class="QUOTE">"BLOCKED"</span> page, or an empty document
2449 will be sent to the client as a substitute for the blocked
2450 content. The <span class="emphasis"><i class=
2451 "EMPHASIS">empty</i></span> document isn't literally empty, but
2452 actually contains a single space.</p>
2464 <p>Some browsers complain about syntax errors if JavaScript
2465 documents are blocked with <span class=
2466 "APPLICATION">Privoxy's</span> default HTML page; this option
2467 can be used to silence them. And of course this action can also
2468 be used to eliminate the <span class=
2469 "APPLICATION">Privoxy</span> BLOCKED message in frames.</p>
2470 <p>The content type for the empty document can be specified
2471 with <tt class="LITERAL"><a href=
2472 "actions-file.html#CONTENT-TYPE-OVERWRITE">content-type-overwrite{}</a></tt>,
2473 but usually this isn't necessary.</p>
2475 <dt>Example usage:</dt>
2477 <table border="0" bgcolor="#E0E0E0" width="90%">
2480 <pre class="SCREEN">
2481 # Block all documents on example.org that end with ".js",
2482 # but send an empty document instead of the usual HTML message.
2483 {+block{Blocked JavaScript} +handle-as-empty-document}
2494 <h4 class="SECT3"><a name="HANDLE-AS-IMAGE" id=
2495 "HANDLE-AS-IMAGE">8.5.20. handle-as-image</a></h4>
2496 <div class="VARIABLELIST">
2498 <dt>Typical use:</dt>
2500 <p>Mark URLs as belonging to images (so they'll be replaced by
2501 images <span class="emphasis"><i class="EMPHASIS">if they do
2502 get blocked</i></span>, rather than HTML pages)</p>
2506 <p>This action alone doesn't do anything noticeable. It just
2507 marks URLs as images. If the <tt class="LITERAL"><a href=
2508 "actions-file.html#BLOCK">block</a></tt> action <span class=
2509 "emphasis"><i class="EMPHASIS">also applies</i></span>, the
2510 presence or absence of this mark decides whether an HTML
2511 <span class="QUOTE">"blocked"</span> page, or a replacement
2512 image (as determined by the <tt class="LITERAL"><a href=
2513 "actions-file.html#SET-IMAGE-BLOCKER">set-image-blocker</a></tt>
2514 action) will be sent to the client as a substitute for the
2515 blocked content.</p>
2527 <p>The below generic example section is actually part of
2528 <tt class="FILENAME">default.action</tt>. It marks all URLs
2529 with well-known image file name extensions as images and should
2531 <p>Users will probably only want to use the handle-as-image
2532 action in conjunction with <tt class="LITERAL"><a href=
2533 "actions-file.html#BLOCK">block</a></tt>, to block sources of
2534 banners, whose URLs don't reflect the file type, like in the
2535 second example section.</p>
2536 <p>Note that you cannot treat HTML pages as images in most
2537 cases. For instance, (in-line) ad frames require an HTML page
2538 to be sent, or they won't display properly. Forcing <tt class=
2539 "LITERAL">handle-as-image</tt> in this situation will not
2540 replace the ad frame with an image, but lead to error
2543 <dt>Example usage (sections):</dt>
2545 <table border="0" bgcolor="#E0E0E0" width="90%">
2548 <pre class="SCREEN"># Generic image extensions:
2551 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
2553 # These don't look like images, but they're banners and should be
2554 # blocked as images:
2556 {+block{Nasty banners.} +handle-as-image}
2557 nasty-banner-server.example.com/junk.cgi\?output=trash</pre>
2566 <h4 class="SECT3"><a name="HIDE-ACCEPT-LANGUAGE" id=
2567 "HIDE-ACCEPT-LANGUAGE">8.5.21. hide-accept-language</a></h4>
2568 <div class="VARIABLELIST">
2570 <dt>Typical use:</dt>
2572 <p>Pretend to use different language settings.</p>
2576 <p>Deletes or replaces the <span class=
2577 "QUOTE">"Accept-Language:"</span> HTTP header in client
2582 <p>Parameterized.</p>
2586 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2591 <p>Faking the browser's language settings can be useful to make
2592 a foreign User-Agent set with <tt class="LITERAL"><a href=
2593 "actions-file.html#HIDE-USER-AGENT">hide-user-agent</a></tt>
2594 more believable.</p>
2595 <p>However some sites with content in different languages check
2596 the <span class="QUOTE">"Accept-Language:"</span> to decide
2597 which one to take by default. Sometimes it isn't possible to
2598 later switch to another language without changing the
2599 <span class="QUOTE">"Accept-Language:"</span> header first.</p>
2600 <p>Therefore it's a good idea to either only change the
2601 <span class="QUOTE">"Accept-Language:"</span> header to
2602 languages you understand, or to languages that aren't wide
2604 <p>Before setting the <span class=
2605 "QUOTE">"Accept-Language:"</span> header to a rare language,
2606 you should consider that it helps to make your requests unique
2607 and thus easier to trace. If you don't plan to change this
2608 header frequently, you should stick to a common language.</p>
2610 <dt>Example usage (section):</dt>
2612 <table border="0" bgcolor="#E0E0E0" width="90%">
2615 <pre class="SCREEN">
2616 # Pretend to use Canadian language settings.
2617 {+hide-accept-language{en-ca} \
2618 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
2629 <h4 class="SECT3"><a name="HIDE-CONTENT-DISPOSITION" id=
2630 "HIDE-CONTENT-DISPOSITION">8.5.22. hide-content-disposition</a></h4>
2631 <div class="VARIABLELIST">
2633 <dt>Typical use:</dt>
2635 <p>Prevent download menus for content you prefer to view inside
2640 <p>Deletes or replaces the <span class=
2641 "QUOTE">"Content-Disposition:"</span> HTTP header set by some
2646 <p>Parameterized.</p>
2650 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2655 <p>Some servers set the <span class=
2656 "QUOTE">"Content-Disposition:"</span> HTTP header for documents
2657 they assume you want to save locally before viewing them. The
2658 <span class="QUOTE">"Content-Disposition:"</span> header
2659 contains the file name the browser is supposed to use by
2661 <p>In most browsers that understand this header, it makes it
2662 impossible to <span class="emphasis"><i class="EMPHASIS">just
2663 view</i></span> the document, without downloading it first,
2664 even if it's just a simple text file or an image.</p>
2665 <p>Removing the <span class=
2666 "QUOTE">"Content-Disposition:"</span> header helps to prevent
2667 this annoyance, but some browsers additionally check the
2668 <span class="QUOTE">"Content-Type:"</span> header, before they
2669 decide if they can display a document without saving it first.
2670 In these cases, you have to change this header as well, before
2671 the browser stops displaying download menus.</p>
2672 <p>It is also possible to change the server's file name
2673 suggestion to another one, but in most cases it isn't worth the
2674 time to set it up.</p>
2675 <p>This action will probably be removed in the future, use
2676 server-header filters instead.</p>
2678 <dt>Example usage:</dt>
2680 <table border="0" bgcolor="#E0E0E0" width="90%">
2683 <pre class="SCREEN">
2684 # Disarm the download link in Sourceforge's patch tracker
2686 +content-type-overwrite{text/plain}\
2687 +hide-content-disposition{block} }
2688 .sourceforge.net/tracker/download\.php</pre>
2697 <h4 class="SECT3"><a name="HIDE-IF-MODIFIED-SINCE" id=
2698 "HIDE-IF-MODIFIED-SINCE">8.5.23. hide-if-modified-since</a></h4>
2699 <div class="VARIABLELIST">
2701 <dt>Typical use:</dt>
2703 <p>Prevent yet another way to track the user's steps between
2708 <p>Deletes the <span class="QUOTE">"If-Modified-Since:"</span>
2709 HTTP client header or modifies its value.</p>
2713 <p>Parameterized.</p>
2717 <p>Keyword: <span class="QUOTE">"block"</span>, or a user
2718 defined value that specifies a range of hours.</p>
2722 <p>Removing this header is useful for filter testing, where you
2723 want to force a real reload instead of getting status code
2724 <span class="QUOTE">"304"</span>, which would cause the browser
2725 to use a cached copy of the page.</p>
2726 <p>Instead of removing the header, <tt class=
2727 "LITERAL">hide-if-modified-since</tt> can also add or subtract
2728 a random amount of time to/from the header's value. You specify
2729 a range of minutes where the random factor should be chosen
2730 from and <span class="APPLICATION">Privoxy</span> does the
2731 rest. A negative value means subtracting, a positive value
2733 <p>Randomizing the value of the <span class=
2734 "QUOTE">"If-Modified-Since:"</span> makes it less likely that
2735 the server can use the time as a cookie replacement, but you
2736 will run into caching problems if the random range is too
2738 <p>It is a good idea to only use a small negative value and let
2739 <tt class="LITERAL"><a href=
2740 "actions-file.html#OVERWRITE-LAST-MODIFIED">overwrite-last-modified</a></tt>
2741 handle the greater changes.</p>
2742 <p>It is also recommended to use this action together with
2743 <tt class="LITERAL"><a href=
2744 "actions-file.html#CRUNCH-IF-NONE-MATCH">crunch-if-none-match</a></tt>,
2745 otherwise it's more or less pointless.</p>
2747 <dt>Example usage (section):</dt>
2749 <table border="0" bgcolor="#E0E0E0" width="90%">
2752 <pre class="SCREEN">
2753 # Let the browser revalidate but make tracking based on the time less likely.
2754 {+hide-if-modified-since{-60} \
2755 +overwrite-last-modified{randomize} \
2756 +crunch-if-none-match}
2766 <h4 class="SECT3"><a name="HIDE-FROM-HEADER" id=
2767 "HIDE-FROM-HEADER">8.5.24. hide-from-header</a></h4>
2768 <div class="VARIABLELIST">
2770 <dt>Typical use:</dt>
2772 <p>Keep your (old and ill) browser from telling web servers
2773 your email address</p>
2777 <p>Deletes any existing <span class="QUOTE">"From:"</span> HTTP
2778 header, or replaces it with the specified string.</p>
2782 <p>Parameterized.</p>
2786 <p>Keyword: <span class="QUOTE">"block"</span>, or any user
2791 <p>The keyword <span class="QUOTE">"block"</span> will
2792 completely remove the header (not to be confused with the
2793 <tt class="LITERAL"><a href=
2794 "actions-file.html#BLOCK">block</a></tt> action).</p>
2795 <p>Alternately, you can specify any value you prefer to be sent
2796 to the web server. If you do, it is a matter of fairness not to
2797 use any address that is actually used by a real person.</p>
2798 <p>This action is rarely needed, as modern web browsers don't
2799 send <span class="QUOTE">"From:"</span> headers anymore.</p>
2801 <dt>Example usage:</dt>
2803 <table border="0" bgcolor="#E0E0E0" width="90%">
2806 <pre class="SCREEN">+hide-from-header{block}</pre>
2810 <table border="0" bgcolor="#E0E0E0" width="90%">
2813 <pre class="SCREEN">
2814 +hide-from-header{spam-me-senseless@sittingduck.example.com}</pre>
2823 <h4 class="SECT3"><a name="HIDE-REFERRER" id="HIDE-REFERRER">8.5.25.
2824 hide-referrer</a></h4><a name="HIDE-REFERER" id="HIDE-REFERER"></a>
2825 <div class="VARIABLELIST">
2827 <dt>Typical use:</dt>
2829 <p>Conceal which link you followed to get to a particular
2834 <p>Deletes the <span class="QUOTE">"Referer:"</span> (sic) HTTP
2835 header from the client request, or replaces it with a forged
2840 <p>Parameterized.</p>
2846 <p><span class="QUOTE">"conditional-block"</span> to delete
2847 the header completely if the host has changed.</p>
2850 <p><span class="QUOTE">"conditional-forge"</span> to forge
2851 the header if the host has changed.</p>
2854 <p><span class="QUOTE">"block"</span> to delete the header
2855 unconditionally.</p>
2858 <p><span class="QUOTE">"forge"</span> to pretend to be
2859 coming from the homepage of the server we are talking
2863 <p>Any other string to set a user defined referrer.</p>
2869 <p><tt class="LITERAL">conditional-block</tt> is the only
2870 parameter, that isn't easily detected in the server's log file.
2871 If it blocks the referrer, the request will look like the
2872 visitor used a bookmark or typed in the address directly.</p>
2873 <p>Leaving the referrer unmodified for requests on the same
2874 host allows the server owner to see the visitor's <span class=
2875 "QUOTE">"click path"</span>, but in most cases she could also
2876 get that information by comparing other parts of the log file:
2877 for example the User-Agent if it isn't a very common one, or
2878 the user's IP address if it doesn't change between different
2880 <p>Always blocking the referrer, or using a custom one, can
2881 lead to failures on servers that check the referrer before they
2882 answer any requests, in an attempt to prevent their content
2883 from being embedded or linked to elsewhere.</p>
2884 <p>Both <tt class="LITERAL">conditional-block</tt> and
2885 <tt class="LITERAL">forge</tt> will work with referrer checks,
2886 as long as content and valid referring page are on the same
2887 host. Most of the time that's the case.</p>
2888 <p><tt class="LITERAL">hide-referer</tt> is an alternate
2889 spelling of <tt class="LITERAL">hide-referrer</tt> and the two
2890 can be can be freely substituted with each other. (<span class=
2891 "QUOTE">"referrer"</span> is the correct English spelling,
2892 however the HTTP specification has a bug - it requires it to be
2893 spelled as <span class="QUOTE">"referer"</span>.)</p>
2895 <dt>Example usage:</dt>
2897 <table border="0" bgcolor="#E0E0E0" width="90%">
2900 <pre class="SCREEN">+hide-referrer{forge}</pre>
2904 <table border="0" bgcolor="#E0E0E0" width="90%">
2907 <pre class="SCREEN">
2908 +hide-referrer{http://www.yahoo.com/}</pre>
2917 <h4 class="SECT3"><a name="HIDE-USER-AGENT" id=
2918 "HIDE-USER-AGENT">8.5.26. hide-user-agent</a></h4>
2919 <div class="VARIABLELIST">
2921 <dt>Typical use:</dt>
2923 <p>Try to conceal your type of browser and client operating
2928 <p>Replaces the value of the <span class=
2929 "QUOTE">"User-Agent:"</span> HTTP header in client requests
2930 with the specified value.</p>
2934 <p>Parameterized.</p>
2938 <p>Any user-defined string.</p>
2942 <div class="WARNING">
2943 <table class="WARNING" border="1" width="90%">
2945 <td align="center"><b>Warning</b></td>
2949 <p>This can lead to problems on web sites that depend
2950 on looking at this header in order to customize their
2951 content for different browsers (which, by the way, is
2952 <span class="emphasis"><i class=
2953 "EMPHASIS">NOT</i></span> the right thing to do: good
2954 web sites work browser-independently).</p>
2959 <p>Using this action in multi-user setups or wherever different
2960 types of browsers will access the same <span class=
2961 "APPLICATION">Privoxy</span> is <span class=
2962 "emphasis"><i class="EMPHASIS">not recommended</i></span>. In
2963 single-user, single-browser setups, you might use it to delete
2964 your OS version information from the headers, because it is an
2965 invitation to exploit known bugs for your OS. It is also
2966 occasionally useful to forge this in order to access sites that
2967 won't let you in otherwise (though there may be a good reason
2969 <p>More information on known user-agent strings can be found at
2970 <a href="http://www.user-agents.org/" target=
2971 "_top">http://www.user-agents.org/</a> and <a href=
2972 "http://en.wikipedia.org/wiki/User_agent" target=
2973 "_top">http://en.wikipedia.org/wiki/User_agent</a>.</p>
2975 <dt>Example usage:</dt>
2977 <table border="0" bgcolor="#E0E0E0" width="90%">
2980 <pre class="SCREEN">
2981 +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}</pre>
2990 <h4 class="SECT3"><a name="LIMIT-CONNECT" id="LIMIT-CONNECT">8.5.27.
2991 limit-connect</a></h4>
2992 <div class="VARIABLELIST">
2994 <dt>Typical use:</dt>
2996 <p>Prevent abuse of <span class="APPLICATION">Privoxy</span> as
2997 a TCP proxy relay or disable SSL for untrusted sites</p>
3001 <p>Specifies to which ports HTTP CONNECT requests are
3006 <p>Parameterized.</p>
3010 <p>A comma-separated list of ports or port ranges (the latter
3011 using dashes, with the minimum defaulting to 0 and the maximum
3016 <p>By default, i.e. if no <tt class=
3017 "LITERAL">limit-connect</tt> action applies, <span class=
3018 "APPLICATION">Privoxy</span> allows HTTP CONNECT requests to
3019 all ports. Use <tt class="LITERAL">limit-connect</tt> if
3020 fine-grained control is desired for some or all
3022 <p>The CONNECT methods exists in HTTP to allow access to secure
3023 websites (<span class="QUOTE">"https://"</span> URLs) through
3024 proxies. It works very simply: the proxy connects to the server
3025 on the specified port, and then short-circuits its connections
3026 to the client and to the remote server. This means
3027 CONNECT-enabled proxies can be used as TCP relays very
3029 <p><span class="APPLICATION">Privoxy</span> relays HTTPS
3030 traffic without seeing the decoded content. Websites can
3031 leverage this limitation to circumvent <span class=
3032 "APPLICATION">Privoxy</span>'s filters. By specifying an
3033 invalid port range you can disable HTTPS entirely.</p>
3035 <dt>Example usages:</dt>
3037 <table border="0" bgcolor="#E0E0E0" width="90%">
3040 <pre class="SCREEN">
3041 +limit-connect{443} # Port 443 is OK.
3042 +limit-connect{80,443} # Ports 80 and 443 are OK.
3043 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
3044 +limit-connect{-} # All ports are OK
3045 +limit-connect{,} # No HTTPS/SSL traffic is allowed</pre>
3054 <h4 class="SECT3"><a name="LIMIT-COOKIE-LIFETIME" id=
3055 "LIMIT-COOKIE-LIFETIME">8.5.28. limit-cookie-lifetime</a></h4>
3056 <div class="VARIABLELIST">
3058 <dt>Typical use:</dt>
3060 <p>Limit the lifetime of HTTP cookies to a couple of minutes or
3065 <p>Overwrites the expires field in Set-Cookie server headers if
3066 it's above the specified limit.</p>
3070 <p>Parameterized.</p>
3074 <p>The lifetime limit in minutes, or 0.</p>
3078 <p>This action reduces the lifetime of HTTP cookies coming from
3079 the server to the specified number of minutes, starting from
3080 the time the cookie passes Privoxy.</p>
3081 <p>Cookies with a lifetime below the limit are not modified.
3082 The lifetime of session cookies is set to the specified
3084 <p>The effect of this action depends on the server.</p>
3085 <p>In case of servers which refresh their cookies with each
3086 response (or at least frequently), the lifetime limit set by
3087 this action is updated as well. Thus, a session associated with
3088 the cookie continues to work with this action enabled, as long
3089 as a new request is made before the last limit set is
3091 <p>However, some servers send their cookies once, with a
3092 lifetime of several years (the year 2037 is a popular choice),
3093 and do not refresh them until a certain event in the future,
3094 for example the user logging out. In this case this action may
3095 limit the absolute lifetime of the session, even if requests
3096 are made frequently.</p>
3097 <p>If the parameter is <span class="QUOTE">"0"</span>, this
3098 action behaves like <tt class="LITERAL"><a href=
3099 "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>.</p>
3101 <dt>Example usages:</dt>
3103 <table border="0" bgcolor="#E0E0E0" width="90%">
3106 <pre class="SCREEN">+limit-cookie-lifetime{60}
3116 <h4 class="SECT3"><a name="PREVENT-COMPRESSION" id=
3117 "PREVENT-COMPRESSION">8.5.29. prevent-compression</a></h4>
3118 <div class="VARIABLELIST">
3120 <dt>Typical use:</dt>
3122 <p>Ensure that servers send the content uncompressed, so it can
3123 be passed through <tt class="LITERAL"><a href=
3124 "actions-file.html#FILTER">filter</a></tt>s.</p>
3128 <p>Removes the Accept-Encoding header which can be used to ask
3129 for compressed transfer.</p>
3141 <p>More and more websites send their content compressed by
3142 default, which is generally a good idea and saves bandwidth.
3143 But the <tt class="LITERAL"><a href=
3144 "actions-file.html#FILTER">filter</a></tt> and <tt class=
3146 "actions-file.html#DEANIMATE-GIFS">deanimate-gifs</a></tt>
3147 actions need access to the uncompressed data.</p>
3148 <p>When compiled with zlib support (available since
3149 <span class="APPLICATION">Privoxy</span> 3.0.7), content that
3150 should be filtered is decompressed on-the-fly and you don't
3151 have to worry about this action. If you are using an older
3152 <span class="APPLICATION">Privoxy</span> version, or one that
3153 hasn't been compiled with zlib support, this action can be used
3154 to convince the server to send the content uncompressed.</p>
3155 <p>Most text-based instances compress very well, the size is
3156 seldom decreased by less than 50%, for markup-heavy instances
3157 like news feeds saving more than 90% of the original size isn't
3159 <p>Not using compression will therefore slow down the transfer,
3160 and you should only enable this action if you really need it.
3161 As of <span class="APPLICATION">Privoxy</span> 3.0.7 it's
3162 disabled in all predefined action settings.</p>
3163 <p>Note that some (rare) ill-configured sites don't handle
3164 requests for uncompressed documents correctly. Broken PHP
3165 applications tend to send an empty document body, some IIS
3166 versions only send the beginning of the content. If you enable
3167 <tt class="LITERAL">prevent-compression</tt> per default, you
3168 might want to add exceptions for those sites. See the example
3169 for how to do that.</p>
3171 <dt>Example usage (sections):</dt>
3173 <table border="0" bgcolor="#E0E0E0" width="90%">
3176 <pre class="SCREEN">
3177 # Selectively turn off compression, and enable a filter
3179 { +filter{tiny-textforms} +prevent-compression }
3180 # Match only these sites
3185 # Or instead, we could set a universal default:
3187 { +prevent-compression }
3190 # Then maybe make exceptions for broken sites:
3192 { -prevent-compression }
3202 <h4 class="SECT3"><a name="OVERWRITE-LAST-MODIFIED" id=
3203 "OVERWRITE-LAST-MODIFIED">8.5.30. overwrite-last-modified</a></h4>
3204 <div class="VARIABLELIST">
3206 <dt>Typical use:</dt>
3208 <p>Prevent yet another way to track the user's steps between
3213 <p>Deletes the <span class="QUOTE">"Last-Modified:"</span> HTTP
3214 server header or modifies its value.</p>