This plugin serves as place to implement support for these in WordPress with the intention of being proposed for core merge, piece by piece..
The app manifest is JSON file that tells the browser about your application and how it should behave when 'installed on the device or desktop...
The plugin exposes the app manifest via REST API at wp-json app v1 web-manifest.
So the first step at adding support for service workers core is to provide API for themes and plugins to register scripts and then have them concatenated into script that is installed as the worker.
API is implemented using the interface as WordPress uses for registering scripts fact WP Service Workers is subclass of WP Scripts. The instance of this class is accessible via wp service workers in the same way as wp scripts.
Register script to run on the frontend, with dependency on some other app-shell SW script wp register service worker 'foo js, Source array, Dependency.
WP Service Workers SCOPE FRONT Scope ) Register script to run in the wp register service worker { return 'console info (.
The next step for service workers in the feature plugin is to explore the use of Workbox to power PHP abstraction for themes and plugins to indicate the routes and the caching strategies in declarative way ..
At the moment the plugin provides API to detection of whether site supports HTTPS.
Building on that it's intended that this can then be used to present user with opt-in to switch over to HTTPS.
Read more