blazorSWRegister.js
1 if ('serviceWorker' in navigator) { 2 navigator.serviceWorker.register('blazorServiceWorker.js') 3 .then(function (registration) { 4 console.log('Registration successful, scope is:', registration.scope); 5 }) 6 .catch(function (error) { 7 console.log('Service worker registration failed, error:', error); 8 }); 9 }