I like to delete some cookies stored in Google Chrome(localhost). I know I can access them from the preferences but I need a lot of clicks to achieve this. I would love to know how you manage your cookies. Which extension do you use?
Asked
Active
Viewed 4,818 times
1 Answers
6
That's pretty straight forward with Cookies API
//delete all localhost cookies
chrome.cookies.getAll({domain: "localhost"}, function(cookies) {
for(var i=0; i<cookies.length;i++) {
chrome.cookies.remove({url: "http://localhost" + cookies[i].path, name: cookies[i].name});
}
});

serg
- 109,619
- 77
- 317
- 330
-
You mean I create my own extension? Or can create a bookmarklet which loads this javascript?? – Alfred Jul 14 '11 at 15:28
-
@Alfred From your tags I though you need an extension. You can't put extension API into a bookmarklet, but regular javascript already has direct access to cookies, only you would need to run it on one of localhost pages (while extension could be run in background any time). For pure js solution see this answer for example, you can make a bookmarklet out of it: http://stackoverflow.com/questions/595228/how-can-i-delete-all-cookies-with-javascript – serg Jul 14 '11 at 15:37
-
I hoped that some developers already encountered this problem and tried some extension like for example the excellent firebug to do this cleanly... – Alfred Jul 14 '11 at 16:21
-
2@Alfred If you are looking for a ready to use extension then it would be more appropriate to ask about it on http://superuser.com instead – serg Jul 14 '11 at 17:36
-
okay thanks :). I was wondering if I maybe had to answer in different forum, because it still has to do a little bit with programming.. – Alfred Jul 14 '11 at 18:49