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
Post a Comment