
New logic to detect PWA offline support
PWA install prompt (e.g. a “plus-in-circle” icon in Chrome's Omnibox) enables users to install a website. Currently, Chrome shows the PWA install prompts whenever a site has a manifest.json with the correct fields filled in, a secure domain and icons, and a service worker with a fetch handler, with the expectation that such a site will work offline. However, some PWAs can show the install prompts although they do not support offline pages by installing an empty fetch event handler in a service worker. This leads to unexpected behavior for users such as showing the dinosaur page which tells no internet connection. Chrome proposes changing the logic to raise the bar to show the prompts. Concretely, Chrome will actually invoke a fetch event handler with a fake request to see if the handler returns a response with 200 status code, which is a strong signal that the site actually supports the offline capability. The PWA install prompts show up only when a site has a fetch event handler which returns a response with 200 status code.
This new logic is not available yet. Chrome will run experiments to see how many websites are affected and make sure that the new logic will not cause an unacceptable delay to the page loading time. Chrome will ship the feature after sufficient announcements have been made.
Resources:
New logic to detect offline support in PWAs → https://goo.gle/improved-pwa-offline-detection
Let us know what you think of these changes → https://goo.gle/pwa-offline-feedback
Chromium tracking bug → https://goo.gle/3pZIAEL
Speaker: Asami Doi
Subscribe to Google Chrome Developers here → https://goo.gle/ChromeDevs
Watch all Chrome Developer Summit sessions here → https://goo.gle/cds20-sessions
#chromedevsummit #chrome #pwa
event: Chrome Dev Summit 2020; re_ty: Publish; product: Chrome - General; fullname: Asami Doi;
Other Videos By Chrome for Developers
2020-12-22 | Canvas2D is getting an update |
2020-12-22 | Design at scale with Web Components (and ducks) |
2020-12-22 | PWA patterns for window and service worker communication |
2020-12-22 | Love your cache: Optimize for the second load |
2020-12-21 | The web ahead |
2020-12-21 | Making the web more visual with Web Stories |
2020-12-21 | Structured data for developers |
2020-12-21 | Connecting hardware devices to the web |
2020-12-18 | Extending Workbox: Custom strategies and plugins |
2020-12-18 | What’s new for web apps in Play |
2020-12-18 | New logic to detect PWA offline support |
2020-12-18 | Next-level web apps on desktop |
2020-12-17 | Transitioning to modern JavaScript |
2020-12-17 | Debugging WebAssembly with modern tools |
2020-12-17 | Extending CSS with Houdini |
2020-12-17 | Submission shoutout for STORIES | GUI Challenges |
2020-12-17 | What's new in DevTools |
2020-12-16 | Updating the way we work |
2020-12-16 | SMS OTP form best practices |
2020-12-16 | Sign-up form best practices |
2020-12-16 | Thinking on ways to solve CENTERING |