knadh / localStorageDB

A simple database layer for localStorage and sessionStorage for creating structured data in the form of databases and tables
http://nadh.in/code/localstoragedb
814 stars 128 forks source link

Not supporting cross-tabs #72

Closed drveresh closed 8 years ago

drveresh commented 8 years ago

Hi,

Currently it is only supporting same page/tab, but not working in multiple tabs for same pages/application. Now days, it is a basic use case that users would open same app on multiple tabs.

Please update me if this can be accommodated.

knadh commented 8 years ago

That's not how localStorage works. It uses the domain name, not browser sessions or tabs for storage. Similar to how cookies work. You may be initialising and wiping your localSotrageDB instance on every page load. Please share your code snippets here if possible.

drveresh commented 8 years ago

I agree that by default the localStorage doesn't support syncing between more than one tab for same website/page/domain, and I was hoping your library will cover it.

knadh commented 8 years ago

On the contrary, as I said, localStorage is tied to domain names. Once a value is set, it should become available across multiple tabs (of the same domain) instantly.