I have a website that has iframes in it, the iframe goes to a website but the website has pop-up and that is pretty annoying is there any script or something else that can block the pop-ups.
the only way to do this is to get the actual contents of the iframe with curl for example and output those instead of the live page and then strip off the javascript. The problem here however is the fact that you are not iframing the actual page.
the only way to do this is to get the actual contents of the iframe with curl for example and output those instead of the live page and then strip off the javascript. The problem here however is the fact that you are not iframing the actual page.
Exactly! iframes are really just a call to the browser saying "hey, get this webpage and display it here." If you wanted to do what you mentioned, you would need to write code on your end to grab the page and then display it to the user (like loki said).
The reason you can't do this is because most browsers have controls to separate the DOM coming from an iframe to prevent cross site scripting (XSS). Think about it this way: if the inner frame could be controlled by the outer frame, the opposite would also be possible. And if the outer frame can be controlled from the inner frame (using JS or something) the owner of the iframe site could include malicious code that could steal cookies from the outer frame - as an example.
If you explain to us why exactly you're trying to put another site in an iframe, we might be able to help by providing an alternate solution to your problem.
And before anyone else says it: use a modern browser Most modern browsers are able to block popups. I think adblockplus works on just about every major browser available...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.