Menu

1 / 9

Your Tabs Are Talking Behind Your Back

DEV Community: frontend·Violetta Soloveva·8 days ago
#JRxgtLJC
#devtofrontend#devto#dev#tabs#origin
Long article (1611 words) — no AI summary yet.
Reading 0:00
15s threshold

Imagine you log out of an app in one tab.

You switch to another tab. Same app. Still logged in, apparently.

You click Edit . The form opens. You type. You click Save .

And only then does the server answer with a 401 , and your changes are gone.

No line of code is wrong, exactly. Each tab is living in its own little world, and nobody told the second tab that the party was over.

The browser has plenty of ways to fix that. Eight of them, by my count, and from a distance they all look alike. This article is the map: what each one does, who it talks to, and when I'd reach for it.

(Spoiler: for the logout, it's BroadcastChannel. But it isn't always the answer.)

1. One question sorts them all: who is talking to whom?

Line these APIs up and they look like a pile of things that all send messages.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.