I am trying to develop a Chrome extension, and the first step is to determine if the user is registered on my website. I'm testing for development localhost, so how can I read cookies for writing?
Here is what is in my manifest:
"permissions": [
"cookies", "tabs", "http://*/*", "https://*/*"
],
And JavaScript:
chrome.cookies.get({"url": 'localhost', "name": '_ga'}, function(cookie) {
console.log('cookie:');
console.log(cookie);
});
But I get this error:
Unchecked runtime.lastError while running cookies.get: Invalid url: "localhost".
Can someone point me in the right direction?
source
share