I recently noticed that localStorage.getItem() in one tab immediately reflects changes made by localStorage.setItem() in another tab, without requiring a storage event listener. I'm seeing this behavior in both Chrome and Firefox. This appears to be a recent change - my code worked correctly until around November 2025.
The Problem:
I use a BroadcastChannel to notify tabs when a user changes. Each tab runs this code when notified:
checkIfUserChanged(user: User) {
let currentUserSub = user.profile.sub;
let previousUserSub = localStorage.getItem(this.user_change_key);
if (currentUserSub !== previousUserSub) {
localStorage.setItem(this.user_change_key, currentUserSub);
window.location.href = AppConstants.webRoot;
}
}
Previously: When Tab A changed users and updated localStorage, Tab B's localStorage.getItem() would return the old value, triggering the reload.
Now: Tab B's localStorage.getItem() immediately returns the new value written by Tab A, so currentUserSub === previousUserSub and the reload never happens. This causes a "mixed user" state with data from both users.
Question: Did Chrome/Firefox recently change how localStorage reads synchronize across tabs? I understand this behavior may be more spec-compliant, but I'm looking for documentation about when this changed.
Question: Did Chrome/Firefox recently change how localStorage reads synchronize across tabs? I understand this behavior may be more spec-compliant, but I'm looking for documentation about when this changed.
No, localStorage has always worked this way in every browser.
Maybe:
the code originally worked or appeared to work for a reason other than you intended or realized, e.g. if user.profile.sub was actually the current tab’s user instead of one from the channel, and that was changed, or
you recently changed some other part of your code that interacted with localStorage and it affected this (it could even be a library upgrade that removed a wrapper around localStorage that changed its behaviour, for example), or
you reconfigured all of your browsers around the same time, e.g. by uninstalling an extension that was messing with this,
but that’s all speculation, and the answer to what you’ve highlighted as being question remains the same. Chrome and Firefox definitely didn’t both deploy the same web-compatibility-breaking change to localStorage in November 2025.