Answer the question
In order to leave comments, you need to log in
How to write the cookie value to a variable in the background page?
how to write the cookie value to a variable in the background page, went like this:
var ccc=chrome.cookies.get({"url": " vk.com ", "name": "1"}, function(cookies){
callback(cookies .value);
});
alert(ccc);
writes that he does not find
Answer the question
In order to leave comments, you need to log in
The call is asynchronous, because the ccc variable will not have a value (well, or it will obviously not be what you expect). Catch in the callback function and do what you need there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question