Questions tagged [broadcast-channel]

The Broadcast Channel API allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site).

By creating a BroadcastChannel object, which is listening to the underlying channel, you are able to receive any message that has been posted to it. An interesting point is that you no longer have to maintain a reference to iframes or workers that you wish to communicate with. They can simply “subscribe” to particular channels by constructing a BroadcastChannel, and have full-duplex (bi-directional) communication between all of them.

See MDN Web API Reference - Broadcast Channel

Related APIs

43 questions
0
votes
0 answers

Browser window/tab communication from different domain and origin

I have below scenario www.site1.com is opened in one browser window/tab (Which is my website) www.customersite.com, opened in another browser which is client website. I have full control over site1.com and I can give a script to embed in the…
Shiv
  • 199
  • 5
  • 16
0
votes
1 answer

React with BroadcastChannel

In the React app I click on button to open new tab. When I open new tab I want to pass some data to the new tab. Code from my button component const channel = new BroadcastChannel('color'); const handleClick = () => { ... …
Andrew Losseff
  • 333
  • 5
  • 18
0
votes
1 answer

How to share Session storage data with other opened browser tabs in React

Here I have a part of a code, in which I needed to log in to the application, and I am storing the token in both local and session storage so that it can handle during the beforeunload event, storing in session will help during refresh and local to…
0
votes
1 answer

*ngFor not updating when data is received through a BroadcastChannel

I was creating this stackblitz to get help with a different problem and ran into the problem I'm having now in the process. I'm using a BroadcastChannel to send data to a component embedded inside of an