Merge in changes from Debian packages 3.0.0-3 to 3.0.0-5
[privoxy.git] / default.filter
index d9fcb38..ce4a3f4 100644 (file)
@@ -2,7 +2,7 @@
 # 
 #  File        :  $Source: /cvsroot/ijbswa/current/default.filter,v $
 # 
-#  $Id: default.filter,v 1.12 2002/09/05 14:55:38 oes Exp $
+#  $Id: default.filter,v 1.16 2002/11/11 13:40:38 oes Exp $
 #
 #  Purpose     :  Rules to process the content of web pages
 # 
@@ -82,7 +82,7 @@ s|document\.referrer|"Not Your Business!"|gisU
 
 # The status bar is for displaying link targets, not pointless blahblah
 #
-s/([\n =;{}]|window\.)(default)?status\s*=/$1dUmMy=/ig
+s/(([\n =;{}]|window\.)(default)?status)\s*=\s*((['"]).*?\5)/if(typeof(this.href) != 'undefined') $1 = $4 + ' URL: ' + this.href;else return false/ig
 
 # Kill OnUnload popups. Yummy.
 # Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
@@ -190,8 +190,7 @@ FILTER: refresh-tags Kill automatic refresh tags (for dial-on-demand setups)
 # Note: Only deactivates refreshes with more than 9 seconds delay to
 #       preserve monster-stupid but common redirections via meta tags.
 #
-s/<meta\s+http-equiv\s*=\s*(['"]?)refresh\1\s+content\s*=\s*(['"]?)\d{2,}\s*(;\s*url\s*=\s*([^>\2]*))?\2\s*>/<link rev="x-refresh" href="$4">/iU
-
+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
 
 #################################################################################
 #
@@ -205,8 +204,8 @@ FILTER: img-reorder Reorder attributes in <img> tags to make the banners-by-* fi
 # This makes banners-by-size more effective and allows both banners-by-size
 # and banners-by-link to preserve the original image URL in the alt attribute.
 
-s|<img\s+?([^>]*)src\s*=\s*(['"])([^>\\\2]+)\2|<img src=$2$3$2$1|siUg
-s|<img\s+?([^>]*)src\s*=\s*([^'">\\\s]+)|<img src=$2$1|sig
+s|<img\s+?([^>]*) src\s*=\s*(['"])([^>\\\2]+)\2|<img src=$2$3$2 $1|siUg
+s|<img\s+?([^>]*) src\s*=\s*([^'">\\\s]+)|<img src=$2 $1|sig
 
 s|<img (src=(?:(['"])[^>\\\\2]+\2\|[^'">\\\s]+?))([^>]*)width\s*=\s*(["']?)(\d+?)|<img $1 width=$4$5$4$3|siUg
 
@@ -356,10 +355,58 @@ s%^.*(?<!middle)(?<!sus)(?<!es)sex.*$%<html><head><title>Blocked</title></head><
 s+^.*warez.*$+<html><head><title>No Warez</title></head><body><h3>You're not searching for illegal stuff, are you?</h3></body></html>+is
 
 
+#################################################################################
+#
+# demoronizer: Correct Microsoft's abuse of standardized character sets, which 
+#              leave the browser to (mis)-interpret unknown characters, with 
+#              sometimes bizarre results on non-MS platforms.
+#
+# credit: ripped from the demoroniser.pl script by: 
+#         John Walker -- January 1998, http://www.fourmilab.ch/webtools/demoroniser
+#
+#################################################################################
+FILTER: demoronizer fixing MS's non-standard use of std charsets.
+
+s/(&\#[0-2]\d\d)\s/$1; /g
+# per Robert Lynch: http://slate.msn.com//?id=2067547, just a guess.
+# Must come before x94 below.
+s/\xE2\x80\x94/ -- /g
+s/\x82/,/g
+#s-\x83-<em>f</em>-g
+s/\x84/,,/g
+s/\x85/.../g
+#s/\x88/^/g
+#s-\x89- °/°°-g
+s/\x8B/</g
+s/\x8C/Oe/g
+s/\x91/`/g
+s/\x92/'/g
+s/(\x93|\x94)/"/g
+# Bullet type character.
+s/\x95/&middot;/g
+s/\x96/-/g
+s/\x97/--/g
+#s-\x98-<sup>~</sup>-g
+#s-\x99-<sup>TM</sup>-g
+# per Robert Lynch.
+s/\x9B/>/g                  # 155
+
 ############################################################################## 
 #
 #  Revisions   :
 #     $Log: default.filter,v $
+#     Revision 1.16  2002/11/11 13:40:38  oes
+#     Make refresh-tags filter work even on incorrect refresh tags like found on usatoday.com
+#
+#     Revision 1.15  2002/11/08 16:40:56  oes
+#     Made img-reorder more cautious. Fixes bug #632715
+#
+#     Revision 1.14  2002/10/13 21:58:20  hal9
+#     Add demoronizer filter to sync with 3.0.1.
+#
+#     Revision 1.13  2002/09/11 16:04:20  oes
+#     Preserve original quoting style in <img> tags wherever possible. Fixes Bug #605956
+#
 #     Revision 1.12  2002/09/05 14:55:38  oes
 #     Synced with the stable branch:
 #         Revision 1.11.2.6  2002/08/23 14:12:26  oes