service worker

This commit is contained in:
slweeb 2022-01-09 21:11:19 -05:00
parent d8bc06f08d
commit dc3f04377b
3 changed files with 17 additions and 0 deletions

View File

@ -4518,6 +4518,17 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
deferredPrompt.prompt(); deferredPrompt.prompt();
}); });
}); });
if ('serviceWorker' in navigator) { // Register service worker for Chrome PWA
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
shiftDown = 0; shiftDown = 0;
// If the user presses [ or -, decrease the mouse size by 2 // If the user presses [ or -, decrease the mouse size by 2
document.addEventListener("keydown", function(e) { document.addEventListener("keydown", function(e) {

View File

@ -23,6 +23,11 @@
"src": "icons/apple-touch-icon.png?v=2", "src": "icons/apple-touch-icon.png?v=2",
"sizes": "180x180", "sizes": "180x180",
"type": "image/png" "type": "image/png"
},
{
"src": "icons/apple-touch-icon-144x144.png?v=2",
"sizes": "144x144",
"type": "image/png"
} }
] ]
} }

1
sw.js Normal file
View File

@ -0,0 +1 @@
self.addEventListener('fetch', function(event) {});