Last Updated: February 25, 2016
·
1.047K
· atmartin

Add a "Favorite" link after image links on Imgur

Want to add images linked in Imgur comments to your Favorites, but don't want to have to save/copy or manually open in a new tab?

Create an empty bookmark and copy/paste the following line of Javascript to the "Link", "URL", or "Site":

javascript:$("a.image-link:contains('imgur')").each(function(){if($(this).next().find('img').attr('alt')!='(+fav)'){$(this).after("  <a href='"+$(this).text()+"/fav' target='_blank'><img height='16' width='16' alt='(+fav)' src='http://cdn.dustball.com/add.png '/></a>")}})

This will make a shortcut that adds a small "Favorite" link after every image link sourced from an Imgur subdomain. Clicking on that icon will open the image in a new tab and add it to your favorites gallery. You will have to confirm the addition, but clicking the favorite link won't interrupt your browsing or cause you to lose your place!