[Webkit-unassigned] [Bug 199854] Safari on iOS doesn't fire any events when the tab/app is closed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 17 07:16:26 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=199854

max at ofcoursedigital.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |max at ofcoursedigital.com

--- Comment #6 from max at ofcoursedigital.com ---
I can confirm that none of the following event listeners are triggered when a tab is closed in iOS Safari. Tested on iOS 16.3.1.

addEventListener('visibilitychange', trackEvent, true);
addEventListener('pagehide', trackEvent, true);
addEventListener('freeze', trackEvent, true);
addEventListener('resume', trackEvent, true);
addEventListener('beforeunload', trackEvent, true);
addEventListener('unload', trackEvent, true);
document.addEventListener('beforeunload', trackEvent, true);
document.addEventListener('unload', trackEvent, true);
document.body.addEventListener('beforeunload', trackEvent, true);
document.body.addEventListener('unload', trackEvent, true);
window.onunload = trackEvent;

This means there's absolutely no way we can use navigator.sendBeacon to send analytics data to our backend when a user closes the tab. Same issue when the browser is force killed on the iPhone (i.e. Safari is force closed rather than put in the background).

The most closely related issue I can find is this: https://bugs.webkit.org/show_bug.cgi?id=151610

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230417/eb9247b9/attachment.htm>


More information about the webkit-unassigned mailing list