Basically, I'm trying to make an extension which on first install it clears cookies on a specific domain.
background.js:
chrome.runtime.onInstalled.addListener(function() {
chrome.cookies.getAll({
domain: "mydomain"
}, function(cookies) {
for (var i = 0; i < cookies.length; i++) {
chrome.cookies.remove({
url: "mydomain" + cookies[i].path,
name: cookies[i].name
});
}
});
});
however, this perfectly works only on default mode (non-incognito Google Chrome's mode); why? What's the actual problem? How can I make it work on incognito mode too?