Skip to content

Instantly share code, notes, and snippets.

@residuum
Created March 23, 2022 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save residuum/ccb3d42ee441d62fd636809b3b8bf10f to your computer and use it in GitHub Desktop.
Save residuum/ccb3d42ee441d62fd636809b3b8bf10f to your computer and use it in GitHub Desktop.
Delete Bandcamp playlist cookies via Greasemonkey
// ==UserScript==
// @name Delete Bandcamp Cookies
// @version 1
// @grant none
// ==/UserScript==
var getCookieByMatch = function(regex) {
var cs=document.cookie.split(/;\s*/), ret=[], i;
for (var i=0; i<cs.length; i++) {
if (cs[i].match(regex)) {
ret.push(cs[i].split("=")[0]);
}
}
return ret;
};
var cookies = getCookieByMatch(/^_comm_playlist_.*/);
for (var i = 0; i < cookies.length; i++){
document.cookie = cookies[i] + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.bandcamp.com";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment