a2nt/silverstripe-progressivewebapp

Tools to add offline caching and the other progressive web app functionality to your silverstripe website

Maintainers

👁 a2nt

Package info

github.com/a2nt/silverstripe-progressivewebapp

Language:JavaScript

Type:silverstripe-vendormodule

pkg:composer/a2nt/silverstripe-progressivewebapp

Statistics

Installs: 762

Dependents: 1

Suggesters: 0

Stars: 1

v1.10 2018-08-02 13:26 UTC

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 8ace11ef79352a4ba59c28f2aaf00d96b31c24e8

  • Michel van der Steege <michelsteege.woop@hotmail.com>

appsilverstripeprogressive

This package is auto-updated.

Last update: 2026-06-12 07:23:52 UTC


README

Tools to add progressive web app functionality to your silverstripe website And make it available offline

Installation

composer require a2nt/silverstripe-progressivewebapp

Usage

  • Install the module, run dev/build and fill in the settings in the siteconfig
  • Add js to register the service worker (example can be found at client/src/app.js)
if ('serviceWorker' in navigator) {
 var baseHref = (document.getElementsByTagName('base')[0] || {}).href;
 var version = (document.querySelector('meta[name="swversion"]') || {})
 .content;
 if (baseHref) {
 navigator.serviceWorker
 .register(baseHref + 'sw.js?v=' + version)
 .then(() => {
 console.log('SW: Registered');
 });
 }
}
  • Add the following tags to the head of your website
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="{$BaseHref}manifest.json" />
<meta name="swversion" content="{$SWVersion}" />