proxitok/scripts/setup_sw.js
2022-11-04 17:10:51 +01:00

10 lines
326 B
JavaScript

window.addEventListener("load", () => {
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/sw.js').then(function (reg) {
console.log('Service worker registration was successful, scope: ', reg.scope);
}).catch(function (error) {
console.log('Service worker failed:', error);
});
}
})