您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
EmbeddedImages
- // ==UserScript==
- // @name Embed Images On reddit-stream
- // @namespace just.a.guyy
- // @version 1.1
- // @description EmbeddedImages
- // @match http://reddit-stream.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- // Inspired by: https://greasyfork.org/en/scripts/432548-reddit-stream-dinger/code (Thanks a lot!)
- new MutationObserver(function (mutations) {
- for (let mutation of mutations) {
- for (let node of mutation.addedNodes) {
- if (node.nodeType == Node.ELEMENT_NODE) {
- var links = node.getElementsByTagName('a');
- for (var i = 0;i< links.length;i++)
- {
- if((links[i].href).includes("https://preview.redd.it")){
- links[i].innerHTML = `<img src="`+links[i].href+`" style="height:35vh;width:25vw">`;
- }
- }
- }
- }
- }
- }).observe(document.getElementById('c-main'), {
- childList: true,
- subtree: true
- });