I saved a state inside the local storage and trying to use it inside if statement
function start(){
chrome.storage.sync.get("data", function(items) {
if (!chrome.runtime.error) {
console.log(items.data); //true or false
return items.data;
}
return items.data;
});
}
console.log(start()); //undifinde
if(start()){ // undifinde
}
how to get around this
I am trying to make part of the code inside the content script enabled or disabled