ably / ably-js

Javascript, Node, Typescript, React, React Native client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
316 stars 55 forks source link

mobile safari doesn't support beforeunload event #315

Open SimonWoolf opened 8 years ago

SimonWoolf commented 8 years ago

See https://stackoverflow.com/questions/6903457/is-the-onbeforeunload-event-not-supported-on-iphone

Look into workarounds for persisting on refresh. (this suggests maybe pagehide?)

┆Issue is synchronized with this Jira Bug by Unito

Peter-Maguire commented 2 years ago

iOS appears to in theory support onbeforeunload now:
https://caniuse.com/mdn-api_beforeunloadevent https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

But I'm seeing conflicting reports that it either doesn't fire at all, or doesn't work as expected. I will test this on an actual iOS device to confirm.