Bug 263326 - pagehide, visibilitychange, beforeunload ALL not working when navigating away or closing tab/app/window
Summary: pagehide, visibilitychange, beforeunload ALL not working when navigating away...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-10-18 11:36 PDT by yanstiac
Modified: 2024-06-07 19:36 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yanstiac 2023-10-18 11:36:32 PDT
pagehide, visibilitychange, beforeunload ALL broken when navigating away or closing either the tab or window/app rendering navigator.sendBeacon useless

We need to get this sorted. More and more developers rely on live up-to-date analytics on user activity and knowing "when" a user has navigated away has to be by definition a major part of it.

pagehide, visibilitychange, beforeunload do not have any effect whenever the user navigates away (by inputting a new url, using back/forward, using favorites, closing current tab or window)

All other major browsers support this. 

What is going on?
Comment 1 Radar WebKit Bug Importer 2023-10-25 11:37:21 PDT
<rdar://problem/117486857>
Comment 2 Karl Dubost 2024-01-12 00:39:09 PST
Thanks for the report.
It would be cool if you had a minimal testcase, that the WebKit Team could work with.
Comment 3 Brady Eidson 2024-03-29 13:29:27 PDT
> What is going on?

All of these events are implemented, and many dozens/hundreds (if not thousands) of automated regression tests demonstrate they're working as expected.

Karl asked for at least one reproducible test case here https://bugs.webkit.org/show_bug.cgi?id=263326#c2

If you could provide step-by-step instructions on what to look at, we can explore what's going on in that case!
Comment 4 Brady Eidson 2024-06-07 19:36:15 PDT
(In reply to Brady Eidson from comment #3)
> > What is going on?
> 
> All of these events are implemented, and many dozens/hundreds (if not
> thousands) of automated regression tests demonstrate they're working as
> expected.
> 
> Karl asked for at least one reproducible test case here
> https://bugs.webkit.org/show_bug.cgi?id=263326#c2
> 
> If you could provide step-by-step instructions on what to look at, we can
> explore what's going on in that case!

Gentle ping.

For the above stated reasons, there's little progress we can make here without a concrete example.