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 badges3 Answers
Reset to default 7For 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