mi/static/install-sw.js

8 lines
280 B
JavaScript
Raw Normal View History

2020-11-15 20:52:57 +00:00
if (navigator.serviceWorker.controller) {
console.log("Active service worker found, no need to register");
} else {
navigator.serviceWorker.register("/sw.js").then(function(reg) {
console.log("Service worker has been registered for scope:" + reg.scope);
});
}