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

[whatwg] Navigation triggered from unload

From: James Graham <jgraham@opera.com>
Date: Tue, 12 Jun 2012 12:30:09 +0200
Message-ID: <4FD71A31.9040407@opera.com>
To: whatwg@whatwg.org
What is the expected behaviour of navigation triggered from unload 
handlers? In particular, what stops such navigations from re-triggering 
the unload handler, and thus starting yet another navigation?

It looks like the spec tries to make a distinction between navigations 
that are cross-origin and those that are not (step 4 in the "navigating 
across documents" algorithm); I'm not sure why this inconsistency is 
desirable rather than using the cross-origin approach always.

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
Received on Tuesday, 12 June 2012 10:36:47 UTC

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