From: oes Date: Sat, 16 Mar 2002 20:30:49 +0000 (+0000) Subject: - Added descriptions to the filters so users will know what they select in the cgi... X-Git-Tag: v_2_9_12~31 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=dc24600efa30171a73a2c094733ab8909b53c026 - Added descriptions to the filters so users will know what they select in the cgi editor - Added content-cookies filter - Bugfixed many jobs (Thanks to Al for some hints) --- diff --git a/re_filterfile b/re_filterfile index 83480545..4a2486c7 100644 --- a/re_filterfile +++ b/re_filterfile @@ -27,6 +27,9 @@ # # Revisions : # $Log: re_filterfile,v $ +# Revision 1.22 2002/03/12 13:42:50 oes +# Fixing & Optimizing REs +# # Revision 1.21 2002/03/12 11:59:20 oes # Beefed up Buzzword Bingo # @@ -89,10 +92,11 @@ # ################################################################################# # -# Filters start with a line "FILTER: name". They are then referrable +# Filters start with a line "FILTER: name description". They are then referrable # from the actionsfile with +filter{name} # -# Inside the filters, write one Perl-Style substitution per line. +# Inside the filters, write one Perl-Style substitution (job) per line. +# Jobs that precede the first FILTER: line are ignored. # # For Details see the pcrs manpage contained in this distribution. # (and the perlre, perlop and pcre manpages) @@ -116,16 +120,16 @@ # html-annoyances: Get rid of particularly annoying HTML abuse # ################################################################################# -FILTER: html-annoyances +FILTER: html-annoyances Get rid of particularly annoying HTML abuse # New browser windows (if allowed -- see no-popups filter below) should be # resizeable and have a location and status bar # -s/(]+)resizable="?(no|0)"?(.*>)/$1resizable=1$3/igU -s/(]+)location="?(no|0)"?(.*>)/$1location=1$3/igU -s/(]+)status="?(no|0)"?(.*>)/$1status=1$3/igU -s/(]+)scrolling="?(no|0|auto)"?(.*>)/$1scrolling=no$3/igU -s/(]+)menubar="?(no|0)"?(.*>)/$1menubar=1$3/igU +s/(]+)resizable=['"]?(no|0|false)['"]?(.*>)/$1resizable=1$3/igU +s/(]+)location=['"]?(no|0)['"]?(.*>)/$1location=1$3/igU +s/(]+)status=['"]?(no|0)['"]?(.*>)/$1status=1$3/igU +s/(]+)scrolling=['"]?(no|0|auto)['"]?(.*>)/$1scrolling=no$3/igU +s/(]+)menubar=['"]?(no|0)['"]?(.*>)/$1menubar=1$3/igU # The tag was a crime! # @@ -136,16 +140,13 @@ s*|**ig #s/margin(height|width)=[0-9]*//gi #s/noresize/yesresize/igU + ################################################################################# # # js-annoyances: Get rid of particularly annoying JavaScript abuse # ################################################################################# -FILTER: js-annoyances - -# JS cookies, like found on privacy.net: -# -s|(document\.cookie)([ \t\r\n]*=)|documenZapCooky$2|g +FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse # Get rid of Javascript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm # @@ -160,12 +161,28 @@ s/status='.*?';*//ig s/()/$1never$2/iU +################################################################################# +# +# content-cookies: Kill cookies that come in the HTML or JS content +# +################################################################################# +FILTER: content-cookies Kill cookies that come in the HTML or JS content + +# JS cookies, like found on privacy.net: +# +s|(document\.cookie)([ \t\r\n]*=)|documenZapCooky$2|g + +# HTML cookies: +# +s|].*>||iUT + + ################################################################################## # # no-popups: Kill all popups in JS and HTML # ################################################################################# -FILTER: no-popups +FILTER: no-popups Kill all popups in JS and HTML s/window\.open\(/1;''\.concat\(/ig # JavaScript s/target=['"]?_blank['"]?/target_crunched/ig # HTML @@ -176,34 +193,32 @@ s/target=['"]?_new['"]?/target_crunched/ig # HTML # frameset-borders: Give frames a border and make them resizable # ################################################################################# -FILTER: frameset-borders - -s/(]+)framespacing=['"]?(no|0['"]?(.*>)/$1$3/igU -s/(]+)border=['"]?(no|0)['"]?(.*>)/$1$3/igU -s/(]+)frameborder=['"]?(no|0)['"]?(.*>)/$1$3/igU +FILTER: frameset-borders Give frames a border and make them resizable +s/(]+)framespacing=['"]?(no|0)['"]?(.*>)/$1$3/igU +s/(]+)frameborder=['"]?(no|0)['"]?(.*>)/$1$3/igU +s/(]+)border=['"]?(no|0)['"]?(.*>)/$1$3/igU +s/(]+)resizable=['"]?(no|0|false)['"]?(.*>)/$1$3/igU ################################################################################# # # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking) # ################################################################################# -FILTER: webbugs +FILTER: webbugs Squish WebBugs (1x1 invisible GIFs used for user tracking) s/]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1(\D[^>]*?)?>//sig ################################################################################# # -# no-refresh: Automatic refresh sucks on auto-dialup lines +# no-refresh: Kill automatic refresh tags (for dial-on-demand setups) # ################################################################################# -FILTER: no-refresh +FILTER: no-refresh Kill automatic refresh tags (for dial-on-demand setups) -# FIXME: second line like first line for content value -# -s/]*http-equiv[^>]*refresh.*([0-9]+[0-9]|"[2-9]);URL=([^>]*?)"?>//i -s/]*http-equiv="?page-enter"?[^>]*content=[^>]*>//i +s/]*)['"]?>//iU +s/].*>//iU ################################################################################# @@ -211,7 +226,7 @@ s/]*http-equiv="?page-enter"?[^>]*content=[^>]*>/