pagehide event appears to fire when tab is navigated to a different URL, but does not fire when the tab is closed (regardless of whether the tab was in foreground or background state). I believe the pagehide event should fire in all cases and Safari appears to be the only browser with this behavior.
Test page: http://output.jsbin.com/zubiyid/latest/quiet
I believe this is a known *Safari* bug, and is not a bug in WebKit.
Can you please try in Minibrowser using WK2 mode?
Do I need to build it on this end? Can't seem to find any easily accessible binaries for OSX.
Hmmmmm totally wrong about this being a Safari bug - It's just closely related to one.
We have this in Radar already: rdar://problem/16477268