javascript Chrome扩展程序无法读取httponly Cookie [英] javascript Chrome Extension Not able to read httponly cookies
本文介绍了javascript Chrome扩展程序无法读取httponly Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要删除在Chrome浏览器中使用Chrome扩展程序设置的gmail Cookie,但它可以删除除了Gmail Cookie之外的所有Cookie,然后我注意到,Gmail Cookie是httponly,是否有使用javascript chrome扩展名删除它们的方法
I need to delete gmail cookies set in my chrome browser, using chrome extension , but it can delete all cookies other then Gmail cookies, then I noticed that Gmail cookies are httponly, Is there a way to remove them using javascript chrome extension..
感谢:)
推荐答案
即使是 httponly
chrome.cookies.getAll({'domain':'accounts.google.com'},function(cookie){
for(i=0;i<cookie.length;i++){
var prefix = "https://";
var url = prefix + cookie[i].domain + cookie[i].path;
chrome.cookies.remove({'url':url , 'name':cookie[i].name},function(cookie){ });
}
});
这篇关于javascript Chrome扩展程序无法读取httponly Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文