Answer the question
In order to leave comments, you need to log in
How to get the value of a variable from storage?
There is a function:
function getTokenFromStorage() {
var key = 'key-aaa';
var value = 'value-bbb';
chrome.storage.local.set({'key-aaa': value});
chrome.storage.local.get(key,function(result){
alert(result[key]);
});
}
Answer the question
In order to leave comments, you need to log in
Perhaps I did not quite understand the question, do you mean this?
function getTokenFromStorage() {
...
var resultValue;
chrome.storage.local.get(key,function(result){
resultValue = result[key];
});
return resultValue;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question