javascriptgoogle-chrome-extensionindexeddbgoogle-chrome-storage

Should I use only IndexedDB or both IndexedDB and chrome.storage?


I'm a bit confused here. I'm making a chrome extension where users can store data (like images and common extension options). What I want to know is what is the best way to store the data?

Thank you


Solution

  • Since chrome.storage can't store ArrayBuffer the most reasonable choice for files is IndexedDB.

    The options, assuming it's a very small object, may be stored in chrome.storage.sync so the user gets the same options on every device or chrome.storage.local if syncing doesn't make sense for your extension or the object is big.