Reference action files in CGI URLs by id instead
[privoxy.git] / default.filter
index 36e28ff..4a2857a 100644 (file)
@@ -2,7 +2,7 @@
 # 
 #  File        :  $Source: /cvsroot/ijbswa/current/default.filter,v $
 # 
-#  $Id: default.filter,v 1.35 2006/12/21 12:28:12 fabiankeil Exp $
+#  $Id: default.filter,v 1.39 2007/02/21 14:10:23 fabiankeil Exp $
 #
 #  Purpose     :  Rules to process the content of web pages
 # 
@@ -81,8 +81,10 @@ FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
 s|(?:\w+\.)+referrer|"Not Your Business!"|gisU
 
 # The status bar is for displaying link targets, not pointless blahblah
-# 
-s/(\W\s*)((this|window)\.(default)?status)\s*=\s*((['"]).*?(?<!\\)\6)/$1if(typeof(this.href) != 'undefined') $2 = $5 + ' URL: ' + this.href;else return false/ig
+#
+s@([\W]\s*)((?:this|window)\.(?:default)?status)\s*=\s*((['"]).*?\4)@$1$2 =\
+ (typeof(this.href) != 'undefined')?($3 + ' URL: ' + this.href):($2)@ig
+
 s/(?:(?:this|window)\.(?:default)?status)\s*=\s*\w*\s*;//ig
 
 # Kill OnUnload popups. Yummy.
@@ -179,7 +181,7 @@ s/<meta\s+http-equiv\s*=\s*(['"]?)refresh\1\s+content\s*=\s*(['"]?)\d{2,}\s*(;\s
 FILTER: unsolicited-popups Disable only unsolicited pop-up windows
 
 s+([^'"]\s*<head.*>)(?=\s*[^'"])+$1<script>function PrivoxyWindowOpen(){return(null);}</script>+isU
-s+([^\w\s.]\s*)((window|this|parent)\.)?open\s*\(+$1PrivoxyWindowOpen(+ig
+s@([^\w\s.]\s*)((?:map)?(window|this|parent)\.?)?open\s*\(@$1PrivoxyWindowOpen(@ig
 s+([^'"]\s*</html>)(?!\s*(\\n|'|"))+$1<script>function PrivoxyWindowOpen(a, b, c){return(window.open(a, b, c));}</script>+iU     
 
 
@@ -190,7 +192,7 @@ s+([^'"]\s*</html>)(?!\s*(\\n|'|"))+$1<script>function PrivoxyWindowOpen(a, b, c
 #################################################################################
 FILTER: all-popups Kill all popups in JavaScript and HTML
 
-s/((\W\s*)(window|this|parent)\.)open\s*\\?\(/$1concat(/ig  # JavaScript
+s@((\W\s*)(?:map)?(window|this|parent)\.?)open\s*\\?\(@$1concat(@ig  # JavaScript
 s/\starget\s*=\s*(['"]?)_?(blank|new)\1?/ notarget/ig        # HTML
 
 
@@ -424,18 +426,47 @@ s/(M|m)edien(?![^<]*>)/$1&auml;dchen/Ug
 
 #################################################################################
 #
-# crude-parental: Crude parental filtering?  (Use along with a suitable blocklist).
-#                 Shows how to deny access to whole page based on a keyword.
+# crude-parental: Crude parental filtering. Use with a suitable blocklist.
+#                 Pages are "blocked" based on keyword matching.
 #
 #################################################################################
-FILTER: crude-parental Crude parental filtering (demo only)
+FILTER: crude-parental Crude parental filtering 
 
 # (Note: Middlesex, Sussex and Essex are counties in the UK, not rude words)
 # (Note #2: Is 'sex' a rude word?!)
 
 s%^.*(?<!middle)(?<!sus)(?<!es)sex.*$%<html><head><title>Blocked</title></head><body><h3>Blocked due to possible adult content. Please see <a href="http://dmoz.org/Kids_and_Teens/">this site</a>.</h3></body></html>%is
+
 s+^.*warez.*$+<html><head><title>No Warez</title></head><body><h3>You're not searching for illegal stuff, are you?</h3></body></html>+is
 
+# Remove by description
+s/^.*\
+(suck |lick |tounge |rub |fuck |fingering |finger |chicks? )?\
+(her |your |my |hard |with |big |wet |tight |pink |hot |moist |young |teen )+\
+(dicks?|penis|cocks?|balls?|tits?|pussy|cunt|clit|ass|mouth).*$\
+/This page has been blocked by Privoxy's crude-parental content filter\
+/is 
+
+#Remove by link text
+s/^.*\
+(download|broadband|view|watch|free|get|extreem)? \
+(sex|xxx|porn|cumshot|fuck(ing|s)?|anal|ass|asian|adult|Amateur|org(y|ies)|close ups?|hand ?      job|nail(ed)?)+ \
+(movies?|pics?|videos?|dvds?|dvd's|links?).*$\
+/This page has been blocked by Privoxy's crude-parental content filter\
+/is 
+
+#Remove by age disclaimer
+s/^.*\
+(models?|chicks?|girls?|women|persons) \
+(who|are|were)+ (over|at least) (16|18|21) years (old|of age).*$\
+/This page has been blocked by Privoxy's crude-parental content filter\
+/is 
+
+#Remove by regulations
+s/^.*(Section 2257|18 U.?S.?C.? 2257).*$\
+/This page has been blocked by Privoxy's crude-parental content filter\
+/is 
+
 
 #################################################################################
 #
@@ -607,36 +638,35 @@ s@(background:\#[a-f\d]{3})( url\(\"http://www.blogblog.com/rounders[^\"]*\"\).*
 
 #################################################################################
 #
-# x-httpd-php-to-html: Header filter to change the Content-Type from
+# x-httpd-php-to-html: Changes the Content-Type header from
 #                      x-httpd-php to html. "Content-Type: x-httpd-php"
 #                      is set by clueless PHP users and causes many
 #                      browsers do open a download menu instead of
 #                      rendering the page.
 #
 #################################################################################
-FILTER: x-httpd-php-to-html Header filter to change the Content-Type from x-httpd-php to html.
+SERVER-HEADER-FILTER: x-httpd-php-to-html Changes the Content-Type header from x-httpd-php to html.
 s@^(Content-Type:) application/x-httpd-php@$1 text/html@
 
 #################################################################################
 #
-# html-to-xml: Header filter to change the Content-Type from html to xml.
+# html-to-xml: Changes the Content-Type header from html to xml.
 #
 #################################################################################
-FILTER: html-to-xml Header filter to change the Content-Type from html to xml.
+SERVER-HEADER-FILTER: html-to-xml Changes the Content-Type header from html to xml.
 s@^(Content-Type:) text/html(;.*)?$@$1 application/xhtml+xml$2@
 
 #################################################################################
 #
-# xml-to-html: Header filter to change the Content-Type from xml to html.
+# xml-to-html: Changes the Content-Type header from xml to html.
 #
 #################################################################################
-FILTER: xml-to-html Header filter to change the Content-Type from xml to html.
+SERVER-HEADER-FILTER: xml-to-html Changes the Content-Type header from xml to html.
 s@^(Content-Type:) (?:application|text)/(?:xhtml\+)?xml(;.*)?$@$1 text/html$2@
 
 #################################################################################
 #
-# hide-tor-exit-notation: Header filter to remove the Tor exit node notation
-#                         in Host and Referer headers.
+# hide-tor-exit-notation: Remove the Tor exit node notation in Host and Referer headers.
 #
 #   Note: If Privoxy and Tor are chained and Privoxy is configured to
 #         use socks4a, one can use http://www.example.org.foobar.exit/
@@ -658,7 +688,7 @@ s@^(Content-Type:) (?:application|text)/(?:xhtml\+)?xml(;.*)?$@$1 text/html$2@
 #         coming from.
 #
 #################################################################################
-FILTER: hide-tor-exit-notation Header filter to remove the Tor exit node notation in Host and Referer headers.
+CLIENT-HEADER-FILTER: hide-tor-exit-notation Removes the Tor exit node notation in Host and Referer headers.
 s@^((?:Referer|Host):\s*(?:https?://)?[^/]*)\.[^\./]*?\.exit@$1@i
 
 
@@ -666,6 +696,23 @@ s@^((?:Referer|Host):\s*(?:https?://)?[^/]*)\.[^\./]*?\.exit@$1@i
 #
 #  Revisions   :
 #     $Log: default.filter,v $
+#     Revision 1.39  2007/02/21 14:10:23  fabiankeil
+#     - Fix a js-annoyances pcrs command that broke
+#       evaluated code. (BR #1124071, thanks to Bor Gergely)
+#     - Have unsolicited-popups and all-popups catch the
+#       wheather.com popup reported in in AF #1640173.
+#
+#     Revision 1.38  2007/02/19 11:22:48  hal9
+#     Adding back the orginal filter content to offset problems found by Fabian.
+#
+#     Revision 1.37  2007/02/17 13:29:44  hal9
+#     Updates to the crude parental filter per Feature Requests item #1648657.
+#
+#     Revision 1.36  2007/02/05 16:47:31  fabiankeil
+#     - Let banners-by-link look for "advert".
+#     - Fix XML systax problems with banners-by-link
+#       and banners-by-size (AF#1651570).
+#
 #     Revision 1.35  2006/12/21 12:28:12  fabiankeil
 #     Escaping special characters in filter descriptions is no
 #     longer necessary, it's done by Privoxy now.