more pwa stuff
This commit is contained in:
BIN
public/assets/images/192x192.png
Normal file
BIN
public/assets/images/192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
public/assets/images/512x512.png
Normal file
BIN
public/assets/images/512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -11,6 +11,16 @@
|
|||||||
"src": "/public/assets/images/android-chrome-144x144.png",
|
"src": "/public/assets/images/android-chrome-144x144.png",
|
||||||
"sizes": "144x144",
|
"sizes": "144x144",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/public/assets/images/192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/public/assets/images/512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"theme_color": "#daeedd",
|
"theme_color": "#daeedd",
|
||||||
|
|||||||
@@ -30,16 +30,17 @@ self.addEventListener("fetch", event => {
|
|||||||
event.respondWith(
|
event.respondWith(
|
||||||
fetch(event.request)
|
fetch(event.request)
|
||||||
.then(response => cache(event.request, response))
|
.then(response => cache(event.request, response))
|
||||||
.catch(function() {
|
.catch(() => caches.match(event.request))
|
||||||
return caches.match(event.request);
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
function cache(request, response) {
|
function cache(request, response) {
|
||||||
//console.log(response.type === "error" || response.type === "opaque", request);
|
if (
|
||||||
if (response.type === "error" || response.type === "opaque") {
|
response.type === "error" ||
|
||||||
return response;
|
!(response.url.includes("http:") && response.url.includes("https:")) ||
|
||||||
|
response.url == ""
|
||||||
|
) {
|
||||||
|
return Promise.resolve(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
return caches.open(CACHE_NAME).then(cache => {
|
return caches.open(CACHE_NAME).then(cache => {
|
||||||
|
|||||||
@@ -52,11 +52,13 @@
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
noscript {
|
noscript {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
background-color: #dbeede;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user