您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
很多佬友在签名栏设置了自己的博客链接,或者是自己的座右铭。但是自己没开启签名展示没意识到不能正常显示,让我们一起来修复它们吧。
// ==UserScript== // @name 修复裂开的小尾巴 // @namespace http://tampermonkey.net/ // @version 0.0.15 // @description 很多佬友在签名栏设置了自己的博客链接,或者是自己的座右铭。但是自己没开启签名展示没意识到不能正常显示,让我们一起来修复它们吧。 // @author ygmjjdev // @match https://linux.do/* // @icon https://linux.do/uploads/default/optimized/1X/3a18b4b0da3e8cf96f7eea15241c3d251f28a39b_2_180x180.png // @grant none // ==/UserScript== // 把裂开的图片换成文本或超链接 function replaceImage(img) { var src = img.getAttribute("src"); if (src.startsWith("http")) { // 如果是链接,替换成a标签 var a = document.createElement("a"); a.setAttribute("href", src); a.textContent = src.substring(0, 50) + src.length >= 50 ? '...' : ''; img.parentNode.replaceChild(a, img); } else { // 普通文本 var p = document.createElement("p"); p.style.display = "-webkit-box"; p.style.webkitBoxOrient = "vertical"; p.style.wordBreak = "break-all"; p.style.webkitLineClamp = "2"; p.style.overflow = "hidden"; p.textContent = decodeURI(src); img.onerror = null; img.parentNode.replaceChild(p, img); } } (function () { "use strict"; document.querySelectorAll(".signature-img").forEach(function (img) { if (img.complete && img.naturalHeight === 0 && img.naturalWidth === 0) { replaceImage(img); } img.onerror = function () { replaceImage(img); }; }); var observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { if (mutation.type == "childList") { mutation.addedNodes.forEach(function (node) { checkNodeAndChildren(node); }); } }); }); function checkNodeAndChildren(node) { if (node.nodeName == "IMG" && node.classList.contains("signature-img")) { node.onerror = function () { setTimeout(() => { replaceImage(node); }, 30); }; } // 递归检查子节点 if (node.childNodes) { node.childNodes.forEach(function (childNode) { checkNodeAndChildren(childNode); }); } } observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址