Bug 202399 - iOS 13: Page Visibility API visibilitychange notification incorrectly called with incorrect state with standalone safari apps
Summary: iOS 13: Page Visibility API visibilitychange notification incorrectly called ...
Status: RESOLVED DUPLICATE of bug 201737
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 12
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-01 04:29 PDT by djonesuk
Modified: 2022-02-12 21:09 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description djonesuk 2019-10-01 04:29:48 PDT
BACKGROUND:
The visibilitychange javascript notification allows a web developer to know if the user has stopped viewing a site and then returned to it. It allows script to run when the user returns to the site.

BUG:
On iOS 13, If you save multiple sites to your home screen, opening one will fire the visibilitychange notification as visible on all others that are still in the App Switcher (Previously opened) even though they are in the Hidden state.
This results in any previously opened web app to fire it's visibilitychange code thinking it is Visible even though the visibility of that page has not actually changed at all and it is Hidden.

HOW TO REPRODUCE:
I have created 2 web pages to demo this:

http://venderbase.com/vischange.html
A simple website that subscribes to the visibilitychange notification and updates the display to show that visibility had changed with the state and time.

http://venderbase.com/nojs.html
Doesn't do anything. It has no Javascript code whatsoever.

Navigate to the above 2 websites and add them to the Home Screen from the Share menu.
From the home screen, open the vischange website.
From the home screen, open the nojs website.
Go back to home screen and reopen nojs.
Go back to home screen and reopen nojs.
Repeat opening and closing nojs a few times.
Open vischange again and you will see that it's visibilitychange notification had been fired for every time you opened nojs even though visibility hadn't changed for vischange.

This sounds very similar to an iOS 11 bug that was reported and then fixed in iOS 12 Bug 180523

I've reported this to Apple Feedback Assistant but not had any recognition of it yet. It's a complete app breaker for me since iOS 13.
Comment 1 Alexey Proskuryakov 2019-10-02 13:44:06 PDT
> I've reported this to Apple Feedback Assistant but not had any recognition of it yet. It's a complete app breaker for me since iOS 13.

Could you please post the feedback number here?
Comment 2 Radar WebKit Bug Importer 2019-10-02 13:44:19 PDT
<rdar://problem/55922693>
Comment 3 djonesuk 2019-10-02 14:07:07 PDT
Apple feedback FB7144365 & FB7007530
Comment 4 Brent Fulgham 2022-02-12 21:09:44 PST

*** This bug has been marked as a duplicate of bug 201737 ***