Bug 161472 - [META] Implement BroadcastChannel
Summary: [META] Implement BroadcastChannel
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Depends on: 187001 227919 227924 229814 230164 230181 230235 230236
  Show dependency treegraph
Reported: 2016-08-31 20:30 PDT by Yingle
Modified: 2021-09-15 18:39 PDT (History)
26 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Frédéric Wang (:fredw) 2018-06-26 06:07:11 PDT
Some WPT tests have been imported in 187001, see LayoutTests/imported/w3c/web-platform-tests/webmessaging/.
Comment 2 Rob Buis 2020-06-01 02:52:20 PDT
Implementing this would also improve some WPT tests that use BroadcastChannel to test some other feature.
Comment 3 Emanuele Feliziani 2020-06-10 04:33:51 PDT
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.
Comment 4 Ryosuke Niwa 2020-08-10 13:56:10 PDT
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.
Comment 5 Philip Jägenstedt 2020-08-14 06:14:56 PDT
The spec issue is tracked in https://github.com/whatwg/html/aissues/5803 now (filed by rniwa)
Comment 6 Thomas Steiner 2020-09-16 14:31:10 PDT
Correct spec issue link: https://github.com/whatwg/html/issues/5803 (there was a superfluous ’a’ in the link in the previous comment.
Comment 7 Richard Cooke 2021-02-19 09:21:13 PST
Would be great to have this n Safari and not have to fallback to polling IndexedDB.
Comment 8 David Fahlander 2021-02-24 01:18:40 PST
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.
Comment 9 Thomas Steiner 2021-05-04 02:54:06 PDT
(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.)
Comment 10 Chris Dumez 2021-09-15 18:39:48 PDT
All implemented via subtasks and enabled by default.