Non-persistent in-memory storage accessible by same domain tabs

Web applications need a way to communicate between two same domain
tabs without polling LocalStorage and without hitting the disk.

It would be useful to have an in-memory get/set/compare_and_set hash
table exposed to scripts running same domain tabs, that is discarded
by the browser when those tabs are closed.

Use cases:

1. Coordinate replication between tabs for an offline app, i.e. one
tab takes responsibility for syncing a user's data to and from
IndexedDB.
2. Sign out from one tab triggers sign out from all other tabs.
3. If something like LevelDB were exposed directly to JS, one could
implement MVCC on top using the shared hash.
4. Library authors would be able to implement their own cross-tab postMessage.

It's difficult to implement these use cases with LocalStorage, without
a coarse resolution, and risky at that, due to the lack of compare and
set primitive in LocalStorage.

Received on Thursday, 24 May 2012 13:42:55 UTC