[whatwg] Navigation triggered from unload
Boris Zbarsky
bzbarsky at MIT.EDU
Tue Jun 12 11:56:27 PDT 2012
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.
More information about the whatwg
mailing list