When the user is offline the browser may want to show icons for sites that work offline thanks to Service Worker. Additionally, the browser may want to visually distinguish sites that work offline, for example via an offline badge.
I propose we add a key to the Manifest spec named something like
true indicates that if the user opens the PWA while offline, it will provide access to some content, or other useful functionality, as opposed to simply opening and showing no content as the user is offline.
The best way for browsers to build such a feature goal today is with heuristics like:
- Does the site have a service worker installed?
- Does the service worker have a fetch handler?
- Does the service worker respond to requests to the startURL with a 200 response?
But this is insufficient as many Progressive Web Apps cache the "shell" offline but no content and although the PWA can be opened when offline, there is nothing for the user to do. In these cases, telling the user "You're offline! Why not try one of these?" with a list of options that only open and say "Not connected" is a poor experience.
Note that incentives are also aligned for developers to set
providesMeaningfulOfflineContent correctly, as they don't stand to gain anything by being launched offline unless they provide some meaningful experience.