NEW 236253
[iOS] Links with with target=_blank leave behind a blank tab when handled by an app
https://bugs.webkit.org/show_bug.cgi?id=236253
Summary [iOS] Links with with target=_blank leave behind a blank tab when handled by ...
Ali Juma
Reported 2022-02-07 12:55:16 PST
When a user taps on a link with target=_blank, and WebKit handles the link by opening another app (in tryInterceptNavigation in NavigationState.mm), the embedder never gets any callbacks to let it know that the navigation was handled by an app, so the embedder is left with a blank tab, that the user will see when they return to the app. More specifically, after responding to the decidePolicyForNavigationAction callback for the URL, the embedder doesn’t get any further navigation callbacks, so doesn’t know to close the blank tab. To reproduce this bug (in Chrome or Firefox on iOS): 1. Make sure the YouTube app is installed 2. Visit https://www.kennedy-center.org/video/center/other/2019/welcome-to-the-reach--the-kennedy-center/ 3. Tap on the title of the video. WebKit will open the YouTube app to handle this link. 4. Return to the browser and notice the new blank tab. This does not reproduce in Safari on iOS, since (as I understand it) Safari handles app links itself rather than letting WebKit handle them, so Safari knows to close the new blank tab. For non-Safari WKWebView embedders to handle this case correctly, there are a couple of options: 1. Add a navigation callback informing the embedder that a navigation has been handled by another app. The embedder can then decide to close the tab. 2. WebKit can automatically close a WKWebView in the case where it has no back/forward history and navigates to a link handled by an app. (2) seems trickier to get right, since some embedders might be surprised to have a WKWebView closed this way.
Attachments
Radar WebKit Bug Importer
Comment 1 2022-02-14 12:56:18 PST
Note You need to log in before you can comment on or make changes to this bug.