I have the code below
it works however console output
instant: true
instant2: false
since the variable is not overwritten in the global scope. How can I access a variable in a global scope?
var instant = false;
$('document').ready(function(){
chrome.extension.sendRequest({
action: "getStorage",
key: "instant"
}, function(response) {
instant = true;
console.log('instant: ', instant);
});
console.log('instant2: ', instant);
});
source
share