Last active
November 13, 2018 09:51
-
-
Save nerestaren/2e6453792030293d2c0c4305dda24add to your computer and use it in GitHub Desktop.
Imgur direct link userscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Imgur direct link | |
// @namespace https://tadaima.cat/ | |
// @version 0.1 | |
// @description replaces default imgur link with direct link | |
// @author Nerestaren | |
// @match https://imgur.com/a/* | |
// @grant GM_addStyle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
GM_addStyle('.dealt-with .copy-input {background: #010}'); | |
setInterval(function() { | |
console.log('asd'); | |
document.querySelectorAll('.image.post-image:not(.dealt-with)').forEach(post => { | |
let img = post.querySelector('img:not(.post-image-placeholder)'); | |
let input = post.querySelector('.copy-input'); | |
input.value = img.src; | |
post.className += ' dealt-with'; | |
}); | |
}, 500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment