Is it possible to modify cookie from chrome extension content script? -


if have chrome extension content script, possible modify cookie content script? seems chrome.cookie api can't used content scripts , setting document.cookie don't change it. following code intended delete cookies, document.cookie same after completes:

    _.each(document.cookie.split(';'), function(s_cookie) {       var sname = s_cookie.replace(/=.+/, '');       var = sname + "=;expires=thu, 01 jan 1970 00:00:00 gmt";       console.log(a);       document.cookie = a;     });     console.log(document.cookie); // nothing changed. 

if case, want inject script actual page's javascript context, i.e.

chrome.tabs.executescript(tabid, {code:yourfunction.tostring()}, callback) 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -