Using localStorage as a message bus between windows
A while back I implemented a function on Bloglovin for synchronizing log out across multiple open windows. Ie. if you had multiple tabs open for Bloglovin and signed out in one of them we will sign you out in all of them. This is to avoid weird behavior for AJAX requests in “still logged in tabs” etc. I first looked at the HTML5 postMessage API. But to use that you require a reference to the window you want to send a message to.
Read more...