mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-24 05:56:14 -04:00
Pause when tab is hidden, using visibility change api
This commit is contained in:
parent
1a56b5f1d1
commit
33d74e8c84
68 changed files with 7290 additions and 6933 deletions
|
@ -1,13 +1,11 @@
|
|||
// 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.
|
||||
const APP_STATIC_RESOURCES = [
|
||||
"/"
|
||||
];
|
||||
const APP_STATIC_RESOURCES = ["/"];
|
||||
|
||||
// On install, cache the static resources
|
||||
self.addEventListener("install", (event) => {
|
||||
|
@ -37,7 +35,10 @@ 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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue