最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to store big data in chrome extension? - Stack Overflow

programmeradmin10浏览0评论

I am very new to javascript and chrome-extension, I try to create extension that block a few domain. I want to store these domains in a file, maybe the same way adblock do it.

I know there is localstorage but is it the only way to store data ?

If stored in a file how can I open it from javascript extension ?

Thank you

I am very new to javascript and chrome-extension, I try to create extension that block a few domain. I want to store these domains in a file, maybe the same way adblock do it.

I know there is localstorage but is it the only way to store data ?

If stored in a file how can I open it from javascript extension ?

Thank you

Share Improve this question asked Aug 21, 2017 at 13:02 Boris Le MéecBoris Le Méec 2,7011 gold badge18 silver badges33 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 7

For large data it's remended to use Indexed DB.

You can ask for permission to use large amount of data with chrome.storage.local (and Indexed DB) using the unlimitedStorage permission (in addition to the regular storage permission).

I think you would be limited in size for safety reason, adblock (to my knowledge) uses external database (public if I'm not mistaking) so you could do the same, like using a google doc shared publicly. According to this : What is the max size of localStorage values? the max size is 10Mb

Hope that can help :)

You could use chrome.storage.local in the chrome storage api: https://developer.chrome./extensions/storage

发布评论

评论列表(0)

  1. 暂无评论