I'm trying to catch beforeunload, unload, pagehide events on iPhone Safari (602.1) IOS 10.3.3. But it seems that on iPhone these events don't fire, and the funny part is that on iPad which has same versions of browser and IOS, the events do fire. The only difference that I noticed was that iPad gives you the tab option but iPhone doesn't. Is there any way to catch these events on iPhone IOS 10.3.3?
Note: These events do fire on iPhone IOS 8.4.1.
I use event pagehide with (partial) success, see supported Events in Apple Guides.
The only situation that pagehide does not work is on iPhone 10, and when the website is stored to the application 'springboard'. The web application (build with Vuejs) looks like a native App. Leaving the 'app' does not fire pagehide. On older iPhones and iPads in the same situation, pagehide fires.
window.addEventListener('pagehide', () => {
// do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With