How to block pop-up coming from iframe?

前端 未结 7 2193
独厮守ぢ
独厮守ぢ 2020-11-29 09:34

I\'m embedding page that has an exit pop-up. When you close the page, it automatically launches a pop-up window.

How to disable pop-ups coming from the ifram

7条回答
  •  佛祖请我去吃肉
    2020-11-29 10:02

    If you are wanting to block something like POP up ads or something coming from a website you are showing in an IFRAME - it's fairly easy.

    Make a framefilter.php and javascriptfilter.php which your iframe points to. You can modify it to meet your needs such as the onload blah blah and etc. But as/is - it's been working fine for me for quite a while. Hope it helps.

    Replace your standard IFRAME HTML with this:

        
    

    Framefilter.php

            ";
    $replacestring="";
    $raw=str_replace($replacethis,$replacestring,$raw);
    
    //Echo the website html to the iframe.
    echo $raw;
    
    ?>
    

    javascriptfilter.php

    
    

提交回复
热议问题