Update ServiceWorker.ss

This commit is contained in:
Michel vd Steege 2018-07-29 12:19:25 +02:00 committed by GitHub
parent 5b93c34485
commit b63aaf90a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,15 +59,15 @@
return; return;
} }
//Parse the url
var requestURL = new URL(event.request.url);
//Skip admin url's //Skip admin url's
if(requestURL.pathname.indexOf('admin') >= 0){ if(requestURL.pathname.indexOf('admin') >= 0){
log('Service worker: skip admin ' + event.request.url); log('Service worker: skip admin ' + event.request.url);
return; return;
} }
//Parse the url
var requestURL = new URL(event.request.url);
//Test for images //Test for images
if (/\.(jpg|jpeg|png|gif|webp)$/.test(requestURL.pathname)) { if (/\.(jpg|jpeg|png|gif|webp)$/.test(requestURL.pathname)) {
log('Service worker: skip image ' + event.request.url); log('Service worker: skip image ' + event.request.url);