Chrome extension store large amounts of data

北城余情 提交于 2019-11-28 14:04:03

Only WebSQL, IndexedDB, chrome.storage.local and HTML5 File System (sandboxed file system) can grow past 5MB limit via "unlimitedStorage" permission.

manifest.json: "permissions": ["unlimitedStorage"]

Provides an unlimited quota for storing HTML5 client-side data, such as databases and local storage files. Without this permission, the extension or app is limited to 5 MB of local storage.

Notes:

  • WebSQL is deprecated by W3C in favor of the slower IndexedDB but I think it will stay in Chrome for the obvious reason that it's faster and more flexible due to being SQL-based.
  • chrome.storage.local is the easiest to use but it may not be the fastest with the large objects, do some tests if speed is important.
  • Use a Zip/LZMA Javascript library to compress/decompress the text files if the gain is significant.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!