Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Paste this into the Javascript console of your web browser.
- This works everywhere where there is a upvote/downvote button.
- If you want to ignore the upvote/downvote button for the image you're viewing, but still upvote/downvote for everything else, replace this line:
- if (!hasClass(list.item(i), 'pushed'))
- with this one:
- if (!hasClass(list.item(i), 'pushed') && !hasClass(list.item(i), 'title'))
- Works while viewing gallery images, a user's comments, and while viewing an image.
- This will not honor your previous vote for a comment or image, unless it matches what you want the vote to be.
- If you wanna be an upvote fairy instead, just replace the word "down" with "up".
- I regret nothing. Enjoy.
- */
- function hasClass(element, cls) {
- var r = new RegExp('\\b' + cls + '\\b');
- return r.test(element.className);
- }
- var list = document.getElementsByClassName('down');
- for (var i = 0; i < list.length; ++i) {
- if (!hasClass(list.item(i), 'pushed')) /* Don't spam Imgur's servers! It also helps us do this quicker */
- list.item(i).click(); /* Equivalent of pushing the button */
- }
Advertisement
Add Comment
Please, Sign In to add comment