W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2012

Re: [whatwg] Navigation triggered from unload

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 12 Jun 2012 14:56:27 -0400
Message-ID: <4FD790DB.9020506@mit.edu>
To: whatwg@lists.whatwg.org
On 6/12/12 6:30 AM, James Graham wrote:
> Based on some tests ([1]-[5]), it seems that WebKit seems to cancel the
> navigation in the unload handler always, Opera seems to always carry out
> the navigation in the unload handler, and Gecko seems to follow WebKit
> in the cross-origin case and Opera in the same-origin case. In all cases
> the unload handler is only called once.
>
> [1] http://hoppipolla.co.uk/tests/navigation/003.html
> [2] http://hoppipolla.co.uk/tests/navigation/004.html
> [3] http://hoppipolla.co.uk/tests/navigation/005.html
> [4] http://hoppipolla.co.uk/tests/navigation/006.html
> [5] http://hoppipolla.co.uk/tests/navigation/007.html

For what it's worth, we initially tried to do what you say WebKit does 
but ran into web compat issues.  See 
https://bugzilla.mozilla.org/show_bug.cgi?id=371360 for the original bug 
where we blocked all navigation during unload and 
https://bugzilla.mozilla.org/show_bug.cgi?id=409888 for the bug where we 
changed to the current behavior.  I believe the spec says what it says 
based on our implementation experience here...

-Boris

P.S.  Opera's behavior is not quite as simple as you describe: as far as 
I can tell it depends on whether the unload is happening due to the user 
typing something in the url bar or due to the user clicking a link, say.
Received on Tuesday, 12 June 2012 18:57:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:43 UTC