3 ms·
Another 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
by giancarlostoro 9y ago
Another 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...