feat: add PWA support with manifest and service worker

This commit is contained in:
2025-11-19 12:12:57 +08:00
parent 9f2217769d
commit 597d8e5d67
8 changed files with 84 additions and 4 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

+15
View File
@@ -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"
}
]
}
+23
View File
@@ -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;
});