Localstorage issue after last chrome updates

328 views
Skip to first unread message

Homey

unread,
Feb 23, 2023, 4:28:04 AM2/23/23
to Chromium Extensions
With last Chrome update some time extension start losing localStorage after browser restart, 

also first second after page init localstorage empty and overrides by init script 

is localstorage totally deprecated? 

Homey

unread,
Feb 23, 2023, 5:15:52 AM2/23/23
to Chromium Extensions, Homey
also the same with
window.requestFileSystem(LocalFileSystem.PERSISTENT...

Is any workaround to keep this working? or which variant to store small media resources (.png, .mp4) is recommended?

четверг, 23 февраля 2023 г. в 13:28:04 UTC+4, Homey:

wOxxOm

unread,
Feb 23, 2023, 6:50:50 AM2/23/23
to Chromium Extensions, Homey
localStorage is not deprecated, it's an integral part of the web platform. The quota for web storage depends on the amount of free space on the disk, so maybe you have none. It may be also a bug in Chrome, you can report it in https://crbug.com

> store small media resources (.png, .mp4) is recommended

The best is IndexedDB because it can store Blob or ArrayBuffer for the file contents directly. The API for this storage is complicated, but if you only use the basic get/put/delete methods then it's pretty simple. There are also many js libraries that offer a simplified Promise-based API for IndexedDB.

Reply all
Reply to author
Forward
0 new messages