By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

unframe bust

P: n/a
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.
Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Bob Feather" <bo*********@verizon.net> writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2

P: n/a
In article <_T*******************@nwrddc02.gnilink.net>,
bo*********@verizon.net enlightened us with...

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.

--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

P: n/a
Lasse Reichstein Nielsen wrote:
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.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #4

P: n/a
kaeli wrote:
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.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #5

P: n/a
In article <c7*********@news1.newsguy.com>, ne********@mattkruse.com
enlightened us with...
kaeli wrote:
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.


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?

--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6

P: n/a
kaeli wrote:
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? :)

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #7

P: n/a
"Matt Kruse" <ne********@mattkruse.com> wrote in message
news:c7*********@news1.newsguy.com...
Lasse Reichstein Nielsen wrote:
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?


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
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.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/

Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.