index - JAVASCRIPT 0.37 KB
                    
             window.onload = () => { 'use strict';
if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('/sw.js');
}
}

if (!navigator.serviceWorker.controller) {
    navigator.serviceWorker.register("/sw.js").then(function(reg) {
         console.log("Service worker has been registered for scope: " + reg.scope);
     });
}
            
            

Paste Hosted With By Codes Ohari5336