javascript Chrome Extension Not able to read httponly cookies

前端 未结 3 1313
别跟我提以往
别跟我提以往 2020-12-19 04:06

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 a

相关标签:
3条回答
  • 2020-12-19 04:42

    This one works absolutely fine for deleting every cookie, even if it is 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){ });             
        }       
     }); 
    
    0 讨论(0)
  • 2020-12-19 04:49

    Chrome extensions can use chrome.cookies API, that has access to all cookies in the cookie store, including httpOnly.

    The documentation for the API is here.

    Note that this API requires declaring a permission and will not work from content scripts.

    0 讨论(0)
  • 2020-12-19 04:56

    The point of HTTPOnly cookies is not let javascript to access them. So basically you can not read them. If you want to delete them you can do it from the options that offers browser

    0 讨论(0)
提交回复
热议问题