How to use unlimitedStorage in chromeapp?

折月煮酒 提交于 2021-01-06 10:46:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!