Page 1 of 1

stop frame breaking codes

Posted: Mon Jul 18, 2005 6:09 pm
by illmapu
Hi,

Does anyone know if there is a way to identify/disable codes that break frames?

Thanks in advance!
:)

Posted: Tue Jul 19, 2005 1:30 am
by Roja
You can't. Here's an example:

Code: Select all

<script type="text/javascript" defer="defer">
    if(self != top) top.location = location;
</script>
Without disabling javascript, I don't believe it is possible to prevent it.

Here is a better question: For the content are you trying to put into an iframe, that explicitly wants to pop out of frames, what right do you have to do so?

Posted: Tue Jul 19, 2005 4:41 am
by Chris Corbyn
You *can* if you interfere with the code by importing it using PHP BUT BUT BUT... you really DO have to have permission and my guess is that since they have this set up, they will not give you permission. There's two reasons developers do this:

1. Stop people from stripping their content into their site.
2. Ensure the site is viewed the way they intended it to be viewed.

Link out to the site - don't force it to be somewhere it shouldn't be ;)

Posted: Tue Jul 19, 2005 6:49 am
by Roja
d11wtq wrote:You *can* if you interfere with the code by importing it using PHP
Ah. I didn't think about it that way. Yes, you could scrape the site, and remove the script tag contents, and then display that code. Of course, the arguments about copyright, your rights to do so, and so on are all extremely important then.

Posted: Tue Jul 19, 2005 3:54 pm
by illmapu
Hi,

Thanks to all for your replies. The reason I asked this question is because I own a website that auto-rotates member sites inside of frames to help them advertise their website to other members. (TE) The problem is when a site breaks frames, it stops the rotation of sites. This is normally done intentionally so that their website stops the rotation in hopes they get more advertising since the rotator stops at them and doesn't proceed onto the next member website.

As a business owner, if there was a way to somehow stop the site from breaking frames or have an auto check of all urls in my db at any time, it would benefit all members of my website.

The right I have is that when you join my website, according to my TOS when a member submits a website, framebreaking websites are not allowed to be submitted, period.

To be clear, I do not want to do anything to anyone elses code or website, I simply want to try to make it so my website can somehow identify these sites, even after they have been submitted by doing a test on them at any time without having to manually view hundreds of sites all of the time.

I already manually perform a check of all websites added prior to allowing them into rotation, but after the site is in rotation, I cannot stop someone from then adding the framebreaking code anyways.

I was thinking maybe there was a way I could perfom an auto-check of the urls through my admin area, but I'm not sure how I could do that?

Any masters out there that can help this little grasshopper?

Thanks in advance again!
:)

Posted: Tue May 08, 2007 8:30 am
by big_mumma
IE solution:

Code: Select all

<iframe src=" somepage.html" security=restricted></iframe>
from: http://crypto.stanford.edu/framebust/

Mozilla solution:

Code: Select all

<html>
<body>
<script>
function test(e) {
    window.setTimeout ("stop();", 1);
}

window.onbeforeunload = test;

</script>
<iframe src="http://hackthissite.org/" />
</body>
</html>
from: http://kuza55.blogspot.com/2007/03/part ... g-out.html

Posted: Tue May 08, 2007 8:32 am
by feyd
Long dead thread... locked.