unframe bust

B

Bob Feather

I am designing a frameset that will display other web site's pages in one of
my frames, and I have encountered the following code in a few web pages.

<script language="Javascript">
if (top.location != self.location)
{
top.location = self.location.href
}
</script>

This code reloads top.location with the other websites url and wipes out my
entire frameset. Is there anyway to prevent this script in the other web
site's html from NOT wiping out my frameset in both Netscape & IE browsers?

Thanks.
 
L

Lasse Reichstein Nielsen

Bob Feather said:
I am designing a frameset that will display other web site's pages in one of
my frames,

Do you have the permission of the author of the other page? If you
make your page public, you could easily be charged with copyright
infringment for creating a derivative work.
and I have encountered the following code in a few web pages.

<script language="Javascript">
if (top.location != self.location)
{
top.location = self.location.href
}
</script>

Obviously people who don't want their page framed. I guess you'll have
to live with that. There is no way to avoid this in a general browser.

For Netscape or Mozilla, you could probably trigger on the reading of
top.location (which is in your page) and cause an error that stops
execution before the assignment. I don't think IE has anything similar
to that.

/L
 
K

kaeli

This code reloads top.location with the other websites url and wipes out my
entire frameset. Is there anyway to prevent this script in the other web
site's html from NOT wiping out my frameset in both Netscape & IE browsers?


No. We put that there so people like you can't frame our sites when we
don't want you to.

--
 
M

Matt Kruse

kaeli said:
No. We put that there so people like you can't frame our sites when we
don't want you to.

Which is pretty idiotic and annoying, IMO.
My personal home page for my browser is a local file that contains a number
of frames of sites which I visit often.

If a site kicks me out of my frameset (which is obnoxious behavior, imo)
then I try not to use that site anymore. Or to put that site into my
restricted zone, so no javascript will run (which sometimes makes the site
break anyway!)

To me, it's on the same level as trying to popup a new full-screen window.
Don't do it. Let the user access your site in the way which is most
convenient to them.
 
M

Matt Kruse

Lasse said:
Do you have the permission of the author of the other page? If you
make your page public, you could easily be charged with copyright
infringment for creating a derivative work.

Is there a precedent for this?
Obviously people who don't want their page framed. I guess you'll have
to live with that. There is no way to avoid this in a general browser.

Other than turning off javascript for the domain which you want to stay
framed.
 
K

kaeli

Which is pretty idiotic and annoying, IMO.

It's also irritating (and possibly illegal) to have my business site
framed in someone else's business site as though it's their content.
Sorry.
No one's coding for you to take their stuff and let it work outside its
normal context. Any already framed site could easily break when they try
to reference top.frames, too.
My personal home page for my browser is a local file that contains a number
of frames of sites which I visit often.

We care about non-personal use. Sorry, I can't make code that checks if
it's on your desktop or someone else's site stealing my stuff.

Do you try to play Playstation games on an Xbox, too?

--
 
M

Matt Kruse

kaeli said:
It's also irritating (and possibly illegal) to have my business site
framed in someone else's business site as though it's their content.

Legal problems should be solved in a legal way.
No one's coding for you to take their stuff and let it work outside
its normal context. Any already framed site could easily break when
they try to reference top.frames, too.

But in most cases, referencing top.anything is not good. Relative references
are always preferred when possible.
IMO, a page should only care about itself and its parent. No further. So
"top" is rarely necessary.
Do you try to play Playstation games on an Xbox, too?

heh, who has time for games? :)
 
C

Csaba Gabor

Matt Kruse said:
Is there a precedent for this?

All I can think of right now is hotmail. If you see a link in hotmail,
Microsoft is tracking you when you click on it (you haven't left
hotmail - look at the url you get). And anywhere you go to from
there is within their frame.

Csaba Gabor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top