This commit is contained in:
creeper123123321 2021-05-30 17:40:54 -03:00
parent 29375aecd0
commit 12fe7f8e52

View File

@ -14,12 +14,12 @@ window.addEventListener('beforeinstallprompt', e => {
$(() => {
if (navigator.serviceWorker) {
navigator.serviceWorker.register("sw.js")
.then(it => it.installing.postMessage({
.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
}))); // https://stackoverflow.com/questions/46830493/is-there-any-way-to-cache-all-files-of-defined-folder-path-in-service-worker
}
ohNo();