2 # This perl script provides filtering for undesireable garbage in HTML files
3 # It is intended to be used as an external parser for MiddleMan
12 # Note: alot of sites won't load with these enabled
13 # $PAGE =~ s/window\.open\s*\(/concat(/ig;
14 # $PAGE =~ s/([ =;])open\s*\(/$1concat(/ig;
15 # $PAGE =~ s/target=['"]?(_blank|_new)['"]?/notarget/ig;
18 $PAGE =~ s/<meta\s+http-equiv=['"]?set-cookie['"]?\s+content=[^>].*>//ig;
20 # Don't let sites change status bar
21 $PAGE =~ s/window\.status\s*=/uselessness =/ig;
23 # Make sure popup's are resizeable and have scroll bar's
24 $PAGE =~ s/(<a\s+href[^>]+)resizable=['"]?(no|0|false)['"]?(.*>)/$1resizable="1"$3/ig;
25 $PAGE =~ s/(<a\s+href[^>]+)location=['"]?(no|0)['"]?(.*>)/$1location="1"$3/ig;
26 $PAGE =~ s/(<a\s+href[^>]+)status=['"]?(no|0)['"]?(.*>)/$1status="1"$3/ig;
27 $PAGE =~ s/(<a\s+href[^>]+)scrolling=['"]?(no|0|auto)['"]?(.*>)/$1scrolling="no"$3/ig;
28 $PAGE =~ s/(<a\s+href[^>]+)menubar=['"]?(no|0)['"]?(.*>)/$1menubar="1"$3/ig;