Is there any way to access cookies from Chrome extension? this code
document.cookie.length
always returns - 0.
Is there any way to access cookies from Chrome extension? this code
document.cookie.length
always returns - 0.
It's the first time I read something really wrong on this site. Getting actual document cookies from an extension is INDEED possible.
you just need these two things in your manifest:
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["cookie_handler.js"]
}
],
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
your cookie_handler.js will be executed in the same context of every loader page/frame/iframe. try to put there a single line:
alert(document.cookie);
and you will see :)
If you change manifest.json you have to delete the google chrome extension and add it again.
Try these steps:
The changes to manifest.json have been loaded.