4 ms·
This, it works well in a service worker for example.
by raggi 2y ago
This, it works well in a service worker for example.
- nikeee 2y agoHow does this work with a service worker? I've only managed to do this via SharedWorker (which is not available on Chrome on Android).
- raggi 2y agoYou can just open a stream in the service worker and push events via postMessage and friends. Another nice thing to do is to wire up a simple filesystem monitor for all your cached assets that pushes path & timestamp events to the service worker whenever they change, then the service worker can refresh affected clients too (with only a little work this is endgame livereload if you’re not constrained by your environment)
- tomsmeding 2y agoThe caniuse link in the OP, under Known Issues, notes that Firefox currently does not support EventSource in a service worker. https://caniuse.com/?search=EventSource https://caniuse.com/?search=EventSource