Actually THIS is the last commit... DONT FORGET TO EDIT THE MANIFEST AAAAND THE SERVICE WORKER REGISTRATION IN THE INDEX.HTML

This commit is contained in:
maxluli
2022-10-21 20:48:57 +02:00
parent c47ba48e0f
commit 279526ed49
3 changed files with 6 additions and 6 deletions

View File

@@ -1,14 +1,14 @@
{
"name": "Tinder for pokemons 2022",
"short_name": "Pokinder",
"start_url": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
"id": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
"start_url": "/PokemonTinder/",
"id": "/PokemonTinder/",
"display": "fullscreen",
"theme_color": "red",
"background_color": "black",
"icons": [
{
"src": "/es2-2022-2023/rhmr/PokemonTinder/assets/img/Icon2.png",
"src": "/PokemonTinder/assets/img/Icon2.png",
"sizes": "144x144",
"type": "image/png"
}

View File

@@ -25,7 +25,7 @@
if ('serviceWorker' in navigator) {
// Register a service worker hosted at the root of the
// site using the default scope.
navigator.serviceWorker.register('/es2-2022-2023/rhmr/PokemonTinder/sw.js').then(
navigator.serviceWorker.register('/PokemonTinder/sw.js').then(
(registration) => {
console.log('Service worker registration succeeded:', registration)
},

4
sw.js
View File

@@ -21,7 +21,7 @@ self.addEventListener("fetch", event => {
);
});
/*
function cache(request, response) {
if (response.type === "error" || response.type === "opaque") {
return Promise.resolve(); // do not put in cache network errors
@@ -31,7 +31,7 @@ function cache(request, response) {
.open(CACHE_NAME)
.then(cache => cache.put(request, response.clone()));
}
*/
const CACHE_NAME = "V2";