burnsj2
asked on
Prevent Iframe Redirect of Parent
Some users are stealing our traffic by putting the following in an iframe, taking over the parent and then meta redirecting to another website:
<script>
if (parent.frames.length > 0) {
parent.location.href = self.document.location
}
</script>
How can we prevent this without banning iframes?
Thanks,
<script>
if (parent.frames.length > 0) {
parent.location.href = self.document.location
}
</script>
How can we prevent this without banning iframes?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK. well unfortunately for you, other than contacting them and requesting to stop that practice (or else no more free space for them on your site), you cannot stop that since the content of the iframe is from an external domain.
ASKER
There is one thing that works in IE only:
<iframe src="http://www.Somewhere.com/SomePage.html" security="restricted"></if rame>
security="restricted" prevents framebusting. Too bad it doesn't work in FF etc.
<iframe src="http://www.Somewhere.com/SomePage.html" security="restricted"></if
security="restricted" prevents framebusting. Too bad it doesn't work in FF etc.
ASKER
I don't want to control the page on their differenet domain but rather prevent them from controlling our page.