Added bugfix to SW for DevTools
This commit is contained in:
parent
a2d6aec1f0
commit
f0007f9438
@ -16,7 +16,7 @@ func configureAssets(app *aero.Application) {
|
|||||||
scriptBundle := js.Bundle()
|
scriptBundle := js.Bundle()
|
||||||
|
|
||||||
// Service worker
|
// Service worker
|
||||||
serviceWorkerBytes, err := ioutil.ReadFile("sw/service-worker.js")
|
serviceWorkerBytes, err := ioutil.ReadFile("scripts/ServiceWorker/ServiceWorker.js")
|
||||||
serviceWorker := string(serviceWorkerBytes)
|
serviceWorker := string(serviceWorkerBytes)
|
||||||
|
|
||||||
// CSS bundle
|
// CSS bundle
|
||||||
|
@ -112,6 +112,12 @@ class MyServiceWorker {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DevTools opening will trigger these "only-if-cached" requests.
|
||||||
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=823392
|
||||||
|
if((evt.request.cache as string) === "only-if-cached" && evt.request.mode !== "same-origin") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch via network
|
// Fetch via network
|
||||||
return evt.respondWith(fetch(evt.request))
|
return evt.respondWith(fetch(evt.request))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user