Skip to content

feat(pwa): service worker for installability + offline app shell#716

Open
shuff57 wants to merge 1 commit into
Listenarrs:canaryfrom
shuff57:feature/pwa
Open

feat(pwa): service worker for installability + offline app shell#716
shuff57 wants to merge 1 commit into
Listenarrs:canaryfrom
shuff57:feature/pwa

Conversation

@shuff57

@shuff57 shuff57 commented Jul 1, 2026

Copy link
Copy Markdown

What this adds

Turns Listenarr into an installable PWA with an offline app shell, by adding a service worker via vite-plugin-pwa. The web manifest already exists (site.webmanifest) — this fills in the missing half.

  • Installable — "Install app" on Android/desktop Chrome/Edge, and a proper standalone launch. (iOS Safari already installs from the manifest; this doesn't change that.)
  • Offline app shell — the built assets are precached, so the UI loads instantly and still opens with no network.
  • Reuses the existing manifest (manifest: false) — no duplicate manifest, no icon changes.
  • Safe by constructionregisterType: 'autoUpdate'; the API, plugin assets, hubs, and swagger are on the navigateFallback denylist and are never cached (navigateFallbackDenylist: [/^\/api/, /^\/plugins/, /^\/hubs/, /^\/swagger/]), so no stale data or intercepted API calls.

No-op unless secure

Service workers only run on a secure context (HTTPS or localhost). On a plain-HTTP LAN deployment the browser simply doesn't register it — behaviour is unchanged. So this is purely additive for HTTPS/reverse-proxy setups and inert otherwise.

Diff

The meaningful change is 17 lines — the VitePWA({...}) block in vite.config.ts + one devDependency. The large package-lock.json diff is vite-plugin-pwa's transitive tree (Workbox + Babel for SW generation); regenerate with your npm if the churn is noisy.

Testing

vite build produces dist/sw.js + registerSW.js and precaches the shell (~98 entries). Verified the build on Vite 8; the registration script is injected into index.html.

Listenarr already ships a web manifest; add vite-plugin-pwa to register a service
worker so it's installable (Add to Home Screen / desktop Install) and loads offline.
Reuses the existing site.webmanifest (manifest:false). The API, plugin assets, hubs,
and swagger are denylisted from the navigation fallback and never cached. Service
workers only activate on a secure context (HTTPS/localhost), so plain-HTTP
deployments are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shuff57 shuff57 requested a review from a team July 1, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant