您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
编程猫html修复,对iframe/embed进行了防范
当前为
// ==UserScript== // @name 编程猫html修复 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 编程猫html修复,对iframe/embed进行了防范 // @author Fantasy // @match https://shequ.codemao.cn/* // @match https://kitten4.codemao.cn/* // @grant none // @require https://code.jquery.com/jquery-3.6.0.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/jquery.cookie.min.js // @license MIT // @icon https://static.codemao.cn/FjCi6RLz1-HB5C47m7M_0gZqJNDG // @run-at document-end // ==/UserScript== console.log('编程猫html修复已启用') function edit_html(){ $('.r-community-r-detail--forum_content,.r-community-r-detail-c-comment_item--content').each(function(){ let old_content_str = $(this).html().replace(/</g, '<').replace(/>/g, '>').replace(/<(embed|iframe)[^>]*?(src=[^>]*?work[^>]*?|style=[^>]*?position[^>]*?)[^>]*?>/gi,'').replace('<p style="color:orange">【检测到html格式排版,已自动修复】</p>','') $(this).text('').append(`${old_content_str} ${old_content_str.includes('<') ? '<p style="color:orange">【检测到html格式排版,已自动修复】</p>' : ''}`) }) } function wait_for_js(fun,selecter){ let wait_js = setInterval(function(){ if($(selecter).length !== 0){ clearInterval(wait_js) fun() } }) } if(window.location.href.includes("https://shequ.codemao.cn/wiki") ||window.location.href.includes("https://shequ.codemao.cn/community/")){ setInterval(edit_html,100) }