Closed Thread Icon

Topic awaiting preservation: Javascript for stoping break-out-of-frame scripts? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24029" title="Pages that link to Topic awaiting preservation: Javascript for stoping break-out-of-frame scripts? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Javascript for stoping break-out-of-frame scripts? <span class="small">(Page 1 of 1)</span>\

 
Rayquazza
Nervous Wreck (II) Inmate

From: Argentina
Insane since: Nov 2003

posted posted 11-14-2004 03:33

In a page such as:

code:
<frameset rows="*,85" >
<frame src ="mysitewarning.html" frameborder="0" noresize="noresize" marginwidth="0" marginheight="0" />
<frame src ="http://offsite/webpage.html" frameborder="0" noresize="noresize" marginwidth="0" marginheight="0" />

<noframes>
</noframes>
</frameset>



How can I prevent offsite/webpage.html from breaking out of the frames? Suppose offsite/webpage is:

code:
<html>
<head>
<script language="JavaScript" type="text/javascript">

function escape()
{

if (top.location != location) {
top.location.href = document.location.href;
}
}

</script>
</head>
<body onload="escape()">
Page content.
</body>
</html>



It's made to break out of frames, how can I stop it from doing so, by placing a script in the frameset page?
Thanks-

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 11-14-2004 04:18

For security reasons there's no way to alter an offsite page via JavaScript.
On the other hand, if you absolutely need your frameset, one solution may be to use a server-side script on your own server that will load the page http://offsite/webpage.html, search and disable the escape() function then output the altered HTML markup and voilà.

Rayquazza
Nervous Wreck (II) Inmate

From: Argentina
Insane since: Nov 2003

posted posted 11-14-2004 12:35

The frameset is an alert, of the kind of "You are leaving this website, the page below is not part of it blahblah" warning.
I'd gotten to the point where the first frame, onUnload, would close the window, but nothing else. Anything like this available? Like...onUnload, the frameset will change the value of the second frame?

« BackwardsOnwards »

Show Forum Drop Down Menu