Last active
February 7, 2020 17:38
-
-
Save nea89o/7459a3ca6bbc217899685b6281c39b22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Replace imgur links in the Abishirt vote with images | |
// @version 1 | |
// @grant none | |
// @run-at document-end | |
// @include https://civs.cs.cornell.edu/cgi-bin/* | |
// ==/UserScript== | |
console.log("Replacing imgur links with embeded images"); | |
function mutate(el){ | |
el.innerHTML = el.innerHTML.replace(/https:\/\/imgur\.com\/([a-z0-9]+)/i, "<img src=\"https://i.imgur.com/$1.png\" height=200/>https://imgur.com/$1") | |
} | |
document.querySelectorAll("td").forEach(mutate) | |
document.querySelectorAll("th").forEach(mutate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment