mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-06 04:35:18 +02:00
29 lines
671 B
JavaScript
29 lines
671 B
JavaScript
console.log('Service worker file loaded.')
|
|
|
|
/**
|
|
* * FETCH event
|
|
* ? It is triggered when the browser is requesting a resource
|
|
* TODO: Add the logic to handle the request (investigate best practices and options)
|
|
*/
|
|
self.addEventListener("fetch", (event) => {
|
|
/* event
|
|
.respondWith(
|
|
console.log('fetching!'),
|
|
); */
|
|
});
|
|
|
|
/**
|
|
* * INSTALL event
|
|
* * It is triggered when the service worker has been installed
|
|
* ? It is the best place to cache the app
|
|
* TODO: Add the resources to cache
|
|
*/
|
|
self.addEventListener("install", (event) => {
|
|
|
|
console.log('Installing service worker...')
|
|
/*
|
|
event.waitUntil(
|
|
// ...
|
|
);
|
|
*/
|
|
}); |