add <noscript> message

This commit is contained in:
or-else
2018-10-31 12:12:10 +03:00
parent 0198f446d4
commit e7f3b424e4
8 changed files with 71 additions and 38 deletions
+10 -10
View File
@@ -1,7 +1,7 @@
// Must be located at the root.
importScripts('https://unpkg.com/firebase@5.5.5/firebase-app.js');
importScripts('https://unpkg.com/firebase@5.5.5/firebase-messaging.js');
importScripts('/src/firebase-init.js');
importScripts('firebase-init.js');
firebase.initializeApp(FIREBASE_INIT);
@@ -69,17 +69,17 @@ self.addEventListener('notificationclick', function(event) {
});
// This is needed for 'Add to Home Screen'.
self.addEventListener('fetch', function (event) {
self.addEventListener('fetch', function(event) {
event.respondWith(
// Try to find response in cache.
caches.match(event.request)
.then((resp) => {
// If response is found in cache, return it. Otherwise fetch.
return resp || fetch(event.request);
})
.catch((err) {
// Something went wrong.
console.error("Service worker Fetch: ", err);
})
.then((resp) => {
// If response is found in cache, return it. Otherwise fetch.
return resp || fetch(event.request);
})
.catch((err) => {
// Something went wrong.
console.log("Service worker Fetch: ", err);
})
);
});