Compare commits

...

3 Commits

Author SHA1 Message Date
tamaina 93dc6634e9 fix 2021-03-05 17:52:46 +09:00
tamaina d230ecfed9 ✌️ 2021-03-05 17:45:08 +09:00
tamaina b24c41c777 Offline response 2021-03-03 13:56:00 +09:00
1 changed files with 7 additions and 1 deletions

View File

@ -46,7 +46,13 @@ self.addEventListener('activate', ev => {
//#region When: Fetching
self.addEventListener('fetch', ev => {
// Nothing to do
ev.respondWith(
fetch(ev.request)
.catch(e => {
console.error(e, ev.request);
return new Response(`Offline. Service Worker @${version}\n${e}`, { status: 200, statusText: 'NG SW' });
})
);
});
//#endregion