If I have IndexedDB database opened in multiple tabs, can I track data changes on all tabs without reloading?
There's no built in way to do this with IndexedDB alone. You basically have two options:
Poll IndexedDB with some frequency and check for new values
Use some other way of cross-tab communication to send a signal that you need to check for new values from IndexedDB. For example localStorage (emits cross-tab events when something changes) or a BroadcastChannel (designed exactly for the purpose of cross-tab communication, but does not have perfect cross browser support).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With