JavaScript · Senior · Question 42 of 75

How do you sync data between tabs of the same site?

Explanation

BroadcastChannel('app') delivers messages to all contexts of the same origin (tabs, iframes, workers). The storage event fires in other tabs when localStorage is written. sessionStorage is isolated per tab.

Further reading

Problem with a question

JavaScript · Senior · question 42

Test yourself

Take the JavaScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz