Stop using the localStorage hack to sync browser tabs. BroadcastChannel does it natively.
Syncing state across browser tabs with localStorage events is a widely-used trick that requires JSON.stringify, event filtering, and careful cleanup. The Broadcast Channel API delivers messages between tabs directly, with none of the side effects.
https://bestpractic.org/blog/broadcast-channel-cross-tab-messaging
Post #6912
974
