header. cosmetics. default: no messing ala microsuck.
[privoxy.git] / re_filterfile
1 #  ********************************************************************
2
3 #  File        :  $Source: /cvsroot/ijbswa/current/junkbuster.init,v $
4
5 #  Purpose     :  Rules to process the content of web pages
6
7 #  Copyright   :  Written by and Copyright (C) 2001 the SourceForge
8 #                 IJBSWA team.  http://ijbswa.sourceforge.net
9
10 #                 Based on the Internet Junkbuster originally written
11 #                 by and Copyright (C) 1997 Anonymous Coders and
12 #                 Junkbusters Corporation.  http://www.junkbusters.com
13
14 #                 This program is free software; you can redistribute it
15 #                 and/or modify it under the terms of the GNU General
16 #                 Public License as published by the Free Software
17 #                 Foundation; either version 2 of the License, or (at
18 #                 your option) any later version.
19
20 #                 This program is distributed in the hope that it will
21 #                 be useful, but WITHOUT ANY WARRANTY; without even the
22 #                 implied warranty of MERCHANTABILITY or FITNESS FOR A
23 #                 PARTICULAR PURPOSE.  See the GNU General Public
24 #                 License for more details.
25
26 #                 The GNU General Public License should be included with
27 #                 this file.  If not, you can view it at
28 #                 http://www.gnu.org/copyleft/gpl.html
29 #                 or write to the Free Software Foundation, Inc., 59
30 #                 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31
32 #  Revisions   :
33 #     $Log: junkbuster.init,v $
34 #
35
36 # ********************************************************************/
37 #
38 # Syntax: One Perl-Style substitution per line.
39 # For Details see the perlre, perlop and pcre manpages.
40 # Note that you are free to choose the delimter as you see fit.
41 #
42 # Note: in addidion to the Perl-options egimosx, U is supported
43 # and turns the default to ungreedy matching. Add ? to quantifiers
44 # to switch back to greedy.
45 #
46
47 # ********************************************************************/
48 #
49 # Kill OnUnload popups. Yummy.
50 # check it out on http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
51 #
52 # ********************************************************************/
53 s/(<body .*?)onunload(.*?>)/$1never$2/i
54
55 # ********************************************************************/
56 #
57 # Kill refresh tags. I like to refresh myself. Manually.
58 # check it out on http://www.airport-cgn.de/ and go to the arrivals page.
59 #
60 # ********************************************************************/
61 s/<meta[^>]*http-equiv[^>]*refresh.*URL=([^>]*?)"?>/<link rev="x-refresh" href=$1>/i
62 s/<meta[^>]*http-equiv="?page-enter"?[^>]*content=[^>]*>/<!--no page enter for me-->/i
63
64 # ********************************************************************/
65 #
66 # If I allow popups, I want them to be resizeable and have a location
67 # and status bar: check it out on http://www.airport-cgn.de/ and go to
68 # the arrivals page.
69 #
70 # ********************************************************************/
71 # s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
72 # s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
73 # s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
74 # s/menubar="?(no|0)"?/menubar=1/ig #s/framespacing="?(no|0)"?//ig
75 # #s/margin(height|width)=[0-9]*//gi
76
77 # ********************************************************************/
78 #
79 # Remove frameborder=0 and border=0 from framesets
80 #
81 # ********************************************************************/
82 s/(<frameset[^>]+?)border=['"]?(no|0)['"]?/$1/ig
83 s/(<frameset[^>]+?)frameborder=['"]?(no|0)['"]?/$1/ig
84
85 # ********************************************************************/
86 #
87 # The status bar is for displaying link targets, not pointless buzzwords.
88 # Again, check it out on http://www.airport-cgn.de/
89 #
90 # ********************************************************************/
91 s/status='.*?';*//ig
92
93 # ********************************************************************/
94 #
95 # Kill *all* popups a la popup.c. (But for *all* sites, so I wouldn't do that.)
96 #
97 # JavaScript: s/window\.open\(/who_wants_this_to.open(/ig
98 # HTML      : s/target=['"]?_blank['"]?/target_who/g
99 #
100 # Kill banners by size:
101 # (Sizes from http://www.iab.net/iab_banner_standards/bannersizes.html)
102 #
103 # ********************************************************************/
104 s|<img\s+[^>]*?(width=['"]?468\D)[^>]*(height=['"]?60\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
105 s|<img\s+[^>]*?(width=['"]?234\D)[^>]*(height=['"]?60\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
106 s|<img\s+[^>]*?(width=['"]?88\D)[^>]*(height=['"]?31\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
107 s|<img\s+[^>]*?(width=['"]?120\D)[^>]*(height=['"]?90\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
108 s|<img\s+[^>]*?(width=['"]?120\D)[^>]*(height=['"]?60\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
109 s|<img\s+[^>]*?(width=['"]?160\D)[^>]*(height=['"]?600\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
110 s|<img\s+[^>]*?(width=['"]?120\D)[^>]*(height=['"]?600\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
111 s|<img\s+[^>]*?(width=['"]?125\D)[^>]*(height=['"]?125\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
112 s|<img\s+[^>]*?(width=['"]?120\D)[^>]*(height=['"]?240\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
113 s|<img\s+[^>]*?(width=['"]?180\D)[^>]*(height=['"]?150\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
114 s|<img\s+[^>]*?(width=['"]?300\D)[^>]*(height=['"]?250\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
115 s|<img\s+[^>]*?(width=['"]?250\D)[^>]*(height=['"]?250\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
116 s|<img\s+[^>]*?(width=['"]?240\D)[^>]*(height=['"]?400\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
117 s|<img\s+[^>]*?(width=['"]?336\D)[^>]*(height=['"]?280\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
118
119 s|<img\s+[^>]*?(width=['"]?200\D)[^>]*(height=['"]?50\D)[^>]*>|<img src=http://i.j.b/send-banner $1 $2>|sig
120
121 # ********************************************************************/
122 #
123 # Squish WebBugs:
124 #
125 # ********************************************************************/
126 s/<img\s+[^>]*?(width|height)\s+=\s+['"]?1\D[^>]*?(width|height)\s+=\s+['"]?1\D[^>]*>/<!-- Squished WebBug -->/sig
127
128 # ********************************************************************/
129 #
130 # Fun stuff
131 #
132 # ********************************************************************/
133 #s/microsoft(?!.com)/<b>MicroSuck<\/b>/ig
134
135 # ********************************************************************/
136 #
137 # Crude parental filtering?  (Use along with a suitable blocklist).
138 # Shows how to deny access to whole page based on a keyword.
139 #
140 # (Note: Middlesex, Sussex and Essex are counties in the UK, not rude words)
141 # (Note #2: Is 'sex' a rude word?!)
142 #
143 #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
144 #s+^.*warez.*$+<html><head><title>No Warez</title></head><body><h3>You're not searching for illegal stuff, are you?</h3></body></html>+is
145
146 # ********************************************************************/
147 #
148 # http://www.farscapezone.com/wwwboard/messages/1451.html
149 #
150 # ********************************************************************/
151 s/(\w+) was tired/<b>$1 needed more coffee<\/b>/ig