proxitok/scripts/setup_sw.js

10 lines
326 B
JavaScript
Raw Normal View History

2022-11-04 12:10:51 -04:00
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);
});
}
})