We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c110c3c commit ff6498cCopy full SHA for ff6498c
1 file changed
sw.js
@@ -0,0 +1,25 @@
1
+var cacheName = 'ezclip-pwa';
2
+var filesToCache = [
3
+ './',
4
+ './index.html',
5
+ './ezclip.js',
6
+ './ezclip_bg.wasm',
7
+];
8
+
9
+/* Start the service worker and cache all of the app's content */
10
+self.addEventListener('install', function (e) {
11
+ e.waitUntil(
12
+ caches.open(cacheName).then(function (cache) {
13
+ return cache.addAll(filesToCache);
14
+ })
15
+ );
16
+});
17
18
+/* Serve cached content when offline */
19
+self.addEventListener('fetch', function (e) {
20
+ e.respondWith(
21
+ caches.match(e.request).then(function (response) {
22
+ return response || fetch(e.request);
23
24
25
0 commit comments