mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-15 10:55:27 +01:00
why its not working?
This commit is contained in:
parent
12fe7f8e52
commit
0157b838a6
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user