-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (48 loc) · 2.1 KB
/
index.html
File metadata and controls
48 lines (48 loc) · 2.1 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
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="color-scheme" content="light dark" />
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)" />
<meta name="theme-color" content="#f2f2f7" media="(prefers-color-scheme: light)" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="apple-touch-icon" sizes="180x180" href="/pwa-192x192.png" />
<title>OpenBin</title>
<script>
// Apply stored theme before first paint to prevent flash
(function() {
var t = localStorage.getItem('openbin-theme');
if (t !== 'light' && t !== 'dark') t = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
document.documentElement.className = t;
})();
</script>
</head>
<body>
<div id="root"></div>
<script>
// Recovery for iOS PWA blank screen after service worker cache eviction.
// If React hasn't rendered anything after 5s, clear SW caches and reload once.
setTimeout(function() {
var root = document.getElementById('root');
if (root && !root.children.length) {
if (sessionStorage.getItem('openbin-sw-recovery')) return;
sessionStorage.setItem('openbin-sw-recovery', '1');
if ('caches' in window) {
caches.keys().then(function(names) {
return Promise.all(names.map(function(n) { return caches.delete(n); }));
}).then(function() { window.location.reload(); });
} else {
window.location.reload();
}
} else {
sessionStorage.removeItem('openbin-sw-recovery');
}
}, 5000);
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>