Hello, I am currently running a few offers inside a frame or an iframe, and while some of the offers are just fine, there are others that have pop up windows. This is very disturbing to not only myself, but interrupts the flow of my visitors. Is there any way (Javascript or otherwise) to block the pop up windows that the source of a Frame Win or an iFrame Win creates? Much appreciation, thanks.
Rj2Kix, I am dealing with this same problem. Did you ever happen to come across a solution? Thanks! Jared B.
Make a framefilter.php and javascriptfilter.php which your iframe points to. HTML <IFRAME SRC="http://www.myiframedomain.com/framefilter.php?furl=http://www.domainname.com" WIDTH=1000 HEIGHT=500> If you can see this, your browser doesn't understand IFRAME. However, we'll still <A HREF="http://www.domainname.com">link</A> you to the page. </IFRAME> ------------------------------------------------------------------- framefilter.php <?php //Get the raw html. $furl=trim($_GET["furl"]); $raw = file_get_contents($furl); $mydomain="http://www.myiframedomain.com/"; //Kill anoying popups. $raw=str_replace("alert(","isNull(",$raw); $raw=str_replace("window.open","isNull",$raw); $raw=str_replace("prompt(","isNull(",$raw); $raw=str_replace("Confirm: (","isNull(",$raw); //Modify the javascript links so they go though a filter. $raw=str_replace("script type=\"text/javascript\" src=\"","script type=\"text/javascript\" src=\"".$mydomain."javascriptfilter.php?jurl=",$raw); $raw=str_replace("script src=","script src=".$mydomain."javascriptfilter.php?jurl=",$raw); //Or kill js files //$raw=str_replace(".js",".off",$raw); //Put in a base domain tag so images, flash and css are certain to work. $replacethis="<head>"; $replacestring="<head><base href='".$furl."/'>"; $raw=str_replace($replacethis,$replacestring,$raw); //Echo the website html to the iframe. echo $raw; ?> --------------------------------------------------------------------------- javascriptfilter.php <?php //Get the raw html. $jurl=trim($_GET["jurl"]); $raw = file_get_contents($jurl); //Note, if trickyness like decode detected then display empty. if(!preg_match("decode(", $raw)){ //Kill anoying popups. $raw=str_replace("alert(","isNull(",$raw); $raw=str_replace("window.open","isNull",$raw); $raw=str_replace("prompt(","isNull(",$raw); $raw=str_replace("Confirm: (","isNull(",$raw); //Echo the website html to the iframe. echo $raw; } ?>
just got the same issue - but with javascript ads code - seems like these guys (I mean "Download" buttons in banner) buying cheap ads traff - then running popunders via own viral to banner network script = profit))) (ad networks do not delete such scam from their rotation as there seems should be profit too) so anyone know how to kill these from site? not iframe but javascript?