animliber
animliber

Reputation: 31

Standards for "Add to Home Screen"

Are there any standards for browsers implementing "Add to Home Screen"? When this launcher for a web app is created, how should the app be launched? Is it going to be run in standalone web browser instance of a already running instance.

I'm especially interested in the security/privacy of the apps. Do they share the same offline data (Cookies, local storage) as pages with the URL opened in a normal browser instance?

Upvotes: 2

Views: 340

Answers (3)

Mathias
Mathias

Reputation: 4569

No standards
Since it's fairly new, how it works in different browsers is changing every few months
As you develop your PWA, you will probably need to adapt to those changes
Safari seems to be the farthest behind in supporting PWAs
Chrome is leading the way and others are following
The Chrome Developer channel has the most info on what's new this month and several good videos for you to learn about PWAs
https://www.youtube.com/channel/UCnUYZLuoy1rq1aVMwx4aTzw

Looks like storage for an installed PWA (chrome) is different than accessing the web page for the same PWA. As with everything else currently happening with PWAs, this will vary for different browsers and the developer will need to adapt accordingly. If I add a PWA to the homescreen, can I take the current data from the local storage?

Upvotes: 0

Francesco
Francesco

Reputation: 10870

As Mathias said, there are not established standards, but rather best practices. I would follow the directions of google developers:

You may want to wait before showing the prompt to the user, so you don't distract them from what they're doing. For example, if the user is in a check-out flow, or creating their account, let them complete that before interrupting them with the prompt.

So you might decide to provide in some page of your app a "Add to Home Screen" button, that allows the users to decide when and if they want to install your PWA. However I find also the automatic appearing of the prompt not too intrusive, but this also depends on your users target.

If you want to learn more, you can have a look at my articles based on PWAs.

About your other questions:

  • A service worker (SW) runs on a separate thread than the one used by the web site, for this reason is defined "non blocking". You do not want that an issue or long time operation running on the SW would affect the web site performance. A SW, acting as a proxy between your app and the network, can only work on a secure (HTTPs) connection. Here a whole set of details about service workers.

    • You can define different caching strategies to leverage the true benefits of SW. Here you can save not only static assets, but also HTTP GET Requests for improving the application performance and response time.

Upvotes: 1

animliber
animliber

Reputation: 31

Thanks for both on clarifying the non-standardization of PWAs.

I found via the link that @Francesco provided, that at least Chrome/Chromium PWAs actually do use the same state as in normal browser instances.

Upvotes: 1

Related Questions