Changed version string only to 3.0.12
[privoxy.git] / default.filter
1 # ********************************************************************
2
3 #  File        :  $Source: /cvsroot/ijbswa/current/default.filter,v $
4
5 #  $Id: default.filter,v 1.70 2009/02/21 13:01:51 fabiankeil Exp $
6 #
7 #  Purpose     :  Rules to process the content of web pages
8
9 #  Copyright   :  Written by and Copyright (C) 2001-2009 the
10 #                 Privoxy team. http://www.privoxy.org/
11 #
12 # We value your feedback. However, to provide you with the best support,
13 # please note:
14 #  
15 #  * Use the support forum to get help:
16 #    http://sourceforge.net/tracker/?group_id=11118&atid=211118
17 #  * Submit bugs only thru our bug forum:
18 #    http://sourceforge.net/tracker/?group_id=11118&atid=111118 
19 #    Make sure that the bug has not already been submitted. Please try
20 #    to verify that it is a Privoxy bug, and not a browser or site
21 #    bug first. If you are using your own custom configuration, please
22 #    try the stock configs to see if the problem is a configuration
23 #    related bug. And if not using the latest development snapshot,
24 #    please try the latest one. Or even better, CVS sources.
25 #  * Submit feature requests only thru our feature request forum:
26 #    http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse
27 #      
28 # For any other issues, feel free to use the mailing lists:
29 # http://sourceforge.net/mail/?group_id=11118
30 #    
31 # Anyone interested in actively participating in development and related
32 # discussions can join the appropriate mailing list here:
33 # http://sourceforge.net/mail/?group_id=11118. Archives are available
34 # here too.
35
36 #################################################################################
37 #
38 # Syntax:
39 #
40 # Generally filters start with a line like "FILTER: name description".
41 # They are then referrable from the actionsfile with +filter{name}
42 #
43 # FILTER marks a filter as content filter, other filter
44 # types are CLIENT-HEADER-FILTER, CLIENT-HEADER-TAGGER,
45 # SERVER-HEADER-FILTER and SERVER-HEADER-TAGGER.
46 #
47 # Inside the filters, write one Perl-Style substitution (job) per line.
48 # Jobs that precede the first FILTER: line are ignored.
49 #
50 # For Details see the pcrs manpage contained in this distribution.
51 # (and the perlre, perlop and pcre manpages)
52 #
53 # Note that you are free to choose the delimiter as you see fit.
54 #
55 # Note2: In addition to the Perl options gimsx, the following nonstandard
56 # options are supported:
57
58 # 'U' turns the default to ungreedy matching.  Add ? to quantifiers to
59 #     switch back to greedy.
60 #
61 # 'T' (trivial) prevents parsing for backreferences in the substitute.
62 #     Use if you want to include text like '$&' in your substitute without
63 #     quoting.
64 #
65 # 'D' (Dynamic) allows the use of variables. Supported variables are:
66 #     $host, $origin (the IP address the request came from), $path and $url.
67 #
68 #     Note that '$' is a bad choice as delimiter for dynamic filters as you
69 #     might end up with unintended variables if you use a variable name
70 #     directly after the delimiter. Variables will be resolved without
71 #     escaping anything, therefore you also have to be careful not to chose
72 #     delimiters that appear in the replacement text. For example '<' should
73 #     be save, while '?' will sooner or later cause conflicts with $url.
74
75 #################################################################################
76
77
78 #################################################################################
79 #
80 # js-annoyances: Get rid of particularly annoying JavaScript abuse.
81 #
82 #################################################################################
83 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse.
84
85 # Note: Most of these jobs would be safer if restricted to a
86 # <script> context as in:
87 #
88 # s/(<script.*)nasty-item(?=.*<\/script>)/$1replacement/sigU
89 #
90 # but that would make them match only the first occurrence of
91 # nasty-item in each <script>. We need nestable jobs!
92
93 # Get rid of Javascript referrer tracking. 
94 # Test page: http://www.javascript-page.com/referrer.html
95 #
96 s|(?:\w+\.)+referrer|"Not Your Business!"|gisU
97
98 # The status bar is for displaying link targets, not pointless blahblah
99 #
100 s@([\W]\s*)((?:this|window)\.(?:default)?status)\s*=\s*((['"]).*?\4)@$1$2 =\
101  (typeof(this.href) != 'undefined')?($3 + ' URL: ' + this.href):($2)@ig
102
103 s/(?:(?:this|window)\.(?:default)?status)\s*=\s*\w*\s*;//ig
104
105 # Kill OnUnload popups. Yummy.
106 # Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
107 #
108 s/(<body\s+[^>]*)onunload/$1never/siU
109 s|(<script.*)window\.onunload(?=.*</script>)|$1never|sigU
110
111 # If we allow window.open, we want normal window features: 
112 # Test: http://www.htmlgoodies.com/beyond/notitle.html
113 #
114 s/(open\s*\([^\)]+resizable=)(["']?)(?:no|0)\2/$1$2yes$2/sigU
115 s/(open\s*\([^\)]+location=)(["']?)(?:no|0)\2/$1$2yes$2/sigU 
116 s/(open\s*\([^\)]+status=)(["']?)(?:no|0)\2/$1$2yes$2/sigU 
117 s/(open\s*\([^\)]+scroll(?:ing|bars)=)(["']?)(?:no|0)\2/$1$2auto$2/sigU 
118 s/(open\s*\([^\)]+menubar=)(["']?)(?:no|0)\2/$1$2yes$2/sigU 
119 s/(open\s*\([^\)]+toolbar=)(["']?)(?:no|0)\2/$1$2yes$2/sigU 
120 s/(open\s*\([^\)]+directories=)(["']?)(?:no|0)\2/$1$2yes$2/sigU 
121 s/(open\s*\([^\)]+fullscreen=)(["']?)(?:yes|1)\2/$1$2no$2/sigU
122 s/(open\s*\([^\)]+always(?:raised|lowered)=)(["']?)(?:yes|1)\2/$1$2no$2/sigU
123 s/(open\s*\([^\)]+z-?lock=)(["']?)(?:yes|1)\2/$1$2no$2/sigU
124 s/(open\s*\([^\)]+hotkeys=)(["']?)(?:yes|1)\2/$1$2no$2/sigU
125 s/(open\s*\([^\)]+titlebar=)(["']?)(?:no|0)\2/$1$2yes$2/sigU
126 s/(open\s*\([^\)]+always(?:raised|lowered)=)(["']?)(?:yes|1)\2/$1$2no$2/sigU
127
128
129 #################################################################################
130 #
131 # js-events: Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
132 #
133 #################################################################################
134 FILTER: js-events Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
135
136 s/(on|event\.)((mouse(over|out|down|up|move))|(un)?load|contextmenu|selectstart)/never/ig
137 # Not events, but abused on the same type of sites:
138 s/(alert|confirm)\s*\(/concat(/ig
139 s/settimeout\(/concat(/ig
140
141 #################################################################################
142 #
143 # html-annoyances: Get rid of particularly annoying HTML abuse.
144 #
145 #################################################################################
146 FILTER: html-annoyances Get rid of particularly annoying HTML abuse.
147
148 # New browser windows (if allowed -- see no-popups filter below) should be
149 # resizeable and have a location and status bar
150 #
151 s/(<a\s+href[^>]+resizable=)(['"]?)(?:no|0)\2/$1$2yes$2/igU 
152 s/(<a\s+href[^>]+location=)(['"]?)(?:no|0)\2/$1$2yes$2/igU 
153 s/(<a\s+href[^>]+status=)(['"]?)(?:no|0)\2/$1$2yes1$2/igU
154 s/(<a\s+href[^>]+scrolling=)(['"]?)(?:no|0)\2/$1$2auto$2/igU
155 s/(<a\s+href[^>]+menubar=)(['"]?)(?:no|0)\2/$1$2yes$2/igU
156
157 # The <BLINK> and <MARQUEE> tags were crimes!
158 #
159 s-</?(blink|marquee).*>--sigU
160
161
162 #################################################################################
163 #
164 # content-cookies: Kill cookies that come in the HTML or JS content.
165 #
166 #################################################################################
167 FILTER: content-cookies Kill cookies that come in the HTML or JS content.
168
169 # JS cookies, except those used by antiadbuster.com to detect us:
170 #
171 s|(\w+\.)+cookie(?=[ \t\r\n]*=)(?!='aab)|ZappedCookie|ig
172
173 # HTML cookies:
174 #
175 s|<meta\s+http-equiv=['"]?set-cookie.*>|<!-- ZappedCookie -->|igU
176
177
178 #################################################################################
179 #
180 # refresh-tags: Kill automatic refresh tags (for dial-on-demand setups).
181 #
182 #################################################################################
183 FILTER: refresh-tags Kill automatic refresh tags (for dial-on-demand setups).
184
185 # Note: Only deactivates refreshes with more than 9 seconds delay to
186 #       preserve monster-stupid but common redirections via meta tags.
187 #
188 s/<meta\s+http-equiv\s*=\s*(['"]?)refresh\1\s+content\s*=\s*(['"]?)\d{2,}\s*(;\s*url\s*=\s*([^>\2]*))?\2/<link rev="x-refresh" href="$4"/iU
189
190
191 #################################################################################
192 #
193 # unsolicited-popups: Disable unsolicited pop-up windows.
194 #
195 #################################################################################
196 FILTER: unsolicited-popups Disable only unsolicited pop-up windows.
197
198 s+([^'"]\s*<head.*>)(?=\s*[^'"])+$1<script>function PrivoxyWindowOpen(){return(null);}</script>+isU
199 s@([^\w\s.]\s*)((?:map)?(window|this|parent)\.?)?open\s*\(@$1PrivoxyWindowOpen(@ig
200 s+([^'"]\s*</html>)(?!\s*(\\n|'|"))+$1<script>function PrivoxyWindowOpen(a, b, c){return(window.open(a, b, c));}</script>+iU     
201
202
203 ##################################################################################
204 #
205 # all-popups: Kill all popups in JavaScript and HTML.
206 #
207 #################################################################################
208 FILTER: all-popups Kill all popups in JavaScript and HTML.
209
210 s@((\W\s*)(?:map)?(window|this|parent)\.?)open\s*\\?\(@$1concat(@ig  # JavaScript
211 #s/\starget\s*=\s*(['"]?)_?(blank|new)\1?/ notarget/ig        # HTML
212 s/\starget\s*=\s*(['"]?)_?(blank|new)\1?/ /ig        # (X)HTML
213
214 ##################################################################################
215 #
216 # img-reorder: Reorder attributes in <img> tags to make the banners-by-* filters more effective.
217 #
218 #################################################################################
219 FILTER: img-reorder Reorder attributes in <img> tags to make the banners-by-* filters more effective.
220
221 # In the first step src is moved to the start, then width is moved to the second
222 # place to guarantee an order of src, width, height. Also does some white-space
223 # normalization.
224 #
225 # This makes banners-by-size more effective and allows both banners-by-size
226 # and banners-by-link to preserve the original image URL in the title attribute.
227
228 s|<img\s+?([^>]*)\ssrc\s*=\s*(['"])([^>\\\2]+)\2|<img src=$2$3$2 $1|siUg
229 s|<img\s+?([^>]*)\ssrc\s*=\s*([^'">\\\s]+)|<img src=$2 $1|sig
230 s|(<img[^>]+height)\s*=\s*|$1=|sig
231
232 s|<img (src=(?:(['"])[^>\\\\2]*\2\|[^'">\\\s]+?))([^>]*)\s+width\s*=\s*((["']?)\d+?\5)(?=[\s>])|<img $1 width=$4$3|siUg
233
234
235 #################################################################################
236 #
237 # banners-by-size: Kill banners by size.
238 #
239 #################################################################################
240 #
241 # Standard banner sizes taken from http://www.iab.net/iab_banner_standards/bannersizes.html
242 #
243 # Note: Use http://config.privoxy.org/send-banner?type=trans for a transparent 1x1 image
244 #       Use http://config.privoxy.org/send-banner?type=pattern for a grey/white pattern image
245 #       Use http://config.privoxy.org/send-banner?type=auto  to auto-select.
246 #
247 # Note2: Use img-reorder before this filter to ensure maximum matching success
248 #
249 #################################################################################
250 FILTER: banners-by-size Kill banners by size.
251
252 # 88*31
253 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)88\4)[^>]*?(height=(['"]?)31\6)[^>]*?(?=/?>)@\
254   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
255 # 120*60, 120*90, 120*240, 120*600
256 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)120\4)[^>]*?(height=(['"]?)(?:600?|90|240)\6)[^>]*?(?=/?>)@\
257   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
258 # 125*125
259 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)125\4)[^>]*?(height=(['"]?)125\6)[^>]*?(?=/?>)@\
260   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
261 # 160*600
262 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)160\4)[^>]*?(height=(['"]?)600\6)[^>]*?(?=/?>)@\
263   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
264 # 180*150
265 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)180\4)[^>]*?(height=(['"]?)150\6)[^>]*?(?=/?>)@\
266   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
267 # 234*60, 468*60 (Most Banners!)
268 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)(?:234|468)\4)[^>]*?(height=(['"]?)60\6)[^>]*?(?=/?>)@\
269   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
270 # 240*400
271 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)240\4)[^>]*?(height=(['"]?)400\6)[^>]*?(?=/?>)@\
272   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
273 # 250*250, 300*250
274 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)(?:250|300)\4)[^>]*?(height=(['"]?)250\6)[^>]*?(?=/?>)@\
275   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
276 # 336*280
277 s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)336\4)[^>]*?(height=(['"]?)280\6)[^>]*?(?=/?>)@\
278   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
279
280 # Note: 200*50 was also proposed, but it probably causes too much collateral damage:
281 #
282 #s@<img\s+(?:src\s*=\s*(['"]?)([^>\\\1\s]+)\1)?[^>]*?(width=(['"]?)200\4)[^>]*?(height=(['"]?)50\6)[^>]*?(?=/?>)@\
283 #   <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-$2-by-size" $3 $5@sig
284
285
286 #################################################################################
287 #
288 # banners-by-link: Kill banners by their links to known clicktrackers (Experimental).
289 #
290 #################################################################################
291 FILTER: banners-by-link Kill banners by their links to known clicktrackers.
292
293 # Common case with width and height attributes:
294 #
295 s@<a\s+href\s*=\s*(['"]?)([^>\1\s]*?(?:\
296   adclick                             # See www.dn.se \
297 | advert                              # see dict.leo.org \
298 | atwola\.com/(?:link|redir)          # see www.cnn.com \
299 | doubleclick\.net/jump/              # redirs for doublecklick.net ads \
300 | counter                             # common \
301 | (?<!&type=)tracker                  # (&type=tracker is used in sf's project statistics) \
302 | adlog\.pl                           # see sf.net \
303 )[^>\1\s]*)\1[^>]*>\s*<img\s+(?:src\s*=\s*(['"]?)([^>\\\3\s]+)\3)?[^>]*((?:width|height)\s*=\s*(['"]?)\d+?\6)[^>]*((?:width|height)\s*=\s*(['"]?)\d+?\8)[^>]*?(?=/?>)\
304 @<img $5 $7 src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed $4 by link to $2"@sigx
305
306 # Rare case w/o explicit dimensions:
307 #
308 s@<a\s+href\s*=\s*(['"]?)([^>\1\s]*?(?:ad(?:click|vert)|atwola\.com/(?:link|redir)|doubleclick\.net/jump/|(?<!&type=)tracker|counter|adlog\.pl)[^>\1\s]*)\1[^>]*>\s*<img\s+(?:src\s*=\s*(['"]?)([^>\\\3\s]+)\3)?[^>]*?(?=/?>)@<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed $4 by link to $2"@sig
309
310
311 ################################################################################
312 #
313 # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking).
314 #
315 #################################################################################
316 FILTER: webbugs Squish WebBugs (1x1 invisible GIFs used for user tracking).
317
318 s@<img[^>]*\s(?:width|height)\s*=\s*['"]?[01](?=\D)[^>]*\s(?:width|height)\s*=\s*['"]?[01](?=\D)[^>]*?>@@siUg
319
320
321 #################################################################################
322 #
323 # tiny-textforms: Extend those tiny textareas up to 40x80 and kill the hard wrap.
324 #
325 #################################################################################
326 FILTER: tiny-textforms Extend those tiny textareas up to 40x80 and kill the hard wrap.
327
328 s/(<textarea[^>]*?)(?:\s*(?:rows|cols)=(['"]?)\d+\2)+/$1 rows=$2\40$2 cols=$2\80$2/ig 
329 s/(<textarea[^>]*?)wrap=(['"]?)hard\2/$1/ig
330
331
332 #################################################################################
333 #
334 # jumping-windows: Prevent windows from resizing and moving themselves.
335 #
336 #################################################################################
337 FILTER: jumping-windows Prevent windows from resizing and moving themselves.
338
339 s/(?<=[\W])(?:window|this|self)\.(?:move|resize)(?:to|by)\(/''.concat(/ig
340
341 #################################################################################
342 #
343 # frameset-borders: Give frames a border, make them resizable and scrollable.
344 #
345 #################################################################################
346 FILTER: frameset-borders Give frames a border and make them resizable.
347
348 s/(<frameset\s+[^>]*)framespacing=(['"]?)(no|0)\2/$1/igU
349 s/(<frameset\s+[^>]*)frameborder=(['"]?)(no|0)\2/$1/igU
350 s/(<frameset\s+[^>]*)border=(['"]?)(no|0)\2/$1/igU
351 s/(<frame\s+[^>]*)noresize/$1/igU
352 s/(<frame\s+[^>]*)frameborder=(['"]?)(no|0)\2/$1/igU 
353 s/(<frame\s+[^>]*)scrolling=(['"]?)(no|0)\2/$1/igU
354
355
356
357 #################################################################################
358 #
359 # demoronizer: Correct Microsoft's abuse of standardized character sets, which 
360 #              leave the browser to (mis)-interpret unknown characters, with 
361 #              sometimes bizarre results on non-MS platforms.
362 #
363 # credit: ripped from the demoroniser.pl script by: 
364 #         John Walker -- January 1998, http://www.fourmilab.ch/webtools/demoroniser
365 #
366 #################################################################################
367 FILTER: demoronizer Fix MS's non-standard use of standard charsets.
368
369 s/(&\#[0-2]\d\d)\s/$1; /g
370 # per Robert Lynch: http://slate.msn.com//?id=2067547, just a guess.
371 # Must come before x94 below.
372 s/\xE2\x80\x94/ -- /g
373 s/\x82/,/g
374 #s-\x83-<em>f</em>-g
375 s/\x84/,,/g
376 s/\x85/.../g
377 #s/\x88/^/g
378 #s-\x89- °/°°-g
379 s/\x8B/</g
380 s/\x8C/Oe/g
381 s/\x91/`/g
382 s/\x92/'/g
383 s/(\x93|\x94)/"/g
384 # Bullet type character.
385 s/\x95/&middot;/g
386 s/\x96/-/g
387 s/\x97/--/g
388 #s-\x98-<sup>~</sup>-g
389 #s-\x99-<sup>TM</sup>-g
390 # per Robert Lynch.
391 s/\x9B/>/g                  # 155
392
393
394 #################################################################################
395 #
396 # shockwave-flash: Kill embedded Shockwave Flash objects.
397 #                  Note: Better just block "/.*\.swf$"!
398 #
399 #################################################################################
400 FILTER: shockwave-flash Kill embedded Shockwave Flash objects.
401
402 s|<object [^>]*macromedia.*</object>|<!-- Squished Shockwave Object -->|sigU
403 s|<embed [^>]*(application/x-shockwave-flash\|\.swf).*>(.*</embed>)?|<!-- Squished Shockwave Flash Embed -->|sigU
404
405
406 #################################################################################
407 #
408 # quicktime-kioskmode: Make Quicktime movies saveable.
409 #
410 #################################################################################
411 FILTER: quicktime-kioskmode Make Quicktime movies saveable.
412
413 s/(<embed\s+[^>]*)kioskmode\s*=\s*(["']?)true\2/$1/ig 
414
415
416 #################################################################################
417 #
418 # fun: Text replacements for subversive browsing fun!
419 #
420 #################################################################################
421 FILTER: fun Text replacements for subversive browsing fun!
422
423 # SCNR
424 #
425 s/microsoft(?!.[^\s])/MicroSuck/ig
426
427 # Buzzword Bingo (example for extended regex syntax)
428 #
429 s* (?:industry|world)[ -]leading \
430 |  cutting[ -]edge \
431 |  customer[ -]focused \
432 |  market[ -]driven \
433 |  award[ -]winning # Comments are OK, too! \
434 |  high[ -]performance \
435 |  solutions[ -]based \
436 |  unmatched \
437 |  unparalleled \
438 |  unrivalled \
439 *$0<sup><font color="red"><b>Bingo!</b></font></sup> \
440 *igx
441
442 # For Germans only
443 #
444 s/(M|m)edien(?![^<]*>)/$1&auml;dchen/Ug
445
446 #################################################################################
447 #
448 # crude-parental: Crude parental filtering. Use with a suitable blocklist.
449 #                 Pages are "blocked" based on keyword matching.
450 #
451 #################################################################################
452 FILTER: crude-parental Crude parental filtering. Note that this filter doesn't work reliably.
453
454 # (Note: Middlesex, Sussex and Essex are counties in the UK, not rude words)
455 # (Note #2: Is 'sex' a rude word?!)
456
457 s%^.*(?<!middle)(?<!sus)(?<!es)sex.*$%<html><head><title>Blocked</title></head><body>\
458 <h3>Blocked by Privoxy's crude-parental filter due to possible adult content.</h3></body></html>%is
459
460 s+^.*warez.*$+<html><head><title>No Warez</title></head><body><h3>You're not searching for illegal stuff, are you?</h3></body></html>+is
461
462 # Remove by description
463 s/^.*\
464 (?:(suck|lick|tongue|rub|fuck|fingering|finger|chicks?)\s*)?\
465 (?:(her|your|my|hard|with|big|wet|tight|pink|hot|moist|young|teen)\s*)+\
466 (dicks?|penis|cocks?|balls?|tits?|pussy|cunt|clit|ass|mouth).*$\
467 /This page has been blocked by Privoxy's crude-parental content filter\
468 /is
469
470 #Remove by link text
471 s/^.*\
472 (download|broadband|view|watch|free|get|extreem)?\s*\
473 (sex|xxx|porn|cumshot|fuck(ing|s)?|anal|ass|asian|adult|Amateur|org(y|ies)|close ups?|hand?job|nail(ed)?)+\s*\
474 (movies?|pics?|videos?|dvds?|dvd's|links?).*$\
475 /This page has been blocked by Privoxy's crude-parental content filter\
476 /is
477
478 #Remove by age disclaimer
479 s/^.*\
480 (models?|chicks?|girls?|women|persons)\s*\
481 (who|are|were)+ (over|at least) (16|18|21) years (old|of age).*$\
482 /This page has been blocked by Privoxy's crude-parental content filter\
483 /is
484
485 #Remove by regulations
486 s/^.*(Section 2257|18 U.?S.?C.? 2257).*$\
487 /This page has been blocked by Privoxy's crude-parental content filter\
488 /is 
489
490
491 #################################################################################
492 #
493 # IE-Exploits: Disable some known Internet Explorer bug exploits.
494 #
495 #################################################################################
496 FILTER: ie-exploits Disable some known Internet Explorer bug exploits.
497
498 # Note: This is basically a demo and waits for someone more interested in IE
499 # security (sic!) to take over.
500
501 # Cross-site-scripting:
502 #
503 s%f\("javascript:location.replace\('mk:@MSITStore:C:'\)"\);%alert\("This page looks like it tries to use a vulnerability described here:\n http://online.securityfocus.com/archive/1/298748/2002-11-02/2002-11-08/2"\);%siU
504
505 # Address bar spoofing (http://www.secunia.com/advisories/10395/):
506 #
507 s/(<a[^>]*href[^>]*)(?:\x01|\x02|\x03|%0[012])@/$1MALICIOUS-LINK@/ig
508
509 # Nimda:
510 #
511 s%<script language="JavaScript">(window\.open|1;''\.concat)\("readme\.eml", null, "resizable=no,top=6000,left=6000"\)</script>%<br><font size="7"> WARNING: This Server is infected with <a href="http://www.cert.org/advisories/CA-2001-26.html">Nimda</a>!</font>%g
512
513
514 #################################################################################
515 #
516 #
517 # site-specifics: Cure for site-specific problems. Don't apply generally!
518 #
519 #   Note: The fixes contained here are so specific to the problems of the
520 #         particular web sites they are designed for that they would be a
521 #         waste of CPU cycles (or even destructive!) on 99.9% of the web
522 #         sites where they don't apply.
523 #
524 #################################################################################
525 FILTER: site-specifics Cure for site-specific problems. Don't apply generally!
526
527 # www.spiegel.de excludes X11 users from viewing Flash5 objects - shame.
528 # Apply to: www.spiegel.de/static/js/flash-plugin.js 
529 #
530 s/indexOf\("x11"\)/indexOf("x13")/
531
532 # www.quelle-bausparkasse.de uses a very stupid redirect mechanism that
533 # relies on a webbug being present. Can we tolerate that? No!
534 # Apply to: www.quelle-bausparkasse.de/$
535 #
536 s/mylogfunc()//g
537
538 # groups.yahoo.com has splash pages that one needs to click through in
539 # order to access the actual messages. Let the browser do that. Thanks
540 # to Paul Jobson for this one:
541 #
542 s|<a href="(.+?)">(?:Continue to message\|Weiter zu Nachricht)</a>|<meta http-equiv="refresh" content="0; URL=$1">|ig
543
544 # monster.com has two very similar gimmicks:
545 #
546 s|<input type="hidden" name="REDIRECT" value="(.+?)">|<meta http-equiv="refresh" content="0; URL=$1">|i
547  
548 s|<IMG SRC="http://media.monster.com/mm/usen/my/no_thanks_211x40.gif".+?>|<meta http-equiv="refresh" content="0; URL=http://my.monster.com/resume.asp">|i 
549
550 # nytimes.com triggers popups through the onload handler of dummy images
551 # to fool popup-blockers.  
552 #
553 s|(<img [^>]*)onload|$1never|sig
554
555 # Pre-check all the "Discard" buttons in GNU Mailman's web interface.
556 # (This saves a lot of mouse aiming practice when flushing spamtraps)
557 #
558 s|(<INPUT name="\d{2,4}" type="RADIO" value="0") CHECKED |$1|g
559 s|<INPUT name="\d{2,4}" type="RADIO" value="3" |$0 checked|g
560
561 #################################################################################
562 #
563 # no-ping: Removes non-standard ping attributes in <a> and <area> tags.
564 #          
565 #################################################################################
566 FILTER: no-ping Removes non-standard ping attributes in <a> and <area> tags.
567 s@(<a(?:rea)?[^>]*?)\sping=(['"]?)([^"'>]+)\2([>\s]?)@\
568 <strong style="color:white; background-color:red;" title="Privoxy removed ping target '$3'">PING!</strong>\n$1$4@ig
569
570 #################################################################################
571 #
572 # google: CSS-based block for Google text ads. Also removes
573 #         a width limitation and the toolbar advertisement.
574 #
575 #################################################################################
576 FILTER: google CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
577
578 s@</head>@<style type="text/css">\n\
579  /* Style sheet inserted by Privoxy's google filter. */\n\
580  \#fbc, \#fbl, \#ra, .rhh {visibility: hidden !important;}\n\
581  \#tpa1,\#tpa2,\#tpa3,\#tpa4,\#tpa5,\#tpa5, \#spl, .ch, \#ads,\
582  \#toolbar, \#google_ads_frame, \#mbEnd {display: none !important;}\n\
583  .main_body, .j {width: 100%}\n</style>\n$0@
584 s@<div style=\"padding-top:11px;min-width:500px\">@<div id="main_body">@
585 s@(<table cellspacing=0 cellpadding=0 width=25% align=right bgcolor=\#ffffff border=0\
586 |</font></td></tr></tbody></table><table align=\"right\" bgcolor=\"\#ffffff\"\
587 |<table cellspacing=0 cellpadding=0 align=right bgcolor=\#ffffff border=0\
588 |<table style=\"clear:both\" align=right width=25% cellspacing=\"0\" cellpadding=\"0\"\
589  border=\"0\" bgcolor=\"\#ffffff\")@$0 id="ads"@
590 s@(<br clear=all><table)( border=0 cellpadding=9><tr><td)@$1 id="toolbar"$2@
591
592 #################################################################################
593 #
594 # yahoo: CSS-based block for Yahoo text ads. Also removes a width limitation.
595 #
596 #################################################################################
597 FILTER: yahoo CSS-based block for Yahoo text ads. Also removes a width limitation.
598
599 s@</head>@\n<style type="text/css">\n\
600  /* Style sheet inserted by Privoxy's yahoo filter. */\n\
601  \#symadbn, \#ymadbn, .yschbox, .yschhd, .bbox, \#yschsec, \#sec,\
602  \#yschanswr, .yschftad, .yschspn, .yschspns, \#ygrp-sponsored-links,\
603  \#nwad, \#MWA2, \#MSCM, \#yregad, \
604  \#ks-ypn-ads, .ad, \#east, \#ygrp-vital {display: none !important;}\n\
605  \#yschpri, \#yschweb, \#pri, \#web, \#main {width: 100% !important; max-width: 100% !important;}\n\
606  \#yschqcon, \#yschtg {width: auto !important; /* No useless horizontal scrollbar please */}\n\
607  \#composebox \#compose_editorArea {width: 70% !important; /* reasonably sized reply textarea please */\n\
608  </style>\n$0\n@
609
610 s@(<textarea\s+id="composeArea"[^>]*)width:545px;@$1width:70%;@isU
611
612 #################################################################################
613 #
614 # msn: CSS-based block for MSN text ads. Also removes tracking URLs
615 #      and a width limitation.
616 #
617 #################################################################################
618 FILTER: msn CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
619
620 s@</head>@<style type="text/css">\n\
621  /* Style sheet inserted by Privoxy's msn filter. */\n\
622  .msn_ads, \#at, \#ar, .mktmsg {display: none !important;}\n\
623  \#results, .flank, .results_area_flank, .results_area_stroke,\n\
624  \#results_area, .SearchSection, .not, .sc_rslth1\n\
625 .content, \#sw_foot, \#bf, \#sw_content, \#sidebar, \#pag\n\
626  {width: 99% !important; min-width: 99% !important;\n\
627  max-width: 100% !important; /* width:100% sometimes causes horizontal scrollbars */}\n\
628  /* Remove "suggestions". They are next to worthless but partly overlap with the search results */\n\
629  .suggestion, \#nys_right, \#nys {clear: both; display:none;}\n\
630  \#content {padding-right: 0;}\n\
631  </style>\n$0@
632 # Are these ids still in use?
633 s@(<div[^>]*) id=(["']?)ads_[^\2]*\2@$1 class="msn_ads"@Uig
634 s@(<div[^>]*) class=(["']?)sb_ads[^\2]*\2@$1 class="msn_ads"@Uig
635 s@(<a[^>]*href=\")http://g.msn.com/.*\?(http://.*)(&amp;&amp;DI=.*)(\")@$1$2$4@Ug
636 s@(<a[^>]*)gping=\".*\"@$1 title="URL cleaned up by Privoxy's msn filter"@Ug
637
638 #################################################################################
639 #
640 # blogspot: Cleans up some Blogspot blogs. Read the fine print before using this.
641 #
642 #           This filter also intentionally removes some navigation stuff and
643 #           sets the page width to 100%. As a result, some rounded "corners" would
644 #           appear to early or not at all and as fixing this would require a browser
645 #           that understands background-size (CSS3), they are removed instead.
646 #
647 #           When applied to feeds, it removes comment titles that
648 #           only contain the beginning of the actual comment.
649 #
650 #################################################################################
651 FILTER: blogspot Cleans up some Blogspot blogs. Read the fine print before using this.
652
653 s@</head>@<style type="text/css">\n\
654  /* Style sheet inserted by Privoxy's blogspot filter. */\n\
655  \#powered-by {display: none !important;}\n\
656  \#wrap4, \#wrapper {margin-top: 0px }\n\
657  \#blogheader, \#header {margin-top: 0.5em !important}\n\
658  \#content {width: 98% }\n\
659  \#main {width: 70% }\n\
660  \#sidebar {width: 29% }\n\
661  .post-body {overflow: auto;}\n\
662  .blogComments {width: 100%; overflow: auto;}\n</style>\n$0@
663 s@<body.*(?:<div id="space-for-ie"></div>|(<div id="(?:content|wrap4|wrapper)))@<body>\
664  <!-- Privoxy's blogspot filter ditched some garbage here -->$1@Us
665 s@(<div style=\"[^\"]*width:)30em@$1 100%@
666 s@background:url\(\"http://www.blogblog.com/rounders[^\"]*\"\).*;@/*$0*/@Ug
667 s@(background:\#[a-f\d]{3})( url\(\"http://www.blogblog.com/rounders[^\"]*\"\).*;)@$1 ;/*$2*/@Ug
668 # Do the feed filtering magic as described above.
669 s@<title(?:\s+type=\'text\')?>([^<]*)(?:\.\.\.)?\s*</title>\s*\
670 (<content(?:\s+type=\'(?:html|text)\')?>\s*\1)@<title></title>$2@ig
671
672 #################################################################################
673 #
674 # x-httpd-php-to-html: Changes the Content-Type header from
675 #                      x-httpd-php to html. "Content-Type: x-httpd-php"
676 #                      is set by clueless PHP users and causes many
677 #                      browsers do open a download menu instead of
678 #                      rendering the page.
679 #
680 #################################################################################
681 SERVER-HEADER-FILTER: x-httpd-php-to-html Changes the Content-Type header from x-httpd-php to html.
682
683 s@^(Content-Type:)\s*application/x-httpd-php@$1 text/html@i
684
685 #################################################################################
686 #
687 # html-to-xml: Changes the Content-Type header from html to xml.
688 #
689 #################################################################################
690 SERVER-HEADER-FILTER: html-to-xml Changes the Content-Type header from html to xml.
691
692 s@^(Content-Type:)\s*text/html(;.*)?$@$1 application/xhtml+xml$2@i
693
694 #################################################################################
695 #
696 # xml-to-html: Changes the Content-Type header from xml to html.
697 #
698 #################################################################################
699 SERVER-HEADER-FILTER: xml-to-html Changes the Content-Type header from xml to html.
700
701 s@^(Content-Type:)\s*(?:application|text)/(?:xhtml\+)?xml(;.*)?$@$1 text/html$2@i
702
703 #################################################################################
704 #
705 # hide-tor-exit-notation: Remove the Tor exit node notation in Host and Referer headers.
706 #
707 #   Note: If Privoxy and Tor are chained and Privoxy is configured to
708 #         use socks4a, one can use http://www.example.org.foobar.exit/
709 #         to access the host www.example.org through Tor exit node foobar.
710 #
711 #         As the HTTP client isn't aware of this notation, it treats the
712 #         whole string "www.example.org.foobar.exit" as host and uses it
713 #         for the "Host" and "Referer" headers. From the server's point of
714 #         view the resulting headers are invalid and can cause problems.
715 #
716 #         An invalid "Referer" header can trigger "hot-linking" protections,
717 #         an invalid "Host" header will make it impossible for the server to
718 #         find the right vhost (several domains hosted on the same IP address).
719 #
720 #         This filter removes the "foo.exit" part in those headers
721 #         to prevent the mentioned problems. Note that it only modifies
722 #         the HTTP headers, it doesn't make it impossible for the server
723 #         to detect your Tor exit node based on the IP address the request is
724 #         coming from.
725 #
726 #################################################################################
727 CLIENT-HEADER-FILTER: hide-tor-exit-notation Removes the Tor exit node notation in Host and Referer headers.
728
729 s@^((?:Referer|Host):\s*(?:https?://)?[^/]*)\.[^\./]*?\.exit@$1@i
730
731 #################################################################################
732 #
733 # less-download-windows: Prevents annoying download windows for content types
734 #                        the browser can handle itself.
735 #
736 #################################################################################
737 SERVER-HEADER-FILTER: less-download-windows Prevent annoying download windows for content types the browser can handle itself.
738
739 s@^Content-Disposition:.*filename=(["']?).*\.(png|gif|jpe?g|diff?|d?patch|c|h|pl|shar)\1.*$@@i
740 s@^(Content-Type:)\s*(?:message/(?:news|rfc822)|text/x-.*|application/x-sh(?:\s|$))\s*@$1 text/plain@i
741
742 #################################################################################
743 #
744 # image-requests: Tags detected image requests as "IMAGE-REQUEST". Whether
745 #                 or not the detection actually works depends on the browser.
746 #
747 #################################################################################
748 CLIENT-HEADER-TAGGER: image-requests Tags detected image requests as "IMAGE-REQUEST".
749
750 s@^Accept:\s*image/.*@IMAGE-REQUEST@i
751
752 #################################################################################
753 #
754 # css-requests:  Tags detected CSS requests as "CSS-REQUEST". Whether
755 #                or not the detection actually works depends on the browser.
756 #
757 #################################################################################
758 CLIENT-HEADER-TAGGER: css-requests Tags detected CSS requests as "CSS-REQUEST".
759
760 s@^Accept:\s*text/css.*@CSS-REQUEST@i
761
762 #################################################################################
763 #
764 # client-ip-address: Tags the request with the client's IP address.
765 #
766 #################################################################################
767 CLIENT-HEADER-TAGGER: client-ip-address Tags the request with the client's IP address.
768
769 s@^\w*\s+.*\s+HTTP/\d\.\d\s*@IP-ADDRESS: $origin@D
770
771 #################################################################################
772 #
773 # http-method: Tags the request with its HTTP method.
774 #
775 #################################################################################
776 CLIENT-HEADER-TAGGER: http-method Tags the request with its HTTP method.
777
778 s@^(\w*).*HTTP/\d\.\d\s*$@$1@i
779
780 #################################################################################
781 #
782 # allow-post: Tags POST requests as "ALLOWED-POST".
783 #
784 #################################################################################
785 CLIENT-HEADER-TAGGER: allow-post Tags POST requests as "ALLOWED-POST".
786
787 s@^(?:POST)\s+.*\s+HTTP/\d\.\d\s*@ALLOWED-POST@i
788
789 #################################################################################
790 #
791 # complete-url: Tags the request with the whole request URL.
792 #
793 #################################################################################
794 CLIENT-HEADER-TAGGER: complete-url Tags the request with the whole request URL.
795
796 s@^\w*\s+(.*)\s+HTTP/\d\.\d\s*$@$1@i
797
798 #################################################################################
799 #
800 # user-agent: Tags the request with the complete User-Agent header.
801 #
802 #################################################################################
803 CLIENT-HEADER-TAGGER: user-agent Tags the request with the complete User-Agent header.
804
805 s@^User-Agent:.*@$0@i
806
807 #################################################################################
808 #
809 # content-type: Tags the request with the content type declared by the server.
810 #
811 #################################################################################
812 SERVER-HEADER-TAGGER: content-type Tags the request with the content type declared by the server.
813
814 s@^Content-Type:\s*([^;]+).*@$1@i
815
816 #################################################################################
817 #
818 # privoxy-control: The taggers create tags with the content of X-Privoxy-Control
819 #                  headers, the filters remove said headers.
820 #
821 #################################################################################
822 CLIENT-HEADER-TAGGER: privoxy-control Creates tags with the content of X-Privoxy-Control headers.
823
824 s@^X-Privoxy-Control:\s*@@i
825
826 CLIENT-HEADER-FILTER: privoxy-control Removes X-Privoxy-Control headers.
827
828 s@^X-Privoxy-Control:.*@@i
829
830 SERVER-HEADER-TAGGER: privoxy-control Creates tags with the content of X-Privoxy-Control headers.
831
832 s@^X-Privoxy-Control:\s*@@i
833
834 SERVER-HEADER-FILTER: privoxy-control Removes X-Privoxy-Control headers.
835
836 s@^X-Privoxy-Control:.*@@i
837
838
839 ############################################################################## 
840 #
841 #  Revisions   :
842 #     $Log: default.filter,v $
843 #     Revision 1.70  2009/02/21 13:01:51  fabiankeil
844 #     Make blogspot's feed magic slightly more reliable.
845 #
846 #     Revision 1.69  2009/02/12 15:40:11  ler762
847 #     more yahoo email ad blocking
848 #
849 #     Revision 1.68  2008/09/19 13:26:04  fabiankeil
850 #     s@tounge@tongue@. Anonymously reported in #1648657.
851 #
852 #     Revision 1.67  2008/08/06 17:38:06  fabiankeil
853 #     In banners-by-size, make sure white-space around the height
854 #     attribute is removed as well and replace two spaces with
855 #     "\s" so we don't get fooled by tabs. Fixes #2036125.
856 #
857 #     Revision 1.66  2008/08/03 17:27:47  fabiankeil
858 #     Teach msn filter to catch a few new ad classes.
859 #
860 #     Revision 1.65  2008/07/21 13:43:44  fabiankeil
861 #     Fix img-reorder regression introduced with my last commit.
862 #     Some tags were terminated too soon, letting the browser render
863 #     some of their arguments as text. Oops.
864 #
865 #     Revision 1.64  2008/07/12 15:49:09  fabiankeil
866 #     - Don't let img-reorder touch width attributes
867 #       that aren't followed by either whitespace or '>',
868 #       as those usually indicate onclick nonsense.
869 #       Problem and solution reported by Glenn Washburn in #2014552.
870 #     - While at it, don't use more groups than necessary.
871 #
872 #     Revision 1.63  2008/06/27 12:53:41  fabiankeil
873 #     Make sure the taggers css-requests and image-requests
874 #     only match at the beginning of the header.
875 #
876 #     Revision 1.62  2008/06/21 17:02:03  fabiankeil
877 #     Fix typo.
878 #
879 #     Revision 1.61  2008/05/21 18:44:43  fabiankeil
880 #     - Let the content-type tagger ignore headers without value.
881 #     - Remove a few unused lines at the end of the file.
882 #
883 #     Revision 1.60  2008/04/26 10:36:41  fabiankeil
884 #     Let the msn filter hide another class.
885 #
886 #     Revision 1.59  2008/04/23 16:18:18  fabiankeil
887 #     s@declarded@declared@
888 #
889 #     Revision 1.58  2008/02/02 15:27:19  fabiankeil
890 #     Yet another yahoo update to get the width limitation removal working again.
891 #
892 #     Revision 1.57  2008/01/26 15:45:39  fabiankeil
893 #     Don't let the less-download-windows filter mess up
894 #     "Content-Type: application/x-shockwave-flash" headers.
895 #
896 #     Revision 1.56  2008/01/25 19:12:40  fabiankeil
897 #     - Add yet another new yahoo ad id.
898 #     - Don't let the first banners-by-link job punish URLs for merely
899 #       containing the pattern "/jump/" when it should really look for
900 #       "doubleclick\.net/jump/".
901 #
902 #     Revision 1.55  2007/12/31 19:53:59  fabiankeil
903 #     Let the msn filter remove the width limitation again.
904 #
905 #     Revision 1.54  2007/12/31 19:11:31  fabiankeil
906 #     - Let the yahoo filter remove the width limitation again.
907 #     - Teach the blogspot filter to remove useless feed comment
908 #       titles that only contain the beginning of the actual comment.
909 #
910 #     Revision 1.53  2007/12/23 15:48:12  fabiankeil
911 #     - Lo and behold, the CSS fix for the MSN buttons is no longer necessary.
912 #     - Add some new selectors the msn filter should hide.
913 #     - Add the two yahoo selectors Lee reported in #1856574.
914 #     - Add comments that the width limitation fixes stopped
915 #       working for the msn and yahoo filter.
916 #
917 #     Revision 1.52  2007/11/27 18:35:48  fabiankeil
918 #     Update CSS for the yahoo filter.
919 #
920 #     Revision 1.51  2007/11/04 16:15:11  fabiankeil
921 #     - Add client-header taggers: client-ip-address,
922 #       http-method, allow-post, complete-url and user-agent.
923 #     - Add server-header tagger: content-type.
924 #
925 #     Revision 1.50  2007/11/03 15:05:30  fabiankeil
926 #     Consistently use an empty line between the description and the PCRS code
927 #     and end descriptions with dots. Patch submitted by Simon Ruderich.
928 #
929 #     Revision 1.49  2007/11/03 14:29:41  fabiankeil
930 #     Spelling fixes mostly submitted by Simon Ruderich.
931 #
932 #     Revision 1.48  2007/10/17 18:11:32  fabiankeil
933 #     Add privoxy-control header filters and taggers.
934 #
935 #     Revision 1.47  2007/10/06 15:45:25  fabiankeil
936 #     Let msn hide sponsored links in #at divs.
937 #
938 #     Revision 1.46  2007/10/06 09:54:13  fabiankeil
939 #     - Let msn hide sponsored links in #ar divs.
940 #     - Teach banners-by-link not to block the graphs for sf's tracker statistics.
941 #
942 #     Revision 1.45  2007/08/11 16:54:12  fabiankeil
943 #     - Complete the changes from r1.42.
944 #     - Make crude-parental less sensitive to the amount of white-space,
945 #       add the note that it doesn't work too well again and replace the
946 #       DMOZ link with a less confusing explanation.
947 #
948 #     Revision 1.44  2007/07/18 11:06:56  hal9
949 #     Replace notarget with '' in all popups filter to keep from breaking xhmtl per
950 #     report from Siegfried Gipp.
951 #
952 #     Revision 1.43  2007/06/01 14:17:04  fabiankeil
953 #     Mention possible delimiter conflicts with variables in dynamic pcrs commands.
954 #
955 #     Revision 1.42  2007/05/17 15:55:36  fabiankeil
956 #     Undo an improperly tested last-minute change
957 #     and turn "text-requests" back into "css-requests".
958 #
959 #     Revision 1.41  2007/05/17 15:45:41  fabiankeil
960 #     - Mention new filter types and the 'D' option.
961 #     - Header filters are now case-insensitive and accept a
962 #       varying amount of whitespace after the colon.
963 #     - Add another selector for yahoo ads.
964 #     - New server-header filter: less-download-windows
965 #     - New client-header taggers: text-requests and image-requests.
966 #
967 #     Revision 1.40  2007/03/20 15:40:00  fabiankeil
968 #     Adjust to new world order with dedicated header-filter actions.
969 #
970 #     Revision 1.39  2007/02/21 14:10:23  fabiankeil
971 #     - Fix a js-annoyances pcrs command that broke
972 #       evaluated code. (BR #1124071, thanks to Bor Gergely)
973 #     - Have unsolicited-popups and all-popups catch the
974 #       wheather.com popup reported in in AF #1640173.
975 #
976 #     Revision 1.38  2007/02/19 11:22:48  hal9
977 #     Adding back the orginal filter content to offset problems found by Fabian.
978 #
979 #     Revision 1.37  2007/02/17 13:29:44  hal9
980 #     Updates to the crude parental filter per Feature Requests item #1648657.
981 #
982 #     Revision 1.36  2007/02/05 16:47:31  fabiankeil
983 #     - Let banners-by-link look for "advert".
984 #     - Fix XML systax problems with banners-by-link
985 #       and banners-by-size (AF#1651570).
986 #
987 #     Revision 1.35  2006/12/21 12:28:12  fabiankeil
988 #     Escaping special characters in filter descriptions is no
989 #     longer necessary, it's done by Privoxy now.
990 #
991 #     Revision 1.34  2006/12/12 17:32:23  fabiankeil
992 #     Added id mbEnd to google filter, it's now and then
993 #     used for the sponsored links.
994 #
995 #     Have js-annoyances try to prevent status bar
996 #     modifications where the status bar text is
997 #     inside another variable. Fixes 1605710.
998 #
999 #     Revision 1.33  2006/11/16 17:10:43  fabiankeil
1000 #     Removed webbugs debugging comment again.
1001 #     The apostrophe could break JavaScript and
1002 #     the comment itself could mess up existing
1003 #     comments.
1004 #
1005 #     Revision 1.32  2006/11/10 18:04:04  fabiankeil
1006 #     Have no-ping print the ping warning in red.
1007 #
1008 #     Modified yahoo to keep in sync with recent
1009 #     CSS changes and to suppress a useless horizontal
1010 #     scrollbar.
1011 #
1012 #     msn now makes sure that the continue-link boxes
1013 #     act as links (the original CSS just changes the cursor).
1014 #
1015 #     Changed fun filter regex to leave microsoft links alone.
1016 #     Fixes BR 1019996.
1017 #
1018 #     Revision 1.31  2006/10/21 13:12:28  fabiankeil
1019 #     Added no-ping and hide-tor-exit-notation.
1020 #
1021 #     Adjusted jumping-windows to break less.
1022 #     Fixes BR 1146134.
1023 #
1024 #     Revision 1.30  2006/10/18 12:36:50  fabiankeil
1025 #     google filter now cleans Google groups as well.
1026 #
1027 #     Revision 1.29  2006/10/11 14:03:17  fabiankeil
1028 #     Changed img-reorder regex to only move width
1029 #     attributes if they are following at least one
1030 #     whitespace. Fixes BR 1328455.
1031 #
1032 #     Revision 1.28  2006/10/11 13:31:13  fabiankeil
1033 #     Added Anduin Withers' js-annoyances fix
1034 #     for not messing up escaped quotes. Fixes BR 999765.
1035 #
1036 #     Improved blogspot filter to make it less likely that
1037 #     the blogspot banner at the top of the page is missed.
1038 #
1039 #     Revision 1.27  2006/10/08 17:00:51  fabiankeil
1040 #     Modified webbugs filter to create a comment around the offending
1041 #     image instead of removing it entirely.
1042 #
1043 #     Adjusted regex to only match if there's at least one whitespace
1044 #     before the width and height attributes. Makes it more likely that
1045 #     they are indeed attributes, and not part of the value of another attribute.
1046 #     Solves BR 1035587.
1047 #
1048 #     Thanks to Martin Thomas for diagnosing the cause of the problem.
1049 #
1050 #     Revision 1.26  2006/10/06 18:06:16  fabiankeil
1051 #     Added header filter x-httpd-php-to-html
1052 #     and reverted another img-reorder whitespace
1053 #     problem.
1054 #
1055 #     Revision 1.25  2006/10/06 15:26:09  fabiankeil
1056 #     Bumped copyright year.
1057 #
1058 #     Reverted parts of the last img-reorder change
1059 #     which were intended to remove superfluous whitespace
1060 #     but had the side effect to mess up some tags.
1061 #
1062 #     Modified banners-by-size and banners-by-link to
1063 #     use border value "0" instead of "\0". Fixes BR 1100065.
1064 #
1065 #     Revision 1.24  2006/10/06 11:25:31  fabiankeil
1066 #     Taught img-reorder not to break img tags
1067 #     with empty src attributes. Fixes BR 1089474.
1068 #     Thanks to Raphael Moll for reporting.
1069 #
1070 #     Revision 1.23  2006/10/05 14:46:28  fabiankeil
1071 #     Replaced "<" in img-reorder's description with "&lt;".
1072 #
1073 #     Modified msn filter to tag ads with classes instead
1074 #     of ids. There may be more than one ad per page,
1075 #     but ids are required to be unique.
1076 #
1077 #     Revision 1.22  2006/10/04 19:17:14  fabiankeil
1078 #     Incorportated Frédéric Crozat's ie-exploits
1079 #     modification to make it less trigger-happy.
1080 #
1081 #     Modified blogspot filter to make .post-body
1082 #     scrollable if necessary.
1083 #
1084 #     Revision 1.21  2006/10/02 16:21:14  fabiankeil
1085 #     Adjusted yahoo filter to hide .yschspns as well.
1086 #     Added header filters: html-to-xml and xml-to-html.
1087 #
1088 #     Revision 1.20  2006/10/01 21:00:22  fabiankeil
1089 #     New site-specific filters: google, yahoo, msn and blogspot.
1090 #
1091 #     Revision 1.19  2006/07/18 14:48:45  david__schmidt
1092 #     Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
1093 #     with what was really the latest development (the v_3_0_branch branch)
1094 #
1095 #     Revision 1.11.2.23  2004/02/17 13:34:01  oes
1096 #     - Beefed up the protection of the unsolicited-popups
1097 #       filter against matching in JavaScript string constants.
1098 #     - Extended the fun filter with a German joke
1099 #     - Extended the site-specifics filter with a convenience
1100 #       reeplacement for managing mailing lists at SourceForge
1101 #
1102 #     Revision 1.11.2.22  2004/01/30 15:29:29  oes
1103 #     Updated the copyright note
1104 #
1105 #     Revision 1.11.2.21  2004/01/20 15:15:01  oes
1106 #     Detail enhancement in all-popups
1107 #
1108 #     Revision 1.11.2.20  2004/01/06 16:46:14  oes
1109 #     Fixed a JS syntax problem in jumping-windows
1110 #
1111 #     Revision 1.11.2.19  2003/12/17 17:09:25  oes
1112 #     Added remedy against IE address bar spoofing
1113 #
1114 #     Revision 1.11.2.18  2003/12/02 11:25:27  oes
1115 #     Fixed a line trashed in previous commit
1116 #
1117 #     Revision 1.11.2.17  2003/12/01 21:58:46  oes
1118 #     Assorted tuning:
1119 #
1120 #      - unsolicited-popups no longer matches at start or end of quoted
1121 #        strings, and is now activated earlier and deactivated later in
1122 #        the page.
1123 #      - replacement images in banners-by-* now without border
1124 #      - more effective shockwave flash flattening
1125 #      - Custom annoyance filtering for Yahoo Groups, Monster.com, NY Times.
1126 #
1127 #     Revision 1.11.2.16  2003/05/08 09:44:56  oes
1128 #     Allow extra parameters in blink,marquee tags. Fixes bug #734012
1129 #
1130 #     Revision 1.11.2.15  2003/03/30 13:57:08  oes
1131 #     Making unsolicited-popups safe for use on <html> tags enclosed in JS strings
1132 #
1133 #     Revision 1.11.2.14  2003/03/19 13:17:50  oes
1134 #     - Added filter "site-specifics" to address site specific problems
1135 #     - Fixed a small problem in the img-reorder filter
1136 #
1137 #     Revision 1.11.2.13  2003/03/18 19:28:59  oes
1138 #     Fixed a minor problem in the img-reorder filter
1139 #
1140 #     Revision 1.11.2.12  2003/03/15 14:06:58  oes
1141 #      - Assorted refinements, optimizations and fixes in the js-annoyances,
1142 #        img-reorder, banners-by-size, banners-by-link, webbugs, refresh-tags,
1143 #        html-annoyances, content-cookies and fun filters
1144 #      - Replaced filter "popups" by choice between two modes:
1145 #        - "unsolicited-popups" tries to catch only the unsolicited ones
1146 #        - "all-popups" tries to kill them all (as before)
1147 #      - New filter "tiny-textforms" Help those tiny or hard-wrap textareas.
1148 #      - New filter "jumping-windows" that prevents windows from resizing
1149 #        and moving themselves
1150 #      - Replaced "nimda" with more general "ie-exploits" filter in which
1151 #        all filters for exploits shall be collected
1152 #
1153 #     Revision 1.11.2.11  2002/11/12 16:14:43  oes
1154 #     Exchanged js-annoyance filter against status bar rewrites with improved version by Don Libes
1155 #
1156 #     Revision 1.11.2.10  2002/11/11 13:39:47  oes
1157 #     Make refresh-tags filter work even on incorrect refresh tags like found on usatoday.com
1158 #
1159 #     Revision 1.11.2.9  2002/11/08 16:39:17  oes
1160 #     Made img-reorder more cautious. Fixes bug #632715
1161 #
1162 #     Revision 1.11.2.8  2002/10/13 21:56:52  hal9
1163 #     Adding demoronizer filter. This should include all the common abuses. I have
1164 #     left a few of the rare cases commented out (never found these in the wild).
1165 #
1166 #     Revision 1.11.2.7  2002/09/25 15:09:39  oes
1167 #     Preserve original quoting style in <img> tags wherever possible. Fixes Bug #605956
1168 #
1169 #     Revision 1.11.2.6  2002/08/23 14:12:26  oes
1170 #     Proofed frameset-borders against "fremaborder=0 border=0"
1171 #
1172 #     Revision 1.11.2.5  2002/08/22 15:05:20  oes
1173 #     Added Filter to make Quicktime movies saveable (thanks to aaron@linville.org for the idea)
1174 #
1175 #     Revision 1.11.2.4  2002/08/10 11:32:29  oes
1176 #     Attribute values in replacement tags of banners-by-size filter now undelimited. (Fixes bug #592493)
1177 #
1178 #     Revision 1.11.2.3  2002/08/05 11:43:56  oes
1179 #     Fixed a bug in the popups filter that was introduced with the last fix :-(
1180 #
1181 #     Revision 1.11.2.2  2002/08/01 11:20:13  oes
1182 #     Fixed bugs 587802, 577802 and an unreported one
1183 #
1184 #     Revision 1.11.2.1  2002/07/26 15:18:26  oes
1185 #     - All filters reviewed and many shorcomings fixed
1186 #     - New filters: img-reorder, banners-by-link and js-events
1187 #     - Jobs reorderd because they are now executed in order of
1188 #       appearance
1189 #
1190 #     Revision 1.11  2002/05/24 00:57:18  oes
1191 #     Made WeBugs job ungreedy; Fixes bug 559190
1192 #
1193 #     Revision 1.10  2002/04/18 10:14:19  oes
1194 #     renamed some filters
1195 #
1196 #     Revision 1.9  2002/04/11 07:36:35  oes
1197 #     Generalized js-popup filter
1198 #
1199 #     Revision 1.8  2002/04/10 17:07:21  oes
1200 #     Fixed potentially desctructive jobs, added noflash filter
1201 #
1202 #     Revision 1.7  2002/04/09 18:34:51  oes
1203 #     Fixed HTML syntax in replacements
1204 #
1205 #     Revision 1.6  2002/04/03 19:49:52  swa
1206 #     name change
1207 #
1208 #     Revision 1.5  2002/03/27 15:30:26  swa
1209 #     have a consistent appearance
1210 #
1211 #     Revision 1.4  2002/03/26 22:29:54  swa
1212 #     we have a new homepage!
1213 #
1214 #     Revision 1.3  2002/03/24 16:08:03  jongfoster
1215 #     Fixing banners-by-size for new config URLs
1216 #
1217 #     Revision 1.2  2002/03/24 13:02:18  swa
1218 #     name change related issues.
1219 #
1220 #     Revision 1.1  2002/03/24 11:37:39  jongfoster
1221 #     Name change
1222 #
1223 #     Revision 1.24  2002/03/16 20:39:54  oes
1224 #      - Added descriptions to the filters so users will know what they select in the cgi editor
1225 #      - Added content-cookies filter
1226 #      - Bugfixed many jobs (Thanks to Al for some hints)
1227 #
1228 #     Revision 1.22  2002/03/12 13:42:50  oes
1229 #     Fixing & Optimizing REs
1230 #
1231 #     Revision 1.21  2002/03/12 11:59:20  oes
1232 #     Beefed up Buzzword Bingo
1233 #
1234 #     Revision 1.20  2002/03/12 01:42:50  oes
1235 #     Introduced modular filters
1236 #
1237 #     Revision 1.19  2002/03/10 19:49:24  oes
1238 #     Added expression to kill referer tracking in JavaScripts
1239 #
1240 #     Revision 1.18  2002/03/08 17:14:12  oes
1241 #     PNG -> image in comments
1242 #
1243 #     Revision 1.17  2002/03/07 03:50:54  oes
1244 #     Adapted comments to new built-in images
1245 #
1246 #     Revision 1.16  2002/02/21 00:12:19  jongfoster
1247 #     Modifying the banner regexps to use long URLS and to autodetect
1248 #     whether to show a logo or a transparent GIF, based on actionsfile
1249 #     setting.
1250 #
1251 #     Revision 1.15  2001/12/28 23:54:20  steudten
1252 #     Fix for feature Req #495374: http-equiv problem
1253 #
1254 #     Revision 1.14  2001/12/09 18:55:11  david__schmidt
1255 #     Updated CODE_STATUS to beta, commented out microsuck line in re_filterfile
1256 #     for 2.9.10 beta
1257 #
1258 #     Revision 1.13  2001/10/13 13:11:20  joergs
1259 #     Fixed WebBug filter.
1260 #
1261 #     Revision 1.12  2001/10/07 15:46:42  oes
1262 #     Followed Guy's proposal to change the document.cookie job
1263 #
1264 #     Revision 1.11  2001/09/21 12:34:00  joergs
1265 #     Added filter to replace "Nimda" code by a warning.
1266 #
1267 #     Revision 1.10  2001/07/20 11:04:26  oes
1268 #     Added Rodneys javascript cookie filter
1269 #
1270 #     Revision 1.9  2001/07/13 14:03:48  oes
1271 #     Elimiated yet another bug in the banner-by-size jobs. Shame on me!
1272 #
1273 #     Revision 1.8  2001/06/29 13:34:00  oes
1274 #     - Added explanation for U and T options
1275 #     - Added hint on image replacement by CGI call
1276 #     - Fixed bug in banner-by-size jobs
1277 #
1278 #     Revision 1.7  2001/06/19 14:21:56  oes
1279 #     Fixed microsuck line
1280 #
1281 #     Revision 1.6  2001/06/09 14:01:57  swa
1282 #     header. cosmetics. default: no messing ala microsuck.
1283 #