forked from Maxluli/TinderPokemon
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:
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "Tinder for pokemons 2022",
|
"name": "Tinder for pokemons 2022",
|
||||||
"short_name": "Pokinder",
|
"short_name": "Pokinder",
|
||||||
"start_url": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
|
"start_url": "/PokemonTinder/",
|
||||||
"id": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
|
"id": "/PokemonTinder/",
|
||||||
"display": "fullscreen",
|
"display": "fullscreen",
|
||||||
"theme_color": "red",
|
"theme_color": "red",
|
||||||
"background_color": "black",
|
"background_color": "black",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/es2-2022-2023/rhmr/PokemonTinder/assets/img/Icon2.png",
|
"src": "/PokemonTinder/assets/img/Icon2.png",
|
||||||
"sizes": "144x144",
|
"sizes": "144x144",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
// Register a service worker hosted at the root of the
|
// Register a service worker hosted at the root of the
|
||||||
// site using the default scope.
|
// site using the default scope.
|
||||||
navigator.serviceWorker.register('/es2-2022-2023/rhmr/PokemonTinder/sw.js').then(
|
navigator.serviceWorker.register('/PokemonTinder/sw.js').then(
|
||||||
(registration) => {
|
(registration) => {
|
||||||
console.log('Service worker registration succeeded:', registration)
|
console.log('Service worker registration succeeded:', registration)
|
||||||
},
|
},
|
||||||
|
|||||||
4
sw.js
4
sw.js
@@ -21,7 +21,7 @@ self.addEventListener("fetch", event => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
function cache(request, response) {
|
function cache(request, response) {
|
||||||
if (response.type === "error" || response.type === "opaque") {
|
if (response.type === "error" || response.type === "opaque") {
|
||||||
return Promise.resolve(); // do not put in cache network errors
|
return Promise.resolve(); // do not put in cache network errors
|
||||||
@@ -31,7 +31,7 @@ function cache(request, response) {
|
|||||||
.open(CACHE_NAME)
|
.open(CACHE_NAME)
|
||||||
.then(cache => cache.put(request, response.clone()));
|
.then(cache => cache.put(request, response.clone()));
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
const CACHE_NAME = "V2";
|
const CACHE_NAME = "V2";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user