Mike-O
unread,May 22, 2022, 10:40:39 PM5/22/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, salem...@gmail.com, Chromium Extensions, Mike-O
Salem,
In response to your points:
1. Yep, aware of that, but didn't explain that to you. In my MV2 extension, I don't use a service worker, but a background.js, and localStorage works there, as does chrome.storage if I implement the "storage" permission. When my MV3 extension rolls out, it will not call localStorage. It will check chrome.storage.local for those entries (hopefully migrated from a previous MV2 extension I had), and, if they are there, then it will use them. Otherwise, it will start fresh settings in chrome.storage.local. And my MV3 extension, when it rolls out, will have a service worker instead of a background.js.
2. I didn't know that, if true. If it's such an old API, then how come Chrome DevTools still doesn't have a management panel for chrome.storage? How come I have to install a third party plugin called Chrome Storage Explorer to interact with it? And I especially want to know why I can read/write chrome.storage from my service worker but the Chrome Storage Explorer plugin won't work on the service worker DevTools?
3. That function will push things into chrome.storage.local in my MV2 extension so that when the upgrade to the MV3 extension occurs, I'll be able to read chrome.storage.local. Note, again, my MV3 extension will not talk to localStorage at all.
4. True that -- IndexedDB is a weird animal. I wish they would have implemented it as some sort of SQL. I've gotten it to work after a lot of hard work with promises. I'll take a look at Dexie -- it's probably doing the same thing that I figured out with my idb.js script that I created.