Sha256: 9c7071fd2b4f126dd4a30af021ae466302f7d49aa97e2ef4f62271ef705021c3
Contents?: true
Size: 1019 Bytes
Versions: 5
Compression:
Stored size: 1019 Bytes
Contents
/* eslint no-console:off */ (function setupSW() { 'use strict' if ('serviceWorker' in navigator) { window.addEventListener('load', function () { navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat console.log('ServiceWorker registration successful with scope: ', registration.scope) registration.onupdatefound = function () { var installingWorker = registration.installing installingWorker.onstatechange = function () { switch (installingWorker.state) { case 'installed': if (navigator.serviceWorker.controller) { // eslint-disable-line compat/compat console.log('new update available') location.reload(true) } break default: } } } }).catch(function (err) { console.log('ServiceWorker registration failed: ', err) }) }) } }())
Version data entries
5 entries across 5 versions & 1 rubygems