()
| 32 | } catch (e) { } |
| 33 | if ('serviceWorker' in navigator) { |
| 34 | const sendConfig = () => fetch('/service-worker-config', { |
| 35 | method: 'POST', |
| 36 | headers: { 'Content-Type': 'application/json' }, |
| 37 | body: JSON.stringify(UiContext.SWConfig), |
| 38 | }); |
| 39 | navigator.serviceWorker.register('/service-worker.js').then((registration) => { |
| 40 | console.log('SW registered: ', registration); |
| 41 | const sw = registration.active || registration.waiting || registration.installing; |