Keeping Multiple Blazor Tabs in Sync with the Browser Broadcast Channel API
A user opens your Blazor application in one browser tab. Then they open a second tab, perhaps to compare information or keep two parts of the application visible at the same time. They change something in the first tab. Nothing happens in the second tab. This is expected. Each browser tab has its own page, JavaScript context, and Blazor Server circuit. Even though both tabs are displaying the same application for the same user, they don’t automatically share live state. You could solve this with SignalR, a server-side notification service, or a distributed messaging system. For many applications, however, that would be far more infrastructure than the problem requires. When the communication only needs to happen between tabs from the same application in the same browser, the browser already provides a lightweight solution: the Broadcast Channel API . In this article, we will examine: What developers sometimes mean by the “Broadcast API” What the Broadcast Channel API actually is ...