Using localStorage, I try to store users configs, and it works well.
// in options_page
localStorage.setItem('myKey',someVal);
But it's difficult to read this configs from content_scripts (´・ω・`)
localStorage.getItem('myKey');
// because different 'window' scope
I'm making it by using runtime.sendMessage
// in content_scripts
chrome.runtime.sendMessage(null, {purpose:'getConfig',configKey:'myKey'},
function(confHere){
// some action
}
);
I think it's complex!! (and using 'chrome.storage' requires permission, ugly) Is there any way to read configs from content_scripts of Chrome extension?