Last active
December 20, 2023 01:45
-
-
Save mclarke47/ff0456babf8f799f8053 to your computer and use it in GitHub Desktop.
a complete hack to click the unsave buttons on all reddit posts on screen.
This file contains hidden or 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
Doesn't seem to work anymore | |
$("a").filter(function(index){return $(this).text()==="unsave"}).click(); | |
New | |
document.querySelectorAll("a").forEach(function(index,other){if(index.text==="unsave"){index.click();}}); |
Nice one 👍
Times are a-changin again. This works on the current modern Reddit ui:
document.querySelectorAll("button[role='menuitem']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);
I used this most recently:
document.querySelectorAll("span[class='_2-cXnP74241WI7fpcpfPmg']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);
I used this most recently:
document.querySelectorAll("span[class='_2-cXnP74241WI7fpcpfPmg']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
document.querySelectorAll("a").forEach(function(index,other){if(index.text==="unsave"){index.click();}});window.location.reload(true);
where: window.location.reload(true); will refresh the page. So all you have to do is Ctrl+V and Enter