Bug 206213
Summary: | No events are fired when a user enters the App Switcher on iOS | ||
---|---|---|---|
Product: | WebKit | Reporter: | Philip Walton <philip> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cdumez, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 13 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 13 |
Philip Walton
** Problem: **
When a user visits a web page and then enters the App Switcher, no events are fired.
STR:
1. Visit https://event-logger.glitch.me/
2. Swipe up from the bottom of the screen (tested on iPhone X) to enter the App Switcher
3. Return to Safari
4. Notice that no events are logged in the table.
Alternatively:
1. Visit https://event-logger.glitch.me/
2. Swipe up from the bottom of the screen (tested on iPhone X) to enter the App Switcher
3. Close Safari
4. Open Safari (which reloads https://event-logger.glitch.me/)
5. Notice that only the `pageshow` event is logged (from the current page load, not the old page).
The demo page at https://event-logger.glitch.me/ logs all `blur`, `visibilitychange`, `pagehide`, and `pageshow`, events.
If you focus/blur the elements on the page, switch tabs to another page, close the tab, refresh the page, or enter the Safari tab switcher, in all cases you will see events being logged.
On the other hand if you open the App Switcher you won't see any events logged. This means that if a user leaves the page by enter the App Switcher and then closes Safari, there's absolutely no developer-visible signal. There's only a developer visible signal if the user actually switches apps (in that case `blur` and `visibilitychange` are logged).
This is a problem because, without any signal that a user may be about to leave, there's no way for a developers to persist unsaved state (in order to restore it when the user comes back).
** Solution: **
It would be better (and consistent with Android) if both the `blur` and `visibilitychange` events were fired when the user entered the App Switcher, not just when they actually switched apps.
In fact, Safari *does* fire the `blur` event when using Safari's tab switcher, but no event is fired when using the OS's App Switcher. It seems like (at minimum) these two cases should be consistent.
Related issues:
https://bugs.webkit.org/show_bug.cgi?id=205942
https://bugs.webkit.org/show_bug.cgi?id=199854
https://bugs.webkit.org/show_bug.cgi?id=151234
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/58596341>