问题
I am a beginner and trying to make a chrome app. My chrome app has persistent needs and will therefore use an indexed db. Also, I want the app to have unlimitedStorage.
I am using
chrome.storage.sync
chrome.storage.local
to set and get values.
In my manifest file, when I use "unlimitedStorage" I get an error saying that sync ,local is undefined.
But, in my manifest file, if I use "storage" i don't get any errors.
Can anyone let me know how to do this?
回答1:
"storage"
is a permission which give you access to the chrome.storage
APIs.
"unlimitedStorage"
removes maximum size limits from storage APIs that are storing data locally, on user disk (chrome.storage.local
or IndexedDB). It is impossible to increase the quota for chrome.storage.sync
that way, since it stores data somewhere in the cloud.
So if you want to lift quota for chrome.storage.local
, you'll have to have both "storage"
and "unlimitedStorage"
permissions.
来源:https://stackoverflow.com/questions/35918802/how-to-use-unlimitedstorage-in-chromeapp