Created
March 23, 2022 22:48
-
-
Save residuum/ccb3d42ee441d62fd636809b3b8bf10f to your computer and use it in GitHub Desktop.
Delete Bandcamp playlist cookies via Greasemonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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