feat(privacy): privacy page, security headers, Chrome fallback for Samsung installs

The 'privacy' refusal on the S23 is Google Play Protect blocking the WebAPK that
Samsung Internet mints (old targetSdkVersion) — a browser-side bug that also hits
other PWAs; Chrome on the same device installs fine. So:

- ui/install-tip.js: detect Samsung Internet on Android and offer the same URL in
  Chrome (intent:// link, copy-link fallback, dismissable, remembered)
- ui/views/privacy.js + #/privacy route + footer link: Thai privacy policy (what is
  stored locally, no cookies/analytics/third-party scripts, how to delete)
- server/publish.mjs: CSP (script-src 'self', style-src 'self' 'unsafe-inline'),
  Referrer-Policy, Permissions-Policy, X-Content-Type-Options on every response
- ui/boot-motion.js: the head inline script moved out so CSP can forbid inline JS
- ui/data.js: admin publish token now lives in sessionStorage (was localStorage)
- theme.css: .notice / .legal components (44px targets), DESIGN.md + README + AGENTS

Verified: installabilityErrors [], fonts load under CSP, all requests same-origin,
notice renders under the header at 360px with 44px buttons and stays dismissed,
privacy page renders 5 sections. VERSION 2026.11.24.6.
This commit is contained in:
Bkk1234 committed 2026-11-24 15:10:32 +07:00
1 parent ddec75b99e
commit 2edbc39805
12 files changed
+346 -20

No files matched your search

+13
View File
@@ -78,6 +78,19 @@ npm run version # bump VERSION (sw.js) + <meta app-version> (index.html)
npm run check # มี --check ตรวจสองค่านี้ไม่ให้หลุดกัน
```
## ความเป็นส่วนตัว (`#/privacy`)
หน้าเว็บนี้ไม่มีการติดตามใด ๆ และประกาศไว้เป็นหน้าในเว็บ (`#/privacy`, ลิงก์ในฟุตเตอร์):
| เรื่อง | สถานะ |
|---|---|
| คุกกี้ / เครื่องมือวิเคราะห์ / สคริปต์บุคคลที่สาม | ไม่มี (ตรวจแล้ว: request ทั้งหน้าอยู่ origin เดียว) |
| ข้อมูลในเครื่อง | `localStorage` = แคชรายการ + ฉบับร่างหลังบ้าน · `sessionStorage` = รหัสเผยแพร่ (หายเมื่อปิดแท็บ) |
| สิทธิ์อุปกรณ์ | ไม่ขอ (กล้อง/ไมโครโฟน/ตำแหน่ง ถูกปิดด้วย `Permissions-Policy`) |
| Header ความปลอดภัย | `Content-Security-Policy` (`script-src 'self'`), `Referrer-Policy: strict-origin-when-cross-origin`, `X-Content-Type-Options: nosniff`, `frame-ancestors 'none'` |
> รหัสเผยแพร่หลังบ้านย้ายไป `sessionStorage` แล้ว (เดิมค้างใน `localStorage`) — ไม่เก็บ credential ถาวรบนเครื่อง
## ระบบหลังบ้านทำงานอย่างไร
```