Browse Source

Add fallback for event.request.mode

pm2
Luke Childs 8 years ago
parent
commit
2aa0464277
  1. 5
      public/sw.js

5
public/sw.js

@ -44,7 +44,10 @@ self.addEventListener('fetch', function(event) {
}
// If we navigate to a page
if(event.request.mode === 'navigate') {
if (
event.request.mode === 'navigate' ||
(event.request.method === 'GET' && event.request.headers.get('accept').includes('text/html'))
) {
event.respondWith(
// Make the request

Loading…
Cancel
Save