BroadcastChannel - Interactive Lab | IconVault
Real cross-tab messaging with BroadcastChannel: chat between tabs, ping round-trips and a live leader election. Free, in-browser.
BroadcastChannel
Cross-tab messaging with live leader election
Channel
This tab: tab-w6wt7j
5 of 5 free messages left. Nothing leaves your device.
Live channel traffic
Connect, then open this page in a second tab.
Messages, pings and election bids from every tab appear here in real time.
How the election works
Each tab broadcasts an election bid with its random id and collects bids for 800ms. The highest id wins and broadcasts victory; every tab then knows its role. This is a simplified bully algorithm running over a real BroadcastChannel: useful for electing one tab to do polling, hold a WebSocket, or run timers while the rest stay idle.
About this tool
IconVault's BroadcastChannel playground opens a real named channel: connect, open the page in a second tab, and send messages that arrive instantly in every tab. Ping measures cross-tab round trips, and the leader-election demo runs a genuine bully algorithm over the channel so one tab becomes leader while the rest follow. It is free and runs fully in your browser.
BroadcastChannel is the simplest way for same-origin tabs, windows and iframes to coordinate: no server, no storage events hack. The lab shows the message protocol in the open, explains why the sender never receives its own broadcast, and covers the classic use cases: electing one tab to hold a WebSocket, avoiding duplicate polling, and syncing logout or theme changes across tabs.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon