MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / clearCookies

Function clearCookies

scripts/removeCookies.js:27–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25};
26
27export function clearCookies() {
28 let C = document.cookie.split("; ");
29 for (let d = "." + location.host; d; d = ("" + d).substr(1).match(/\..*$/))
30 for (let sl = 0; sl < 2; ++sl)
31 for (
32 let p = "/" + location.pathname;
33 p;
34 p = p.substring(0, p.lastIndexOf("/"))
35 )
36 for (let i in C) {
37 let c = C[i];
38 if (c) {
39 document.cookie =
40 c +
41 "; domain=" +
42 d.slice(sl) +
43 "; path=" +
44 p.slice(1) +
45 "/" +
46 "; expires=" +
47 new Date(new Date().getTime() - 1e11).toGMTString();
48 }
49 }
50}

Callers 1

removeCookies.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected