A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Further improve `whatToCache` in service worker

+2 -1
+2 -1
src/Javascript/Workers/service.js
··· 24 24 25 25 26 26 self.addEventListener("install", event => { 27 + const href = self.location.href.replace("service-worker.js", "") 27 28 const promise = removeAllCaches() 28 29 .then(_ => fetch("tree.json")) 29 30 .then(response => response.json()) 30 31 .then(tree => { 31 32 const filteredTree = tree.filter(t => !exclude.find(u => u === t)) 32 - const whatToCache = [ self.location.origin, "application.js", "brain.js" ].concat(filteredTree) 33 + const whatToCache = [ href, "application.js", "brain.js" ].concat(filteredTree) 33 34 return caches.open(KEY).then(c => Promise.all(whatToCache.map(x => c.add(x)))) 34 35 }) 35 36