https://html.spec.whatwg.org/multipage/comms.html#broadcastchannel https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
Some WPT tests have been imported in 187001, see LayoutTests/imported/w3c/web-platform-tests/webmessaging/.
Implementing this would also improve some WPT tests that use BroadcastChannel to test some other feature.
This provides a simple way to sync functionality across tabs (especially login/logout). Other browsers have had this for years (see https://hacks.mozilla.org/2015/02/broadcastchannel-api-in-firefox-38/ and https://developers.google.com/web/updates/2016/09/broadcastchannel). I hope this gets prioritized soon.
In order for us to implement this feature, we need to have the partitioning of BroadcastChannel spec'ed since non-partitioned BroadcastChannel would introduce a new tracking vulnerability.
The spec issue is tracked in https://github.com/whatwg/html/aissues/5803 now (filed by rniwa)
Correct spec issue link: https://github.com/whatwg/html/issues/5803 (there was a superfluous ’a’ in the link in the previous comment.
Would be great to have this n Safari and not have to fallback to polling IndexedDB.
Communicating between service worker and DOM windows can be essential for sync use cases in PWAs. Safari is the only modern browser not supporting this. There is a polyfill for this with its limitations: It doesn't support workers and it doesn't support structured cloning - https://www.npmjs.com/package/broadcastchannel-polyfill. Polyfilling it for workers is harder to do. It would be awesome if BroadcastChannel could soon become present in all modern browsers and if only Safari implements it we would be there.
(For folks relying on the `BroadcastChannel` polyfill: it's currently broken in 14.1 due to https://bugs.webkit.org/show_bug.cgi?id=225344.)
All implemented via subtasks and enabled by default.