WIP PWA support
This commit is contained in:
parent
c925ca2a41
commit
cba59e66c7
11 changed files with 84 additions and 10 deletions
9
scripts/setup_sw.js
Normal file
9
scripts/setup_sw.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue