Close Frameset

Close frameset from within a frame

If you use parent.close() to close the frameset you might get the error message:

The webpage you are viewing is trying to close the window.
Do you want to close this window?

This is a bug exploit

The following script will suppress this error message and close the frameset

In the frame closing the frameset.

<script type="text/javascript">
<!--
function close_all(){
parent.opener = top
parent.close()
}
// -- >
</script>

Use an event to call close_all()

Close frameset from a popup

In the popup page.

<script type="text/javascript">
<!--
function close_frameset(){
opener.parent.opener = top
opener.parent.close()
}

window.onerror=sh
function sh(){
return true
}

onload=close_frameset
// -- >
</script>

See Example Frameset