根据 43# 简化后,最新:
// ==UserScript==
// @name zihu_ltx_cpy
// @namespace http://tampermonkey.net/
// @version 0.5
// @description for zihu ltx cpy
// @author kk, hbghlyj
// @match https://www.zhihu.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var mybutton,beasetag;
mybutton = document.createElement("div");
beasetag = document.querySelector("body");
beasetag.appendChild(mybutton);
mybutton.innerHTML = "$ 代码 $";
mybutton.style = "position:fixed;bottom:30px;left:30px;width:100px;height:100px;background:black;opacity:0.5;color:white;text-align:center;line-height:100px;cursor:pointer;";
mybutton.onclick = function(){
document.querySelectorAll('img[data-formula]').forEach((a)=>(a.alt='$'+a.dataset.formula+'$'))
};
})();
试了一下应该没问题 |