why its not working?

This commit is contained in:
creeper123123321 2021-05-30 17:43:50 -03:00
parent 12fe7f8e52
commit 0157b838a6

View File

@ -13,13 +13,13 @@ window.addEventListener('beforeinstallprompt', e => {
// On load
$(() => {
if (navigator.serviceWorker) {
navigator.serviceWorker.register("sw.js")
.then(it => navigator.serviceWorker.ready.then(ready => ready.postMessage({
action: "cache",
urls: performance.getEntriesByType("resource")
.map(it => it.name)
.filter(it => it.endsWith(".js") || it.endsWith(".css") || it.endsWith(".png"))
}))); // https://stackoverflow.com/questions/46830493/is-there-any-way-to-cache-all-files-of-defined-folder-path-in-service-worker
navigator.serviceWorker.register("sw.js");
navigator.serviceWorker.ready.then(ready => ready.active.postMessage({
action: "cache",
urls: performance.getEntriesByType("resource")
.map(it => it.name)
.filter(it => it.endsWith(".js") || it.endsWith(".css") || it.endsWith(".png"))
})); // https://stackoverflow.com/questions/46830493/is-there-any-way-to-cache-all-files-of-defined-folder-path-in-service-worker
}
ohNo();