Web App install API

My bug report on Apple’s websites-in-the-dock feature on desktop has me thinking about how starkly different it is on mobile.

On iOS if you want to add a website to your home screen, good luck. The option is buried within the “share” menu.

First off, it makes no sense that adding something to your homescreen counts as sharing. Secondly, how is anybody supposed to know that unless they’re explicitly told.

It’s a similar situation on Android. In theory you can prompt the user to install a progressive web app using the botched BeforeInstallPromptEvent. In practice it’s a mess. What it actually does is defer the installation prompt so you can offer it a more suitable time. But it only works if the browser was going to offer an installation prompt anyway.

When does Chrome on Android decide to offer the installation prompt? It’s a mix of required criteria—a web app manifest, some icons—and an algorithmic spell determined by the user’s engagement.

Other browser makers don’t agree with this arbitrary set of criteria. They quite rightly say that a user should be able to add any website to their home screen if they want to.

What we really need is an installation API: a way to programmatically invoke the add-to-homescreen flow.

Now, I know what you’re going to say. The security and UX implications would be dire. But this should obviously be like geolocation or notifications, only available in secure contexts and gated by user interaction.

Think of it like adding something to the clipboard: it’s something the user can do manually, but the API offers a way to do it programmatically without opening it up to abuse.

(I’d really love it if this API also had a declarative equivalent, much like I want button type="share" for the Web Share API. How about button type="install"?)

People expect this to already exist.

The beforeinstallprompt flow is an absolute mess. Users deserve better.

Responses

Norm Tovey-Walsh

@adactio Make it easy for users to avoid apps? Think of the data we’d be unable to collect? Won’t somebody think of the *advertisers*?

13 Shares

# Shared by Mast0b1t on Wednesday, June 12th, 2024 at 3:41pm

# Shared by Evan Prodromou on Wednesday, June 12th, 2024 at 3:42pm

# Shared by Maj - Michele Ann Jenkins on Wednesday, June 12th, 2024 at 4:17pm

# Shared by Dustin Wilson on Wednesday, June 12th, 2024 at 4:17pm

# Shared by Baldur Bjarnason on Wednesday, June 12th, 2024 at 4:18pm

# Shared by rob on Wednesday, June 12th, 2024 at 6:16pm

# Shared by meduz' on Wednesday, June 12th, 2024 at 8:09pm

# Shared by Wes on Thursday, June 13th, 2024 at 3:04pm

# Shared by Martin Auswöger on Friday, June 14th, 2024 at 11:25am

# Shared by 🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸 on Friday, June 14th, 2024 at 2:45pm

# Shared by 樹雄 🌳🐨 :verified: on Tuesday, June 18th, 2024 at 1:23am

# Shared by Jason Neel on Friday, June 21st, 2024 at 6:08pm

# Shared by alain0 on Saturday, June 22nd, 2024 at 3:33pm

19 Likes

# Liked by Mast0b1t on Wednesday, June 12th, 2024 at 3:41pm

# Liked by Maj - Michele Ann Jenkins on Wednesday, June 12th, 2024 at 4:16pm

# Liked by jon ⚝ on Wednesday, June 12th, 2024 at 4:16pm

# Liked by AT on Wednesday, June 12th, 2024 at 4:17pm

# Liked by Kevin Karhan :verified: on Wednesday, June 12th, 2024 at 4:42pm

# Liked by Wes on Thursday, June 13th, 2024 at 3:04pm

# Liked by Roel Groeneveld on Friday, June 14th, 2024 at 10:23am

# Liked by Pelle Wessman on Friday, June 14th, 2024 at 10:23am

# Liked by busticated on Friday, June 14th, 2024 at 2:45pm

# Liked by 🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸 on Friday, June 14th, 2024 at 2:45pm

# Liked by 樹雄 🌳🐨 :verified: on Tuesday, June 18th, 2024 at 1:23am

# Liked by Jan Lehnardt :couchdb: on Friday, June 21st, 2024 at 6:08pm

# Liked by Jason Neel on Friday, June 21st, 2024 at 6:08pm

# Liked by Mark on Friday, June 21st, 2024 at 6:37pm

# Liked by Pelle Wessman on Friday, June 21st, 2024 at 8:14pm

# Liked by Aaron In Iowa on Friday, June 21st, 2024 at 8:47pm

# Liked by Alfonso Martínez de Lizarrondo on Friday, June 21st, 2024 at 8:47pm

# Liked by Tim Lucas on Friday, June 21st, 2024 at 9:43pm

# Liked by Guillaume Marty on Saturday, June 22nd, 2024 at 1:06pm

Related posts

In between

Between the physical and the digital. Between native apps and the World Wide Web.

Service worker weirdness in Chrome

Debugging an error message.

Altering expectations

How do we let people know what the web can do?

Offline itineraries with service workers

Turbo-boosting travel sites into progressive web apps.

A wager on the web

What’s the worst that could happen?

Related links

It’s Time to Build a Progressive Web App. Here’s How – The New Stack

Much as I appreciate the optimism of this evaluation, I don’t hold out much hope that people’s expectations are going to change any time soon:

Indeed, when given a choice, users will opt for the [native] app version of a platform because it’s been considered the gold standard for reliability. With progressive web apps (PWAs), that assumption is about to change.

Nonetheless, this is a level-headed look at what a progressive web app is, mercifully free of hand-waving:

  • App is served through HTTPS.
  • App has a web app manifest with at least one icon. (We’ll talk more about the manifest shortly.)
  • App has a registered service worker with a fetch event handler. (More on this later too.)

Tagged with

Getting Started with PWAs [Workshop]

The slides from Aaron’s workshop at today’s PWA Summit. I really like the idea of checking navigator.connection.downlink and navigator.connection.saveData inside a service worker to serve different or fewer assets!

Tagged with

Why We Create Progressive Web Apps: A Conversation with Jeremy Keith

This is a really nice write-up by Sydney of the chat we had on her podcast.

Tagged with

Decoded: The When, Why, and Why Not of Progressive Web Apps

I really enjoyed talking to Sydney Lai about progressive web apps, resilient web design, and all my other hobby horses.

Alas, there’s no transcript and I can’t find a direct link to the RSS feed or the individual audio file on the podcast website so it’s not huffduffable.

Tagged with

Why BaseCamp & Hey.com are Wrong About the Apple App Store

I feel for BaseCamp, I do. But give up on the native app path. Make sure your existing web interface is a good progressive web app and you can end-run around Apple.

Tagged with

Previously on this day

1 year ago I wrote Days of style and standards

CSS Day 2023 in Amsterdam.

8 years ago I wrote Thank you, jQuery

The JavaScript library that led the way.

9 years ago I wrote 100 words 082

Day eighty two.

19 years ago I wrote I'm b@ck from @media

The @media whirlwind is over. Here’s the short version: it was great.

20 years ago I wrote Feastival

The Brighton Food and Drink Festival has started.