More accurate offline capability detection for PWA sites before showing install prompt
- Category
- Miscellaneous
- Type
- No developer-visible change
- Status
- Enabled by default (Chrome Enabled by default)
- Intent stage
- Prepare to ship
WPT details: it's not a feature that can be tested by WPT.
Summary
Tests whether the registered service worker can return a 200 response when it's offline by dispatching a fake fetch event to the service worker while simulating an offline environment. The install prompt will be shown only if the test passes.
Motivation
One of the expectation of installable PWA is running the web app offline. Previously, we just checked the existence of a fetch handler in the service worker. However, it was not sufficient because sometimes it can be bypassed by simple code. This change makes sure that the site can show something offline.
Standards & signals
- Specification: https://w3c.github.io/manifest/#installability-signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://crbug.com/965802
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=more-accurate-offline-capability-detection-for-pwa-sites-before-showing-install-prompt
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+More%20accurate%20offline%20capability%20detection%20for%20PWA%20sites%20before%20showing%20install%20prompt
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=More%20accurate%20offline%20capability%20detection%20for%20PWA%20sites%20before%20showing%20install%20prompt
- Baseline status: https://webstatus.dev/?q=More%20accurate%20offline%20capability%20detection%20for%20PWA%20sites%20before%20showing%20install%20prompt
Samples: https://pwa-sample-cds.glitch.me/ https://pwa-sample-cds-no-offline-support.glitch.me/