Mobile PWA: secure-context service worker (offline shell) + Tailscale HTTPS for full Android install
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- full-stack, mobile
Direzione di ricerca
Start by reading the remote app entry points in src/remote/index.html and src/remote/index.tsx, then trace how electron/remote/server.ts serves static files and how the remote build emits dist-remote/. Check behavior against the acceptance criteria: secure contexts register the service worker, plain HTTP skips registration, API and WebSocket requests bypass caching, and the worker is served with no-cache; document the Tailscale HTTPS setup in README.md or PRIVACY.md.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Add a secure-context-gated service worker (offline app shell) and a Tailscale HTTPS path so the mobile app becomes a fully installable PWA on Android/Chrome — not just iOS add-to-home-screen.
This is follow-up step 5 of 5 from the "autoconnect to mobile + installable PWA" work. Steps 1–3 have landed (auto-start server, manifest + icons, reconnect screen).
Background: why a manifest alone isn't enough
The remote server serves plain HTTP on a LAN IP (http://192.168.1.x:7777). That is not a secure context, and:
- Service workers won't register over HTTP on a non-localhost origin → no offline shell, and Chrome won't show the "Install app" prompt / generate a WebAPK.
getUserMediais also blocked → in-PWA QR-camera scanning can't work over HTTP either.- iOS Safari is the exception: "Add to Home Screen" works for any page (already shipped via the manifest in step 2), without a service worker.
So full installability requires a real HTTPS origin. The clean way to get one for a localhost service is Tailscale (tailscale serve → https://<machine>.<tailnet>.ts.net, trusted cert), which also gives a stable IP across networks/restarts — ideal for an origin-locked PWA.
Proposed solution
- Minimal service worker in
src/remote/(emitted intodist-remote/):- Pre-cache / cache-first the app shell (HTML, JS, CSS, icons, manifest).
- Never cache
/api/*or/ws(network-only) — these are dynamic and token-scoped. - Register it only when
isSecureContextso it's a no-op over plain HTTP (no console errors on WiFi).
- Server caching headers: the static handler currently serves all non-HTML as
immutable(electron/remote/server.ts). The service-worker file must be servedno-cache(or short max-age) so SW updates propagate; revisit the manifest's caching too. - Tailscale HTTPS guidance / integration: document
tailscale serve(or detect/offer to run it) so users get a secure origin. The app already detects Tailscale IPs and offers a WiFi/Tailscale toggle inConnectPhoneModal.
Acceptance criteria
- Over a secure origin (Tailscale HTTPS / localhost), the service worker registers and the app shell loads offline.
- Over plain HTTP (WiFi), SW registration is skipped cleanly — no errors, app still works as today.
-
/api/*and/wsare never served from cache. - The SW file is served with
no-cache; updates roll out without a year-long immutable cache. - Chrome (Android) shows the install prompt when served over Tailscale HTTPS.
- README/docs describe the Tailscale HTTPS setup for full install.
Touch points
src/remote/— service worker source + registration (guarded byisSecureContext).src/remote/index.html/index.tsx— SW registration entry.electron/remote/server.ts— cache-control for the SW file; ensure SW scope path is served correctly.README.md/PRIVACY.md— Tailscale HTTPS instructions.
Note
iOS already gets a standalone home-screen app over HTTP (shipped in step 2). This issue is specifically about Android/Chrome full install + offline shell, which is a web-platform requirement (secure context), not something we can shortcut in code.
- Lingua principale
- TypeScript
- Stelle
- 1k
- Fork
- 144
- Merge medio
- 4g 19h
- PR unite (30g)
- 28
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di johannesjo/parallel-code
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johannesjo/parallel-code#385 ·
I maintainer di solito rispondono entro 4 giorni
-
Option to show usage as used instead of left, and potential further customization ideasForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
johannesjo/parallel-code#353 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johannesjo/parallel-code#163 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
johannesjo/parallel-code#375 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Package as a PlatpakApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
johannesjo/parallel-code#374 ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di johannesjo/parallel-code
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ClickHouse/clickhouse-js#1248 ·
I maintainer di solito rispondono entro 1 giorno
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechseltApertatechnik
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AhmedNAgy25/analysor#25 ·
I maintainer di solito rispondono entro 1 giorno