(
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/
extensions/docs/examples/api/cookies/manager.html?content-type=text/
plain)
I think that this method is the fastest one to clear all your
cookies :
function removeAll() {
var all_cookies = [];
cache.getDomains().forEach(function(domain) {
cache.getCookies(domain).forEach(function(cookie) {
all_cookies.push(cookie);
});
});
cache.reset();
var count = all_cookies.length;
var timer = new Timer();
for (var i = 0; i < count; i++) {
removeCookie(all_cookies[i]);
}
timer.reset();
chrome.cookies.getAll({}, function(cookies) {
for (var i in cookies) {
cache.add(cookies[i]);
removeCookie(cookies[i]);
}
});
}
function removeCookie(cookie) {
var url = "http" + (cookie.secure ? "s" : "") + "://" +
cookie.domain +
cookie.path;
chrome.cookies.remove({"url": url, "name":
cookie.name});
}
function removeCookiesForDomain(domain) {
var timer = new Timer();
cache.getCookies(domain).forEach(function(cookie) {
removeCookie(cookie);
});
}
Hope it helps