Alfred
Alfred

Reputation: 61803

Manage cookies from Google Chrome Extension

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?

Upvotes: 2

Views: 4983

Answers (1)

serg
serg

Reputation: 111365

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});
    }
});

Upvotes: 6

Related Questions