Displays image replies inline in threads on the Old Reddit interface.
当前为
// ==UserScript==
// @name Old Reddit Inline Images
// @namespace http://tampermonkey.net/
// @version 1.01
// @description Displays image replies inline in threads on the Old Reddit interface.
// @author Spencer Ayers-Hale
// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @match https://*.reddit.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
var num = document.getElementsByTagName("a").length; //number of links on page
var cnt = 0; //current link number
var newLink;
while(cnt < num){
const link = document.getElementsByTagName("a")[cnt]; //get original link
if(link.innerText=="<image>"){ //check if link is an image
link.innerHTML="<img src=\""+link.href+"\" width=\"480\">" //replace text with image
}
cnt++;
}
})();