The docs of storage.StorageArea
say storage.StorageArea.getBytesInUse()
is not supported in Firefox.
Is there a way to get the storage size anyway?
Also, 100KB for storage.sync
doesn’t seem a lot. Therefore I’d like to let the user decide for local or synced storage.
Would it be a good pattern to store the settings synced and for all other data to use checkboxes in the settings for “local” and “synced” and all data to be stored is being stored according to this setting like this:
storeData(toBeStored) {
browser.storage.sync.get().then(storage => {
browser.storage[storage.StorageArea].set({ data: toBeStored });
});
}