原生平台一个主要优势是,用户可以轻松通过更新或加载新内容,即使用户没有正在查看应用程序或者使用他们的设备。现在的Web应用程序现在也可以使用Web Push API等技术实现这样的功能。


Using service workers
A simple guide for those new to the Service Worker API.
Using the Push API
Learn the essentials behind the Web Push API.
Using the Notifications API
Web notifications in a nutshell.


技术 描述 浏览器支持 最新规范
Service workers JavaScript running in a special worker context that is run by the browser under certain circumstances such as fetch or push events. These allow the service worker to intercept responses and customise them in any way you want, for example caching assets for offline use before they are served. Experimental: Chrome and Firefox (more detail) Service Workers
Push API When subscribed to, the push service provides an endpoint that can be used by a server to send a push message to a web app under the control of a particular service worker. Experimental: chrome and Firefox (more detail) Push API
Notifications API Fires system notifications directly from web applications. Widespreadin modern browsers (more detail) Notifications API


An Express-like microframework for easy Service Worker development.
Not only a template but a tool for deploying Offline Web Apps to GitHub Pages.
A node module to generate service worker code that will precache specific resources.


The service worker cookbook
A series of excellent service worker recipes, showing how to implement an offline app, but also much more.