I want to remove cookies (according to certain criteria) from within a Chrome extension. According to chrome.cookies.remove this field is the
url (the URL associated with the cookie) and
names (the name of the cookie to delete the).
Now the following fields have one:
name, value, domain, host, path, secure, httpOnly, session, expiration date, storeId but not
url . How do I get the URL of a specific cookie, so that I can delete it?
For my reference, a cookie looks like this:
domain: "google.com" adi = 8 & lt; Snip & gt; U " " "" "" "
After some lawsuits and errors, I get the URL , It works for everything (probably leaving the file): // )
function extrapolateUrlFromCookie (cookie) {var prefix = cookie.secure? "Https: //": "http: //"; If (cookie.domain.charAt (0) == ".") Prefix + = "www"; Return prefix + cookie.domain + cookie.path; }
Comments
Post a Comment