feat: add PWA support with manifest and service worker
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "Winupdate Neo",
|
||||
"short_name": "Winupdate",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#F9FAFB",
|
||||
"theme_color": "#F9FAFB",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/favicon.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Minimal PWA service worker with no API caching
|
||||
|
||||
self.addEventListener("install", (event) => {
|
||||
// Skip waiting so updated SW takes control faster
|
||||
// but we do not pre-cache anything to keep behavior minimal
|
||||
// @ts-ignore
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
// Claim clients so the SW starts controlling pages immediately
|
||||
// @ts-ignore
|
||||
event.waitUntil(self.clients.claim());
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const request = event.request;
|
||||
|
||||
// Do not cache anything; just let the request pass through.
|
||||
// Especially do not touch API requests.
|
||||
// If needed in future, add logic here, but keep it disabled for now.
|
||||
return;
|
||||
});
|
||||
Reference in New Issue
Block a user