I am trying to use chrome.cookies.get function to retrieve cookies based on a domain passed and I am getting the following error. Has anyone encountered the same issue ? please advise.
Actual CODE:
function getCookies(domain, name, callback) {
chrome.cookies.get({"url": domain, "name": name}, function(cookie) {
if(callback) {
callback(cookie.value);
}
});
}
ERROR:
index.js:167 Uncaught (in promise) TypeError: Cannot read property 'get' of undefined
at getCookies (index.js:167)