Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
67 lines (64 loc) · 3.35 KB
/
Copy pathindex.html
File metadata and controls
67 lines (64 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!--
Workbox also precaches the build-time index so an installed app can open
offline. That document has no Express-injected config. A controlled page
can recover the same mount path from its active worker's URL before the
app's module graph reads __CT_CONFIG__; a server-injected value remains
authoritative on network responses.
-->
<script data-base-path-fallback>
(function() {
if (window.__CT_CONFIG__ || !navigator.serviceWorker) return;
var controller = navigator.serviceWorker.controller;
if (!controller || !controller.scriptURL) return;
var basePath = new URL('.', controller.scriptURL).pathname.replace(/\/$/, '');
window.__CT_CONFIG__ = { basePath: basePath === '/' ? '' : basePath };
})();
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="theme-color" content="#0A0B0F" id="theme-color-meta" />
<!-- Fonts served by this instance, never from a CDN. See public/fonts/fonts.css. -->
<link rel="stylesheet" href="/fonts/fonts.css" />
<title>CookTrace</title>
<!-- VitePWA injects its own <link rel="manifest"> with a relative href that
respects the Vite base config — keeping this hand-written one as a no-op
fallback would resolve to the wrong absolute path under BASE_URL. -->
<link rel="icon" type="image/png" sizes="512x512" href="/icons/icon-512.png?v=dev05" />
<link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192.png?v=dev05" />
<link rel="apple-touch-icon" href="/icons/icon-192.png?v=dev05" />
<!-- Apply theme before first paint to prevent flash of wrong colour -->
<!-- Disable service worker in Capacitor native mode (assets served natively, SW causes offline.html redirect) -->
<script>
(function() {
// Block SW registration in native Capacitor shell
if (window.Capacitor && window.Capacitor.isNativePlatform && window.Capacitor.isNativePlatform()) {
// Unregister any existing SW and prevent new registrations
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function(regs) {
regs.forEach(function(r) { r.unregister(); });
});
// Override register to no-op so vite-plugin-pwa's registerSW.js does nothing
navigator.serviceWorker.register = function() { return Promise.resolve(); };
}
}
var _raw = localStorage.getItem('wl_appearance');
var appearance = _raw ? JSON.parse(_raw) : 'system';
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
var dark = appearance === 'dark' || (appearance === 'system' && prefersDark);
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light');
var meta = document.getElementById('theme-color-meta');
if (meta) meta.content = dark ? '#0A0B0F' : '#F5F7FA';
})();
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>