I am trying to help a friend of mine break his site out of some nasty frames: example. This wouldn't normally be an issue but this particular site crosses some ethical boundaries by placing an advertisement on the top of the page that is NOT paying my friend.
Here is where it gets complicated, he would like his site to be in frames for certain sites like netvibes.
So, I tried something like this:
<!-- start break from getweb.info -->
<script type="text/javascript">
purl = parent.location.href;
//alert(purl);
if(purl.indexOf('getweb') > 0 && top.frames.length!=0)
{
top.location=self.document.location;
}
</script>
<!-- end break from getweb.info -->
However, because it needs to be a conditional break, this isn't working because firefox.(assuming others have the same error also, untested yet) gives an error stating that the site in the frame is not permitted to get the location.href property of the parent frame.
Is there a way for javascript to break out of a frame based on the parent frame's location?