-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
25 lines (23 loc) · 717 Bytes
/
Copy pathsw.js
File metadata and controls
25 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Hermes Glass — PWA Service Worker
const CACHE = 'hermes-glass-v2';
const ASSETS = [
'/static/native/index.html',
'/static/native/src/app.js',
'/static/native/src/api.js',
'/static/native/src/sse.js',
'/static/native/src/voice.js',
'/static/native/src/i18n.js',
'/static/native/src/acui/renderer.js',
'/static/native/src/acui/animations.css',
'/static/native/styles/theme.css',
'/static/native/styles/layout.css',
'/static/native/styles/animations.css',
];
self.addEventListener('install', e => {
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)));
});
self.addEventListener('fetch', e => {
e.respondWith(
caches.match(e.request).then(r => r || fetch(e.request))
);
});