MSEdgeExplainers
MSEdgeExplainers copied to clipboard
[Web Install] Alternate solution: Standardize a declarative install banner
I'm frankly skeptical that Mozilla and Apple will approve of an imperative navigator.install()
API, but I think it's much more likely that Mozilla and Apple would approve of a declarative install banner.
For example, today, Apple has a feature for native apps called the Smart App Banner.
https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
Smart App Banners vastly improve users’ browsing experience compared to other promotional methods. In iOS, Smart App Banners provide a consistent look and feel that users come to recognize. They trust that tapping the banner will take them to the App Store and not a third-party advertisement. They appreciate unobtrusive banners at the top of a webpage, instead of a full screen that interrupts their experience with the web content. And with a large and prominent Close button, a banner is easy to dismiss. When the user returns to the webpage, the banner doesn’t reappear.
You activate a Smart App Banner with a meta tag, like this:
<meta name="apple-itunes-app" content="app-id=myAppStoreID, app-argument=myURL">
It would be useful to standardize a similar <meta>
tag for PWA installation.
<meta name="install-prompt" content="appearance=banner, referral-info=foo-bar-string-data">
For the cross-domain use case:
<meta name="install-prompt" content="appearance=banner, remote-url=https://elk.zone, mode=side-panel">
Like the <a>
tag, this approach limits the amount of information available to the developer. But that may be a good thing! That could be exactly what makes the major browser engines buy in.
FYI, interested parties may be wanting to follow the relevant TPAC discussions once they happen.
FWIW, regardless of whether anyone actually decides to push for a declarative install prompt, I think it would make sense to document it as an alternate solution in this Web Install API explainer.
@dfabulich While the declarative install banner is not exactly the same scope as the issue we are trying to solve, we're considering a declarative alternative via an anchor tag target property that would trigger an installation and return the relevant information on an event. I'm querying with different vendors their interest on this approach, specially for same-origin installs. As far as I am concerned there is no further action on cross-origin installs apart from Chromium browsers atm.