WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
205942
The visibilitychange event does not fire on iOS when entering the tab switcher
https://bugs.webkit.org/show_bug.cgi?id=205942
Summary
The visibilitychange event does not fire on iOS when entering the tab switcher
Philip Walton
Reported
2020-01-08 11:34:47 PST
** Current behavior: ** When opening the tab switcher in Safari on iOS, the `visibilitychange` event will only fire once a user switches to a new tab. If the user instead closes the tab, then no `visibilitychange` event is fired (neither is `pagehide`, `beforeunload`, or `unload` FWIW, though I don't think those events should offer the same guarantees as `visibilitychange`). STR: 1. Visit
https://visibilitychange-logger.glitch.me
on an iPhone 2. Click the tab switcher button in the bottom right 3. Close the tab 4. Re-visit
https://visibilitychange-logger.glitch.me
and notice that no events were logged (note: `visibilitychange` events *are* logged if you actually switch to another tab) ** Proposed behavior: ** In my opinion, the `visibilitychange` event should fire as soon as the tab switcher button is pressed. That would guarantee that at least the hidden state is triggered regardless of whether the user switches tabs or closes the tab. (This is also consistent with how the `visibilitychange` event fires on Chrome on both Android and iOS) Alternatively, if
https://bugs.webkit.org/show_bug.cgi?id=151234
can be fixed to ensure the `visibilitychange` event fires any time the page goes away (including closing it from the tab switcher), that would also solve this problem.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-01-09 10:28:57 PST
<
rdar://problem/58448212
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug