Mercurial
comparison mrjunejune/src/public/pwa-register.js @ 256:30c2196d03d4
[site] Integrate Zenbu themes and components
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 04 Aug 2026 16:49:01 -0700 |
| parents | a6d8d32a0261 |
| children | 60a876c4587a |
comparison
equal
deleted
inserted
replaced
| 255:5ec271d612ae | 256:30c2196d03d4 |
|---|---|
| 1 // PWA Service Worker Registration | 1 // PWA Service Worker Registration |
| 2 if ('serviceWorker' in navigator) { | 2 if ('serviceWorker' in navigator) { |
| 3 window.addEventListener('load', () => { | 3 window.addEventListener('load', () => { |
| 4 navigator.serviceWorker | 4 navigator.serviceWorker |
| 5 .register('/public/sw.js') | 5 .register('/sw.js', { scope: '/' }) |
| 6 .then((registration) => { | 6 .then((registration) => { |
| 7 // console.log('[PWA] Service Worker registered:', registration.scope); | 7 // console.log('[PWA] Service Worker registered:', registration.scope); |
| 8 | 8 |
| 9 // Check for updates periodically | 9 // Check for updates periodically |
| 10 setInterval(() => { | 10 setInterval(() => { |