Skip to content

Commit a962349

Browse files
authored
ezClip v0.2.5
ezClip v0.2.5
1 parent 22ce661 commit a962349

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

manifest.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "ezClip PWA",
3+
"short_name": "ezclip-pwa",
4+
"icons": [
5+
{
6+
"src": "./assets/icon-256.png",
7+
"sizes": "256x256",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "./assets/maskable_icon_x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png",
14+
"purpose": "any maskable"
15+
},
16+
{
17+
"src": "./assets/icon-1024.png",
18+
"sizes": "1024x1024",
19+
"type": "image/png"
20+
}
21+
],
22+
"lang": "en-US",
23+
"id": "/index.html",
24+
"start_url": "./index.html",
25+
"display": "standalone",
26+
"background_color": "white",
27+
"theme_color": "white"
28+
}

sw.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)