Re: Proposal: Detecting when the user leaves a page due to hitting the back button or typing in a URL or going to a favorite

Giovanni Campagna wrote:
> Probably treating the onbeforeunload as a real cancelable event

But the key is that the page must not be able to prevent navigation away 
from itself without explicit OK by the user.  In other words, while the 
UA needs to be able to cancel the unload, the page has no need to.  That 
ability already exists with onbeforeunload.

> One may attach a onbeforeunload to a frame, and would like to know if 
> only its javascript context is going to
> disappear, instead of the whole tab being destroyed, so it can send 
> messages to parent window and have them read and handled

There's no difference from navigating the subframe or removing the 
subframe from the parent DOM in terms of the script context going away, 
yet they'd be treated differently in Andrew's proposal.

Seems to me like the subframe should just send the messages in this 
situation.

-Boris

Received on Monday, 5 January 2009 16:28:04 UTC