From: Steve T. <ste...@su...> - 2002-12-13 05:52:59
|
Andreas Oesterhelt wrote: > ################################################################################# > # > # unsolicited-popups: Disable unsolicited pop-up windows (EXPERIMENTAL). > # > ################################################################################# > FILTER: unsolicited-popups Disable unsolicited pop-up windows > (EXPERIMENTAL). > > s+<body.*>+$0<script>function PrivoxyWindowOpen(){return(null);}</script>+isU > s+(\W\s*)(window|this|parent)?\.open\(+$1PrivoxyWindowOpen(+ig > s+</body>+<script>function PrivoxyWindowOpen(a, b, c){return(window.open(a, b, c));}</script>$0+iU One suggestion for the regexps -- change: s+(\W\s*)(window|this|parent)?\.open\(+$1PrivoxyWindowOpen(+ig to: s+\b(window|this|parent)?\.open\s*\(+PrivoxyWindowOpen(+ig The latter catches lines where window|this|parent is the first word in the line: window.open("http://slashdot.com"); window.open("http://slashdot.com"); as well as lines that have space between "open" and "(": window.open ("http://slashdot.com"); window.open ("http://slashdot.com"); var fred = window.open ("http://slashdot.com"); The "\b" also eliminates the need for the $1 backreference. Thanks, Steve |