Initial commit
This commit is contained in:
15
public/sw.js
Normal file
15
public/sw.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// In host's sw.js
|
||||
const CACHE_VERSION = 'v1'; // Change this to force service worker update
|
||||
importScripts('/js/wirechat/sw.js');
|
||||
|
||||
|
||||
// Example: Custom event listener in main SW
|
||||
self.addEventListener('install', event => {
|
||||
console.log('Main Service Worker Installed - ' + CACHE_VERSION);
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener('activate', event => {
|
||||
console.log('Main Service Worker Activated');
|
||||
event.waitUntil(self.clients.claim());
|
||||
});
|
||||
Reference in New Issue
Block a user