Pause when tab is hidden, using visibility change api

This commit is contained in:
Renan LE CARO 2025-03-15 10:34:01 +01:00
parent 1a56b5f1d1
commit 33d74e8c84
68 changed files with 7290 additions and 6933 deletions

4
dist/sw-b71.js vendored
View file

@ -1,5 +1,5 @@
// The version of the cache.
const VERSION = '29032991';
const VERSION = "29033834";
// The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`;
// The static resources that the app needs to function.
@ -24,7 +24,7 @@ self.addEventListener("activate", (event)=>{
})());
});
self.addEventListener("fetch", (event)=>{
if (event.request.mode === "navigate" && event.request.url.endsWith('/index.html?isPWA=true')) {
if (event.request.mode === "navigate" && event.request.url.endsWith("/index.html?isPWA=true")) {
event.respondWith(caches.match("/"));
return;
}