I have this code in my chrome extension! but I would like to clear cookies on Disabled event! .Whenever an extension is disabled or uninstalled it will clear all the cookies.
In manifest.json:
"scripts": ["background.js"]
},
"permissions": [
"cookies",
"https://*/",
"http://*/"
]
In background.js:
chrome.cookies.getAll({domain: ".mydomain.com"}, function(cookies) {
for(var i=0; i<cookies.length;i++) {
console.log(cookies[i]);
chrome.cookies.remove({url: "https://" + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
});