Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIN
+75 KB
icons/icon-1024.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+8.88 KB
icons/icon-120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+8.32 KB
icons/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+9.38 KB
icons/icon-144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+9.97 KB
icons/icon-152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+1.79 KB
icons/icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+10.9 KB
icons/icon-167.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+11.6 KB
icons/icon-180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+12.6 KB
icons/icon-192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+26 KB
icons/icon-384.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+35.5 KB
icons/icon-512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+5.27 KB
icons/icon-72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+6.71 KB
icons/icon-96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+66.8 KB
icons/maskable_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
{ | ||
"name": "PWA", | ||
"short_name": "Simple PWA", | ||
"lang": "en-GB", | ||
"start_url": "index.html", | ||
"display": "standalone", | ||
"background_color": "#005EB8", | ||
"theme_color": "#005EB8", | ||
"icons": [ | ||
{ | ||
"src": "icons/maskable_icon.png", | ||
"type": "image/png", | ||
"purpose": "any maskable", | ||
"sizes": "72x72 96x96 120x120 128x128 144x144 152x152 180x180 192x192 256x256 384x384 512x512 1024x1024" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
const cacheName = 'hello-pwa' | ||
const filesToCache = ['index.html'] | ||
|
||
/* Start the service worker and cache all of the app's content */ | ||
self.addEventListener('install', event => { | ||
console.log('service worker installing') | ||
event.waitUntil( | ||
caches.open(cacheName).then( cache => cache.addAll(filesToCache)) | ||
) | ||
}) | ||
|
||
/* Serve cached content when offline */ | ||
self.addEventListener('fetch', event => { | ||
event.respondWith( | ||
caches.match(event.request).then( response => response || fetch(event.request)) | ||
) | ||
}) | ||
|
||
self.addEventListener('activate', function(event) { | ||
|
||
var cacheAllowlist = ['pages-cache-v1', 'blog-posts-cache-v1']; | ||
|
||
event.waitUntil( | ||
caches.keys().then(function(cacheNames) { | ||
return Promise.all( | ||
cacheNames.map(function(cacheName) { | ||
if (cacheAllowlist.indexOf(cacheName) === -1) { | ||
return caches.delete(cacheName) | ||
} | ||
}) | ||
) | ||
}) | ||
) | ||
}) |