Is there any way to grab any information from the top from within an iframe on a separate domain? Somebody has tasked me with validating that their advertising is not next to things like pornography, etc... but their ads are always inside an iframe on publisher sites.
Interestingly, when I put twitter.com in an iframe, they have iframe busting technology turned on - like so:
<script type="text/javascript">
//<![CDATA[
if (window.top !== window.self) { setTimeout(function(){document.body.innerHTML='';},1);window.self.onload=function(evt){document.body.innerHTML='';};}
//]]>
</script>
What strikes me is that, as a different domain, they still have the ability to get window.top. However, when I try to extend this functionality to window.top.location or window.top.href to get the URL of the top window, I get
uncaught exception: [Exception... "Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIDOMNSHTMLDocument.write]" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: http://tester.tester.com/iframe3.html :: <TOP_LEVEL> :: line 9" data: no]
http://tester.tester.com/iframe3.html
Line 9
which is really just a permission error that is being misreported by Gecko (I think).
Any thoughts on this? Is an equality statement available because the iframe doesn't actually get the data while getting the data itself is not available?
Any information I can get would be better than nothing, so please feel free to put in partial answers. Thanks.