0
基本上我想要做的是:如果你在example.com上,清除所有的cookie。 (使用Chrome扩展,我已经把background.js文件放在这里)。我看不出这是不是工作。使用javascript不工作删除特定网站的Cookie
onload = function() {
//alert("test2");
//if we're on example.com, change the referrer header
if(currentUrl.indexOf("example.") !== -1) {
alert("it's in here");
function deleteAllCookies() {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
}