mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
+24
-12
@@ -23,24 +23,36 @@
|
||||
|
||||
<!-- Splash screens for iOS -->
|
||||
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
|
||||
<script type="module" crossorigin src="/assets/index-BS4UxbHO.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CJ-drcFM.css">
|
||||
<script type="module" crossorigin src="/assets/index-Bqi5VOJF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DWwO6mIe.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
<!-- Service Worker Registration -->
|
||||
<!-- Service Worker Registration (skip on SpoolBuddy kiosk) -->
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then((registration) => {
|
||||
console.log('SW registered:', registration.scope);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('SW registration failed:', error);
|
||||
});
|
||||
});
|
||||
if (location.pathname.startsWith('/spoolbuddy')) {
|
||||
// Kiosk mode — nuke SW and all caches, then reload once to get clean state
|
||||
navigator.serviceWorker.getRegistrations().then((regs) => {
|
||||
if (regs.length > 0) {
|
||||
Promise.all([
|
||||
...regs.map((r) => r.unregister()),
|
||||
caches.keys().then((names) => Promise.all(names.map((n) => caches.delete(n)))),
|
||||
]).then(() => location.reload());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then((registration) => {
|
||||
console.log('SW registered:', registration.scope);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('SW registration failed:', error);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user