mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-26 19:10:25 +00:00
Fix: don't use serviceworker for http:// uris -> fixes http stream in local player
This commit is contained in:
parent
05b93894e8
commit
006eb6d28c
19
htdocs/sw.js
19
htdocs/sw.js
@ -28,15 +28,16 @@ self.addEventListener('install', function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('fetch', function(event) {
|
self.addEventListener('fetch', function(event) {
|
||||||
event.respondWith(
|
if (event.request.url.match('^http://'))
|
||||||
caches.match(event.request).then(function(response) {
|
return false;
|
||||||
if (response)
|
event.respondWith(
|
||||||
return response
|
caches.match(event.request).then(function(response) {
|
||||||
else
|
if (response)
|
||||||
return fetch(event.request);
|
return response
|
||||||
}
|
else
|
||||||
)
|
return fetch(event.request);
|
||||||
);
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('activate', function(event) {
|
self.addEventListener('activate', function(event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user