I decided to use indexeddb to store data for a chrome extension I wrote. I've noticed that if I remove the extension and readd it, the data is lost.
Is there a way to persist the database across re-installations?
The apps docs (which also applies to extensions) recommend using storage.sync to handle persistence across re-installations, but the quota is very limited: 102,400 bytes. And it's not the same thing as indexeddb so some data processing would need to be done.
If your data is bigger than that I think the only solution is to sync your data manually with a server-side component, either your own or some other cloud-based solution like Firebase: https://www.firebase.com/blog/2013-03-06-power-your-chrome-extension-with-firebase.html
Indexeddb is temporary storage. https://developers.google.com/chrome/whitepapers/storage
Browser may clear data anytime as necessary.
Until persistent data storage is available, possibly in combine with quota management api, treat indexeddb data as temporary.
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