javascript - How to read configuration set in option page from content_scripts of Chrome extension? -
using localstorage, try store users configs, , works well. // in options_page localstorage.setitem('mykey',someval); but it's difficult read configs content_scripts (´・ω・`) localstorage.getitem('mykey'); // because different 'window' scope i'm making using runtime.sendmessage // in content_scripts chrome.runtime.sendmessage(null, {purpose:'getconfig',configkey:'mykey'}, function(confhere){ // action } ); i think it's complex!! (and using 'chrome.storage' requires permission, ugly) there way read configs content_scripts of chrome extension? content scripts run within context of pages sharing dom , not extension. so, content script trying read localstorage read localstorage of page, , not extension. the way proposed correct , far know best way access setting info in content script. so, when content script created send message background settings (as have done) , in background add list...