Skip to content

Instantly share code, notes, and snippets.

@Dinir
Last active March 11, 2022 21:31
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 Dinir/ff1efabb2da515cec25d0a2110005d43 to your computer and use it in GitHub Desktop.
Save Dinir/ff1efabb2da515cec25d0a2110005d43 to your computer and use it in GitHub Desktop.
mass delete Steam screenshots on your profile
/*
Go to your screenshot page, set view as Image Wall,
press F12, then go to console to paste this code.
The browser tab should be visible on the monitor.
I highly recommend moving them to a corner where you can't see
the screenshots as the page scrolls, as you won't see them ever again.
When the page eventually refreshes and says an error occured,
keep the page open until you see no more number changes on your profile.
*/
(theNumber => {
// get total number of screenshots displayed
const getTrackedNumber = () =>
document.getElementsByClassName('profile_media_item').length
// scroll down the page every second until the number hit
const keepScrollingDown = setInterval(() => {
window.scrollTo(0, document.body.scrollHeight)
stopIfNumberHit(theNumber)
}, 1000)
/*
check if the total number of screenshots reached certain number,
then if it did, select all of them and confirm deleting them.
*/
const stopIfNumberHit = n => {
if (getTrackedNumber() < n)
return false
clearInterval(keepScrollingDown)
ToggleManagementMode()
SelectAllScreenshots()
ConfirmBatchAction('delete')
$('BatchScreenshotManagement').submit()
}
})(1000) // set the number here. usually it stops after around 800.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment