Skip to content

Instantly share code, notes, and snippets.

@Avalai
Created May 21, 2023 01:56
Show Gist options
  • Save Avalai/4ee2bc30933d38137036026d64fe4f84 to your computer and use it in GitHub Desktop.
Save Avalai/4ee2bc30933d38137036026d64fe4f84 to your computer and use it in GitHub Desktop.
Unhide all hidden Reddit posts on page
// These script can be used on:
// - www.reddit.com/user/YOUR-USERNAME/hidden/
// - old.reddit.com/user/YOUR-USERNAME/hidden/
// to unhide all posts currently shown on the page
// INSTRUCTIONS
// Copy one of the scripts below and paste it into your browser's dev console, then hit Enter
// Dev tools panel can usually be opened with `ctrl+i`, hit `esc` to show the console
// Wait until done, then refresh and run again. Script is done when:
// - New Reddit: no more floating messages are popping up
// - Old Reddit: no more posts are on the page
// On new Reddit, you can also scroll down the page to trigger the infinite load before running the script
// SCRIPT (NEW REDDIT)
let allUnhideButtons = new Array()
// Get all unhide buttons by looking for the unhide icons
document.querySelectorAll('.icon.icon-hide_fill').forEach(unhideIcon => {
const iconParent = unhideIcon.parentElement
allUnhideButtons.push(iconParent.parentElement)
})
// Click each unhide button 1s apart
allUnhideButtons.forEach((unhideButton, i) => setTimeout(() => unhideButton.click(), 1000 * i))
// SCRIPT (OLD REDDIT)
document.querySelectorAll(`[data-event-action="unhide"]`).forEach((link, i) => setTimeout(() => link.click(), 1000 * i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment