A common problem that you may encounter when building a chrome extension is that every time you retrieve data from the chrome storage, it returns UNDEFINED. Let me show an example.
var toStore = "This text shall be stored"
//Script saves toStore and callback function provides confirmation
chrome.storage.sync.set({"value": toStore}, function(){console.log("Value Saved!")});
And then a function is activate by an event that gets the value:
var storedItem = chrome.storage.sync.get('value', function(){
console.log("Value Got! Value is " + value)});
or something like that, but it your result in the console is always:
Value Got! Value is Undefined
I will show you how to avoid this. This also will work with chrome.storage.local.set.