Yep that's the one.
@nomadic said in Help with extension (get variable from one script to another):
I also don't think you need that listener in options.js
The reason for the listener here
The instant i read your reply that made complete sense. And probably what was stumping me
as i was trying to do something that wasn't required and i had no idea about.
@nomadic said in Help with extension (get variable from one script to another):
Like so: linkOpenBg: linkOpenBg.checked
This was done, forgot to add to the post.
So started to play around again and your post got me looking through the chrome dev pages again, and then things started clicking. Turns out the info was there i just didn't really understand it completely... But i figured it out!
Ended up with this:
chrome.storage.sync.get(['linkOpenBg'], function(result) {
if (result.linkOpenBg === true){
var openBg = false
} else {
var openBg = true
};
More complex than what it needs to be, ideally result.linkOpenBg will be used directly without having to change true to false, but does the job. Something more to play about with. But i'm chuffed i figured it out
Thanks a lot for pointing me in the right direction and making me look over things again.