Chrome keep deleting my IndexDB data when extension updates

108 views
Skip to first unread message

時雨初

unread,
Jun 11, 2026, 10:56:10 AM (13 days ago) Jun 11
to Chromium Extensions

I have been using IndexedDB to store FileSystemHandle objects so my Chrome extension can remember where users save their files. The main logic for saving the FileSystemHandle is running inside an offscreen document.

However, I noticed that when I run:

const persisted = await navigator.storage.persist();

it always returns false.

I already have the unlimitedStorage permission, but after every extension update, the stored data is automatically wiped out.

Does anyone know why navigator.storage.persist() is returning false in this context, or why my IndexedDB data is being cleared after updates? Any help would be appreciated.

woxxom

unread,
Jun 11, 2026, 7:18:05 PM (13 days ago) Jun 11
to Chromium Extensions, 時雨初
It may be a bug in Chrome or in your code. I haven't stored FileSystemHandle specifically but normal IndexedDB data is always preserved on update for me and my users. The unlimitedStorage permission is guaranteed to preserve the storage including IndexedDB and the persist() method doesn't have effect for extensions according to https://issues.chromium.org/issues/40182034#comment17

Juraj M.

unread,
Jun 12, 2026, 2:45:15 AM (12 days ago) Jun 12
to Chromium Extensions, woxxom, 時雨初
The docs says this about 
window.navigator.storage.persist()
Safari and most Chromium-based browsers, such as Chrome or Edge, automatically approve or deny the request based on the user's history of interaction with the site and do not show any prompts to the user.
https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#does_browser-stored_data_persist
Regarding the handle, I do use it in my extension for automatic backups into user specified folder, however the handle will expire in some time,  and user will be prompted again to approve the access. But it shouldn't get deleted from the DB.

Mc Vance

unread,
Jun 12, 2026, 4:22:37 AM (12 days ago) Jun 12
to liuka...@gmail.com, chromium-...@chromium.org
It looks like this might be related to how Chrome handles storage
persistency within extensions.

According to a Chromium tracker discussion, the
`navigator.storage.persist()` method actually does not have any effect
for Chrome extensions. Furthermore, the `unlimitedStorage` permission
is designed to guarantee that normal IndexedDB data is preserved
during extension updates.

Since your normal storage should be safe under `unlimitedStorage`, the
issue is likely specific to storing `FileSystemHandle` objects. It
might be a bug in how Chrome serializes or retains those specific
system handles across updates rather than a complete wipe of your
IndexedDB data. You might want to check if normal string/object data
survives the update to isolate if the issue is strictly with the
`FileSystemHandle` preservation.
Reply all
Reply to author
Forward
0 new messages