Will add test-cases. Tested in Chrome 23.0.1246.0 (Official Build 153452) dev on Linux. Not sure if this happens in non-Chrome WebKits.
Created attachment 162120 [details] test case without top-level handler
Created attachment 162122 [details] testcase with top-level handler
Actually, looks like we fire the unload handlers in both cases if you hit reload, but not if you close the tab.
Appears to work as expected in Safari 6.
Seems likely that we're just not propagating the hasUnloadHandlers bit up to the browser process on the Chrome side. Will remove the chromium prefix on the bug summary if it turns out to be a generic webkit issue.
(In reply to comment #5) > Seems likely that we're just not propagating the hasUnloadHandlers bit up to the browser process on the Chrome side. Will remove the chromium prefix on the bug summary if it turns out to be a generic webkit issue. Sounds like this is an issue in Chromium codebase?
https://code.google.com/p/chromium/issues/detail?id=231378