IndexedDB content from extension suddenly deleted

302 views
Skip to first unread message

Milden Jungs

unread,
Mar 17, 2025, 10:13:16 AMMar 17
to Chromium Extensions
Hi, I am developing a Chrome extension which saves data in IndexedDB. Today I noticed that the whole data was removed from IndexedDB and it was emtpy. I did not delete the cache or removed the extension. What happened? This also applies to other users of my extension.

woxxom

unread,
Mar 17, 2025, 6:12:51 PMMar 17
to Chromium Extensions, Milden Jungs
Some known reasons:
  • a mistake in the code
  • a bug in the browser
  • an external tool like CCleaner
  • no free space on the drive
  • disk failure

Juraj M.

unread,
Mar 18, 2025, 2:56:25 AMMar 18
to Chromium Extensions, woxxom, Milden Jungs
You can add "unlimitedStorage" to your manifest file to prevent eviction:
But yeah, the implementation is a bit buggy and data may still disappear for a various reasons listed above :)

Milden Jungs

unread,
Mar 18, 2025, 5:17:54 AMMar 18
to Chromium Extensions, Juraj M., woxxom, Milden Jungs
Thanks for your responses. I added the "unlimitedStorage" permission to my manifest (together with the "storage" permission") but when I check with navigator.storage.estimate(), I can see that the quota stays the same (12165714186) and it does not appear to be unlimited. I also checked the properties of my IndexedDB database in dev tools and I saw that "Is persistent" is set to "No" (see screenshot). Is this the issue? How can I change that?

indexeddb.PNG

woxxom

unread,
Mar 18, 2025, 9:19:40 PMMar 18
to Chromium Extensions, Milden Jungs, Juraj M., woxxom
It's always like that for extensions.

Milden Jungs

unread,
Mar 19, 2025, 11:24:30 AMMar 19
to Chromium Extensions, woxxom, Milden Jungs, Juraj M.
Okay, nice to hear. Does that mean there is no way to actually check if the "unlimitedStorage" permission works?

Hans

unread,
Nov 12, 2025, 2:56:17 PMNov 12
to Chromium Extensions, Milden Jungs
Chrome's implementation of IndexedDB is unreliable, unfortunately. I'm guessing it hasn't received much attention because it's not generally detrimental to web apps.

After dealing with this and researching it over the course of the last 1.5 years, I've identified and implemented a handful of measures that have noticeably reduced incident reports, but I still get on average 2-3 reports per month with 250k MAU... that's low but remains intolerable. Also, anecdotally reports spike whenever an extension update is pushed out.

It appears at this point my last remaining options for protecting user data are 1) cloud storage and 2) automated local backups. The former is in the works but it kinda sucks that this has to be a paid feature to offset costs and will therefore be inaccessible to a majority of users. The latter (scheduled backup to extension storage) was recently implemented and seems to be effective, but this was in no way a trivial effort and a difficult thing to get right.

Sure would be nice if Chrome had native IndexedDB data recovery for extensions.

Hans


woxxom

unread,
Nov 12, 2025, 3:01:18 PMNov 12
to Chromium Extensions, Hans, Milden Jungs
You can also try using the service worker's built-in `caches` API as a DB mirror. It's much faster than JSON-based chrome.storage and supports the same data types as IndexedDB, you just have to wrap them as `new Response(data)`

Hans

unread,
Nov 12, 2025, 3:26:39 PMNov 12
to Chromium Extensions, woxxom, Hans, Milden Jungs
Thanks, I'll keep that in mind.

Extension storage is slow but backups are spaced out and run in the background so I'm ok with it for now.

Hans
Reply all
Reply to author
Forward
0 new messages