Files
collective-lists/apps/web/src/app.html
Oier Bravo Urtasun abfb64b177 fix(pwa): add manifest link in app.html so Android Chrome shows install prompt
The plugin generated /manifest.webmanifest and the SW precached it, but
nothing in app.html linked to it. Chrome's install criteria require a
discoverable `<link rel="manifest">` in the document head — without it,
the address-bar install affordance never appears and the
beforeinstallprompt event never fires.

iOS Safari's "Add to Home Screen" already works via apple-touch-icon
alone, but with the manifest linked it now uses the manifest's name +
short_name + theme color as well.

All other install criteria were already in place: HTTPS, service worker
with skipWaiting+clientsClaim, 192/512 + maskable icons, iOS meta tags.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:22:30 +02:00

48 lines
1.9 KiB
HTML

<!doctype html>
<html lang="%paraglide.lang%">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#0f172a" />
<!-- PWA manifest link. Required for Android Chrome install prompt;
iOS Safari "Add to Home Screen" uses it for name/icon fallback. -->
<link rel="manifest" href="/manifest.webmanifest" />
<!-- iOS PWA install hints (Fase 6.2). -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Colectivo" />
<link rel="apple-touch-icon" href="/icons/icon-180.png" />
<!--
Fase 9.1: anti-FOUC theme bootstrapping.
Runs synchronously before the first paint so the page never
renders a light frame and then flashes dark on refresh.
localStorage.theme is one of 'light' | 'dark' | 'system' (default
'system'). For 'system' we read prefers-color-scheme. The result is
written to <html data-theme="..."> — Tailwind's `dark:` utilities
and the :root[data-theme=...] tokens both resolve from this attr.
-->
<script>
(function () {
try {
var stored = localStorage.getItem('theme');
var pref = stored === 'light' || stored === 'dark' ? stored : 'system';
var resolved =
pref === 'system'
? (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light')
: pref;
document.documentElement.setAttribute('data-theme', resolved);
} catch (_) {
document.documentElement.setAttribute('data-theme', 'light');
}
})();
</script>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>