0
votes

We've partenered with another website and want to display their website in an iframe on our website.

They want to implement frame busting javascript on their site so that if anyone other than us tries to frame their site then their site will bust out of the frame.

Right now, they're using code like this:

<style> 
html{display : none ; } 
</style> 
<script> 
if( self == top ) 
{ document.documentElement.style.display = 'block' ; }
else 
{ top.location = self.location ; } 
</script> 

How can they ensure that when our site is the container frame, that the frame-busting does not occur?

Thanks for any help!

Peter

1

1 Answers

0
votes

They could check the value of top.location in that "else" clause, and if it contains your domain name, they could skip busting out. It's not like it's secure or anything, but it's doubtful anyone would be interested in fooling it.