Chrome extension store large amounts of data

后端 未结 1 1275
傲寒
傲寒 2020-12-11 07:45

I\'m looking for an efficient way to store large amounts of data in my chrome extension. I\'ve got a few txt files which are around 1-2mb. I\'d like my chrome extension to \

相关标签:
1条回答
  • 2020-12-11 08:13

    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.
    0 讨论(0)
提交回复
热议问题