您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
查看微博编辑记录比对上下文修改
当前为
// ==UserScript== // @name 微博编辑记录对比 // @version 1.0 // @match https://weibo.com/* // @namespace weibo-diff // @run-at document-start // @description 查看微博编辑记录比对上下文修改 // @author C-racker // @grant unsafeWindow // @require https://cdn.bootcdn.net/ajax/libs/jsdiff/5.1.0/diff.min.js // @license MIT // ==/UserScript== (function () { const originOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (_, url) { if (/\/ajax\/statuses\/editHistory/.test(url)) { const xhr = this; const getter = Object.getOwnPropertyDescriptor( XMLHttpRequest.prototype, "response" ).get; Object.defineProperty(xhr, "responseText", { get: () => { let result = getter.call(xhr); try { const _res = JSON.parse(result); const res = JSON.parse(result); let text = ""; for (let i = _res.statuses.length - 1; i >= 0; i--) { if (i === 0 || !_res.statuses[i].cardid) { break; } const diff = Diff.diffChars( _res.statuses[i].text, _res.statuses[i - 1].text ); diff.forEach((part) => { text += part.added ? `<span style="color:green">${part.value}</span>` : part.removed ? `<span style="color:red">${part.value}</span>` : part.value; }); res.statuses[i - 1].text = text; text = ""; } return JSON.stringify(res); } catch (e) { return result; } }, }); } originOpen.apply(this, arguments); }; })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址