Enable installing app as pwa

This commit is contained in:
Mirna Milic
2025-05-28 17:23:07 +02:00
parent 54da8c70e3
commit 5879bc3faf
11 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
{
"short_name": "Zdravo Stopalo",
"name": "Zdravo Stopalo",
"icons": [
{
"src": "<%= image_path('icon-192.png')%>",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "<%= image_path('icon-512.png')%>",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "<%= root_path %>",
"background_color": "#FFFFFF",
"display": "standalone",
"scope": "<%= root_path %>",
"theme_color": "#8e2731"
}

View File

@@ -0,0 +1,14 @@
function onInstall(event) {
console.log("[Serviceworker]", "Installing!", event);
}
function onActivate(event) {
console.log("[Serviceworker]", "Activating!", event);
}
function onFetch(event) {
console.log("[Serviceworker]", "Fetching!", event);
}
self.addEventListener("install", onInstall);
self.addEventListener("activate", onActivate);
self.addEventListener("fetch", onFetch);