File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments