Top Left Text cha

Web & App Development

The script below, when added to your PWA, will prompt users to install update when available.
    window.isUpdateAvailable = new Promise(function(resolve, reject) {
            .then(reg => {
            reg.onupdatefound = () => {
            const installingWorker = reg.installing;
            installingWorker.onstatechange = () => {
                switch (installingWorker.state) {
                    case 'installed':
                        if (navigator.serviceWorker.controller) {
                        } else {
                            // no update available
        .catch(err => console.error('[SW ERROR]', err));

You'll need to replace 'sw.js' with the name of your service worker file.

Comment (0) Hits: 2458


A Progressive Web App (will be called PWA from now on) is, in simple terms, a way that you can make your website feel and look like an app without having to actually build an app.  Currently it supports 'Add to Home' and notifications.  I'll start with Add to Home functionality.

Add to Home Button

The add to home functionality has some benefits such as:
  • Works offline or when the device isn't connected to the internet.
  • Works on every browser and every device.
  • Loads much faster since much of the design is stored locally.  Instantly in most cases.
  • Looks and feels like an app.
  • More secure, using https only to prevent snooping.

You'll need to generate multiple images (favicons) in different sizes.  A great tool for that is
Also, to simplify things, here's a javascript library that will need to be added to your site: UpUp.js library will not only generate the icons needed, but also will create your manifest.json file.  All images and the manifest file are easier to implement, many sources say, by putting them in your home folder.

So there are a few parts that are needed for a PWA to function. You'll need the extra icons and a manifest file, mentioned previously. Then you'll need your service worker file, which you can get from using UpUp (it will generate the service worker file and another javascript file that registers and loads it).

[code & further instructions to come]
Comment (1) Hits: 2137