Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
56 lines (55 loc) · 2.07 KB
/
Copy pathindex.html
File metadata and controls
56 lines (55 loc) · 2.07 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
<!doctype html>
<html lang="en">
<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" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="/manifest.json" />
<title>PoliTimetable</title>
<meta name="application-name" content="PoliTimetable" />
<meta property="og:title" content="PoliTimetable" />
<meta property="og:site_name" content="PoliTimetable" />
<script>
try {
const theme = localStorage.getItem('app_theme');
if (theme === 'light') {
document.documentElement.setAttribute('data-theme', 'light');
document.documentElement.style.colorScheme = 'light';
}
} catch (e) {}
</script>
</head>
<body class="bg-black w-full overflow-x-hidden m-0 p-0">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
window.addEventListener('error', (e) => {
if (e.target && (e.target.tagName === 'SCRIPT' || e.target.tagName === 'LINK')) {
if ('serviceWorker' in navigator && !sessionStorage.getItem('sw_recovery')) {
sessionStorage.setItem('sw_recovery', '1');
navigator.serviceWorker.getRegistrations().then((regs) => {
for (const reg of regs) reg.unregister();
caches.keys().then((keys) => Promise.all(keys.map((k) => caches.delete(k))))
.then(() => window.location.reload());
});
}
}
}, true);
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js').then((reg) => {
reg.update();
});
});
let refreshing = false;
navigator.serviceWorker.addEventListener('controllerchange', () => {
if (!refreshing) {
refreshing = true;
window.location.reload();
}
});
}
</script>
</body>
</html>