您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
对不合规的内容加密处理
当前为
// ==UserScript== // @name 「xiuno」管理工具(QQ 群:189574683) // @namespace 沉冰浮水 // @version 0.3 // @description 对不合规的内容加密处理 // @author 沉冰浮水 // @link https://gf.qytechs.cn/zh-CN/scripts/419517 // @link ---------------------------- // @link https://github.com/wdssmq/userscript // @link https://afdian.net/@wdssmq // @link https://gf.qytechs.cn/zh-CN/users/6865-wdssmq // @link ---------------------------- // @match https://bbs.zblogcn.com/* // @require https://cdn.bootcdn.net/ajax/libs/lz-string/1.4.4/lz-string.min.js // @require https://cdn.bootcdn.net/ajax/libs/moment.js/2.29.1/moment.js // @grant none // ==/UserScript== /* jshint esversion:6 */ (function () { "use strict"; const $ = window.jQuery; // console.log($); const $btnBad = $(` <a class="btn btn-primary">BAD</a>`); const strTip = `<p>此贴内容或签名不符合论坛规范已作屏蔽处理,请查看置顶贴,以下为原始内容备份。</p>`; $btnBad.css({ color: "#fff" }).click(function () { let um = window.UM.getEditor("message"); let str = um.getContent(); if (str.indexOf("#~~") > -1) { return; } let strCode = LZString.compressToBase64(str); um.setContent(strTip + `<p>#~~${strCode}~~#</p>`); console.log(LZString.decompressFromBase64(strCode)); // let strDeCode = LZString.decompressFromBase64(strCode); // um.setContent(strCode + strDeCode); }); if ($("input[name=update_reason]").length > 0) { $("#submit").after($btnBad); return; } // 解码 $("div.message").each(function () { let $secP = $(this).find("p:nth-child(2)"); if ($secP.length == 0) { console.log("skip"); return; } let str = $secP.html(); if (str.indexOf("#~~") == -1) { return; } console.log(str); str = str.replace(/#~~(.+)~~#/, function (a, b) { console.log(arguments); let strDeCode = LZString.decompressFromBase64(b); console.log(strDeCode); return strDeCode; }); $secP.after(str).remove(); }); // 楼层地址 const curHref = location.href.replace(location.hash, ""); $("li.media.post").each(function () { const $me = $(this); const pid = $me.data("pid"); const $date = $me.find("span.date"); $date.after( `<a class="text-grey ml-2" title="获取当前楼层链接" href="${curHref}#${pid}">「楼层地址」</a>` ); }); // YML 获取 function fnGetAjax(strURL, strData, fnCallback) { $.ajax({ url: strURL, type: "GET", data: strData, // dataType: "json", success: fnCallback, }); } // 开发者申请 const $h4 = $(".media-body h4"); let title = $h4.text().trim(); if (title.indexOf("申请开发者") > -1) { $("div.message").each(function () { if ($(this).attr("isfirst") == 1) { $(this).prepend( `<blockquote class="blockquote"><pre class="pre-yml"></pre></blockquote>` ); $(".pre-yml").text(`标题格式错误`); } }); title = title.replace(/\[|【/g, "「").replace(/\]|】/g, "」"); const objMatch = title.match(/「([^」]+)」「(theme|plugin)」/); console.log(objMatch); if (!objMatch) { return; } const tplYML = `- id: #id# type: #type# status: 进行中 url: #url# date: - #date# reviewers: - 沉冰浮水`; const styYML = fnStrtr( tplYML, { id: objMatch[1], type: objMatch[2], url: location.href, date: moment().format("YYYY-MM-DD"), }, (str) => { str = str.replace(/\n/g, "\\|"); str = str.replace(/\s{6}/g, "_2__2_"); str = str.replace(/\s{4}/g, "_2_"); str = str.replace(/_2_/g, " "); str = str.replace(/\\\|/g, "\n"); return str; } ); $(".pre-yml").text(`${styYML}`); fnGetAjax( "https://cdn.jsdelivr.net/gh/wdssmq/ReviewLog@main/2021.yml", // "https://raw.githubusercontent.com/wdssmq/ReviewLog/main/2021.yml", "", function (resData) { // console.log(resData); // // yml2obj // const oData = jsyaml.load(resData, "utf8"); // console.log(oData); // 好像不解析直接判断就行; if (resData.indexOf(location.href) > -1) { $(".pre-yml").before(`<p class="text-danger">已提交过</p>`); return; } } ); } // 工具函数 function fnStrtr( str, obj, callback = (str) => { return str; } ) { let rltStr = str; for (const key in obj) { if (Object.hasOwnProperty.call(obj, key)) { const value = obj[key]; const reg = new RegExp(`#${key}#`, "g"); rltStr = rltStr.replace(reg, value); } } return callback(rltStr); } })(); // 引入元素插入 (function () { if (typeof UM === "undefined") { return; } // 调用函数封装 function fnBlockQute() { umObj = UM.getEditor("message"); umObj.focus(true); umObj.execCommand( "insertHtml", `<blockquote class="blockquote"><p><br></p> </blockquote><p><br></p>` ); } // 添加引用按钮 $("head").append('<style>.edui-icon-blockquote:before{content:"\\f10d";}'); (() => { const $btn = $.eduibutton({ icon: "blockquote", click: function () { fnBlockQute(); }, title: UM.getEditor("message").getLang("labelMap")["blockquote"] || "", }); $(".edui-btn-name-insertcode").after($btn); })(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址