Go to file
2020-04-02 02:42:13 +07:00
_config Initial updates 2020-04-02 02:42:13 +07:00
src Initial updates 2020-04-02 02:42:13 +07:00
templates Update ServiceWorker.ss 2018-08-02 15:26:32 +02:00
.editorconfig First commit 2018-06-24 15:51:50 +02:00
.gitignore First commit 2018-06-24 15:51:50 +02:00
composer.json Initial updates 2020-04-02 02:42:13 +07:00
LICENSE First commit 2018-06-24 15:51:50 +02:00
README.md Initial updates 2020-04-02 02:42:13 +07:00

SilverStripe Progressive Web App

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
if ('serviceWorker' in navigator) {
    var baseHref = (document.getElementsByTagName('base')[0] || {}).href;
    if(baseHref){
        navigator.serviceWorker.register(baseHref + 'service-worker.js').then(function() {
            console.log('Service Worker Registered');
        });
    }
}
  • Add the following tags to the head of your website
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="{$BaseHref}manifest.json" />