Bug 198673 - Need to way to feature-detect for "Add to home screen" instructions
Summary: Need to way to feature-detect for "Add to home screen" instructions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-07 11:45 PDT by Simon Fraser (smfr)
Modified: 2019-06-07 12:06 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2019-06-07 11:45:56 PDT
Pages need a way to feature-detect iOS vs desktop in order to tailor their display of "Add to home screen" instructions, since this only applies to iOS. It's no longer possible to use the user agent string for this on iPad.
Comment 1 Radar WebKit Bug Importer 2019-06-07 11:46:16 PDT
<rdar://problem/51529870>
Comment 2 Maximiliano Firtman 2019-06-07 12:06:13 PDT
Many apps add manual instructions to users to how to Add to the Homescreen (aka Install) web apps. This is more important on apps using a Web App Manifest with display: standalone (formerly apple-mobile-web-app-capable meta tag) as there is no badge, indication, banner or way for the user to know the web app can be installed as . a standalone home screen webapp. Examples of these instructions webapps are rendering are:
https://dockyard.com/blog/2017/09/27/encouraging-pwa-installation-on-ios
https://github.com/cubiq/add-to-homescreen

These apps are now using user agent sniffing to know if it's an iPhone or iPad and show proper instructions. That won't be possible on Safari on iPad OS on desktop content mode. 

One solution to the problem is to implement the beforeinstallprompt event in the Web App Manifest spec (https://www.w3.org/TR/appmanifest/#installation-events) to trigger the Share Sheet > Add to homescreen dialog that will remove the need for these instructions.