Answer the question
In order to leave comments, you need to log in
Chrome.cookies.getAll returns empty array, how to fix?
I execute chrome.cookies.getAll - with callback=console.log, and outputs an empty array.
manifest.json:
{
"name": "Cookies changer",
"description": "Cookies changer",
"version": "1.0",
"manifest_version": 2,
"permissions": [
"https://www.vk.com/",
"storage",
"cookies"
],
"browser_action": {
"default_popup": "index.html",
"default_icon": "cookies.png"
}
}
(function() {
chrome.cookies.getAll({}, result => {
console.log(result); // Выводит Array(0) - пустой массив
});
})();
Answer the question
In order to leave comments, you need to log in
chrome.cookies.getAll seems to work only in background.js
But you did not pass the parameters from where to get cookies
chrome.cookies.getAll({ domain: "vk.com" }, cookies => {
console.log(cookies);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question