[whatwg] Navigation events generated during unload

Adam Barth whatwg at adambarth.com
Mon Oct 5 17:58:26 PDT 2009

On Mon, Oct 5, 2009 at 6:01 PM, Ian Hickson <ian at hixie.ch> wrote:
> I tried poking around a bit, and I found that an unload event handler
> could call a parent frame and get it to set .src on another <iframe> to
> cause navigation, but it couldn't post a form to that frame itself.
> It's not clear to me what the difference is. I can kill the navigation
> algorithm altogether while an 'unload' (or 'beforeunload') is running, but
> that would kill the case above of setting 'src' (which seems harmless
> enough that it should be allowed). I don't really know what else to do
> though. There's a variety of ways to trigger navigation.

Setting the src of another frame seems fine.

> Any suggestions? What do browsers actually do, white-box wise?

We ended up just stopping all navigation events on the frame whose
unload handler is firing.  That seemed to be what other browsers did.

Sounds like we don't need to change the spec.


More information about the whatwg mailing list