discourse/discourse — pull request #1808 by cfstras (2014-01-10 17:44:42+00:00)
Title: Focus events: Track which window is the last active instance of a forum

(Don't merge this, yet)

Hi,
I am submitting this to hear thoughts on my approach - this is part of my quest to support desktop notifications.
The goal is to know, when a user has multiple tabs open, whether an instance is the least recently used one, so only that one will display notifications.

Also, I added a listener function to KeyValueStore which can be used to listen on 'storage events' which occur whenever another window changes the localStorage.

The unittests are not complete and for some reason time out. (also I just noticed there are still some debug statements)

Any ideas/hints, or is this an approach you would be happy to merge?