您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
to parse the img tag to show images directly
当前为
// ==UserScript== // @name Flyme社区审核图片解析 // @namespace https://gf.qytechs.cn/zh-CN/users/188666-gehongyan // @version 1.0.1 // @description to parse the img tag to show images directly // @author gehongyan // @grant none // @include http://bbs.flyme.cn/forum.php?mod=modcp&action=moderate* // ==/UserScript== (function() { 'use strict'; var allDivs, thisDiv; allDivs = document.evaluate( "//div[@style=\"overflow: auto; overflow-x: hidden; height:55px; word-break: break-all;\"]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allDivs.snapshotLength; i++) { thisDiv = allDivs.snapshotItem(i); var altText = thisDiv.innerHTML; var altHTML = altText.replace(/\[img\](.+?)\[\/img\]/ig,"<img src=$1 style=\"max-width:60%; max-height:60%;\" >"); //document.write(altHTML + "<br /><br />"); /*var nodeList = parseToDOM(altHTML); console.log(nodeList.length); for (var j = 0; j < nodeList.length; j++) { console.log(j, nodeList[j]); }*/ var newImgTag = document.createElement("div"); newImgTag.innerHTML = altHTML; thisDiv.parentNode.replaceChild(newImgTag, thisDiv); //var altTextNode = document.createTextNode(theImage.alt); //theImage.parentNode.replaceChild(altText, theImage); //var replacement = document.createTextNode(altHTML); //document.body.insertBefore(nodeList.innerText, document.body.firstChild); } })(); function parseToDOM(str){ var div = document.createElement("div"); if(typeof str == "string"){ div.innerHTML = str; } return div.childNodes; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址