Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extension loses indexeddb when removed and readded

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?

like image 351
dalevross Avatar asked Dec 05 '25 05:12

dalevross


2 Answers

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

like image 147
Alejandro Pedraza Avatar answered Dec 11 '25 05:12

Alejandro Pedraza


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.

like image 37
Kyaw Tun Avatar answered Dec 11 '25 05:12

Kyaw Tun