3 ms·
I wish Shared Workers had more browser support (currently just Chrome and Firefox). Service Workers are great, but not for long-running processes. With a Share
by streptomycin 9y ago
I wish Shared Workers had more browser support (currently just Chrome and Firefox). Service Workers are great, but not for long-running processes.
With a Shared Worker, you can have one instance of your app that will actually keep running continually as long as you have a tab open. Then you can treat multiple open tabs as multiple different clients of the Shared Worker. All state and communication with the server can be handled by the Shared Worker, reducing a lot of duplicated effort and cross-tab coordination. It's pretty great... but only in Chrome and Firefox.
- paws 9y agoI realize it's not the same thing, but just FYI, Safari 11.1 is apparently adding ServiceWorker support. [1] One year ago it didn't seem very likely this would land. Maybe the future holds some promise for SharedWorkers on Safari too. [1] https://developer.apple.com/safari/technology-preview/release-notes/ https://developer.apple.com/safari/technology-preview/releas...
- deleted 9y ago[deleted]
- giancarlostoro 9y agoAnother feature I love that I wish were in more than just Chrome and Firefox: BroadcastChannel. If you want to post to an iFrame or Window, you gotta find it's object. With BroadcastChannel you just join the "channel" and post away, and anyone can listen to that channel, each channel is unique as well. It's so much better than hunting down the DOM element and then doing postMessage. Apparently it is also available to WebWorkers. Makes sending messages through iFrames / new windows / tabs a breeze. Don't ask me why I'm using iFrames in 2018 though :) https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel https://developer.mozilla.org/en-US/docs/Web/API/BroadcastCh...