To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.publishOpen lugnet.publish in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Publishing / 481
480  |  482
Subject: 
Re: possible to break out of someone's frame?
Newsgroups: 
lugnet.publish
Date: 
Fri, 21 May 1999 18:46:42 GMT
Viewed: 
580 times
  
In lugnet.publish, cjc@NOSPAMnewsguy.com (Mike Stanley) writes:
Ok, I have a problem.

I want to be able to break out of someone's frame when they link to my
page, rather than have my page show up inside their box.

Is that possible to do on my end, or am I going to have to find a way
to force them to change their link?

Mike,
It's possible to kludge up a frames-detector-and-breaker via client-side
JavaScript embedded in your HTML pages.  It won't protect you from frames-
abuse 100% of the time, but I suppose that most visitors running a browser
that supports frames these days will also be running a browser that supports
JS (so long as they haven't disabled it), so at least you're partially
protected.

Here's one thing you can embed in the <HEAD></HEAD> portion of your pages:

   <SCRIPT LANGUAGE="JavaScript"><!--
   if (top.location != self.location) top.location =
   "http://foo.foo/some.other.page.on.your.site";
   //-->
   </SCRIPT>

That would be if you wanted to display, say, an error page to the user -- or
some other info page -- if the linker linked you into a sub-frame.  OTOH, if
you wanted instead to simply to reload the target page at the top level
silently, you could do this:

   <SCRIPT LANGUAGE="JavaScript"><!--
   if (top.location != self.location) top.location = self.location;
   //-->
   </SCRIPT>

But IIRC, last fall when I did that on a couple pages, several people
reported that it caused MSIE to go into an infinite reload loop.  :-(

--Todd

p.s.  Disclaimer:  I'm not a JS expert, so neither of these is probably the
most preferred or robust solution.



Message has 1 Reply:
  Re: possible to break out of someone's frame?
 
(...) Thanks! This worked fine with IE5. I will test it with IE4 after next week. On vacation next week. :) (26 years ago, 23-May-99, to lugnet.publish)

Message is in Reply To:
  possible to break out of someone's frame?
 
Ok, I have a problem. I want to be able to break out of someone's frame when they link to my page, rather than have my page show up inside their box. Is that possible to do on my end, or am I going to have to find a way to force them to change (...) (26 years ago, 21-May-99, to lugnet.publish)

7 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR