1234567 if ('serviceWorker' in navigator) { navigator.serviceWorker.getRegistrations().then(function (registrations) { navigator.serviceWorker.register('/service-worker.js').then(function (worker) { console.log('Service Worker Registered'); }); });}
if
(
'serviceWorker'
in
navigator) {
navigator.serviceWorker.getRegistrations().then(
function
(registrations) {
navigator.serviceWorker.register(
'/service-worker.js'
).then(
(worker) {
console.log(
'Service Worker Registered'
);
});
}