About

This userscript will automatically redirect Imgur pages to their direct image link.

Download & Install

NameImgur: Redirect to Image
Namespacehttps://www.charlesstover.com/userscripts/imgur-redirect-image
AuthorCharles Stover
DescriptionAutomatically redirects Imgur pages to direct links.
File Size759 bytes
Last Modified09 Nov. 2016
Version1.0
URLs
  • /^https?:\/\/(?:www\.)?imgur\.com\/[a-zA-Z\d]+$/
Download

Open Source

// ==UserScript==
// @name        Imgur: Redirect to Image
// @namespace   https://www.charlesstover.com/userscripts/imgur-redirect-image
// @author      Charles Stover
// @description Automatically redirects Imgur pages to direct links.
// @downloadURL https://www.charlesstover.com/imgur-redirect-image.user.js
// @grant       none
// @icon        http://i.imgur.com/SBTAJtM.png
// @include     /^https?:\/\/(?:www\.)?imgur\.com\/[a-zA-Z\d]+$/
// @updateURL   https://www.charlesstover.com/imgur-redirect-image.meta.js
// @version     1.0
// ==/UserScript==

var link = document.getElementsByClassName("post-image").item(0).getElementsByTagName("a").item(0).getAttribute("href");
if (link.match(/\.gif$/))
	link += "v";
location.href = link;