I’m loading an external page into an IFRAME, which contains an advertisment that I don’t want to let load.
Is there a way I can set a URL/domain blacklist for any content inside an IFRAME?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming you’re developing on the server-side, some kind of Web app.
What I’d reach for in this situation is something like
Perl::HTTP::Proxy.Instead of pointing your IFRAME directly at the external site, point it to a
proxyprocess (page, servlet, PHP script, doesn’t matter) on your own site. This code fetches the content of the URL given to it and filters out the offending ad code before serving the modified response.I can’t comment on the legality or ethics of doing this; depending on the situation, someone might not be happy that you’re serving their content but not showing the ads they’re getting money for.