favoritter/internal/handler
Ole-Morten Duesund 1260cfd18f feat: add PWA support with Android share intent
Make Favoritter installable as a Progressive Web App with offline
static asset caching and Web Share Target API for Android.

New files:
- internal/handler/pwa.go: handlers for manifest, service worker,
  and share target
- web/static/sw.js: service worker (cache-first static, network-first
  HTML) with {{BASE_PATH}} placeholder for subpath deployments
- web/static/icons/: placeholder PWA icons (192, 512, 512-maskable)

Key design decisions:
- Share target uses GET (not POST) to avoid CSRF token issues — Android
  apps cannot provide CSRF tokens
- Manifest is generated dynamically to inject BasePath into start_url,
  scope, icon paths, and share_target action
- Service worker served at /sw.js with Cache-Control: no-cache and
  BasePath injected via string replacement
- handleShare extracts URLs from Android's "text" field as fallback
  (many apps put the URL there instead of "url")
- handleFaveNew replaced with handleFaveNewPreFill that reads url,
  description, notes from query params (enables share + bookmarklets)
- SW registration in app.js reads base-path from <meta> tag (CSP-safe)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:06:18 +02:00
..
api feat: add notes field to favorites and enhance OG meta tags 2026-04-04 00:40:08 +02:00
admin.go fix: address security and quality issues from code review 2026-03-29 16:19:44 +02:00
auth.go feat: add profiles, public views, settings, and code quality fixes 2026-03-29 16:01:41 +02:00
fave.go feat: add PWA support with Android share intent 2026-04-07 10:06:18 +02:00
feed.go feat: add notes field to favorites and enhance OG meta tags 2026-04-04 00:40:08 +02:00
handler.go feat: add PWA support with Android share intent 2026-04-07 10:06:18 +02:00
handler_test.go feat: add notes field to favorites and enhance OG meta tags 2026-04-04 00:40:08 +02:00
import_export.go feat: add notes field to favorites and enhance OG meta tags 2026-04-04 00:40:08 +02:00
profile.go fix: address code review findings for Phase 7-8 2026-03-29 16:39:10 +02:00
pwa.go feat: add PWA support with Android share intent 2026-04-07 10:06:18 +02:00
web_test.go feat: add PWA support with Android share intent 2026-04-07 10:06:18 +02:00