Skip to content

Instantly share code, notes, and snippets.

@mlcdf
Last active August 15, 2020 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mlcdf/7afd6a6398cff8067c8d540d50a56bfa to your computer and use it in GitHub Desktop.
Save mlcdf/7afd6a6398cff8067c8d540d50a56bfa to your computer and use it in GitHub Desktop.
Unhide or unsave links on Reddit
// Tested on Firefox.
// Go to https://old.reddit.com/user/<username>/hidden
// Open your browser console and run the following code:
function eventFire(el, etype) {
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
$("[action='unhide']").each((index, value) => { eventFire(value, 'click') })
// => All the posts displayed on the page will be unhidden. Just refresh the page to see the change.
// Tested on Firefox.
// Go to https://old.reddit.com/user/<username>/saved
// Open your browser console and run the following code:
function eventFire(el, etype) {
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
$(".link-unsave-button.save-button > a").each((index, value) => { eventFire(value, 'click') })
// => All the posts displayed on the page will be unsaved. Just refresh the page to see the change.
// Print all previous saved links (doesn't include saved comments)
// str = '';
// $('.bylink.comments.may-blank').each(function(el) {
// str += this.href + '\n'
// })
// console.log(str)
@hemlok89
Copy link

Thank you!! This is a lifesaver. I unknowingly set to perma hide all posts on a mobile app.

@harryqt
Copy link

harryqt commented Oct 2, 2019

Does not work.

@mlcdf
Copy link
Author

mlcdf commented Oct 2, 2019

It worked on the old reddit. Maybe try on https://old.reddit.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment