您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click to copy equation in Wikipedia
当前为
// ==UserScript== // @name 一键复制公式 // @namespace http://tampermonkey.net/ // @version 0.2 // @description Click to copy equation in Wikipedia // @author flaribbit // @match http://*.wikipedia.org/* // @match https://*.wikipedia.org/* // @match https://www.zhihu.com/question/* // @match https://zhuanlan.zhihu.com/p/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... window.tempbox=document.createElement("input"); document.body.appendChild(window.tempbox); let host=document.location.host; if(host.search('wikipedia')>0){ let copyTex=function(){ window.tempbox.value='$'+this.alt+'$'; window.tempbox.select(); document.execCommand('copy'); } let eqs=document.getElementsByClassName("mwe-math-fallback-image-inline"); for(let i=0;i<eqs.length;i++){ eqs[i].onclick=copyTex; eqs[i].title='点击即可复制公式'; } }else if(host.search('zhihu')>0){ let copyTex=function(){ window.tempbox.value='$'+this.getAttribute("data-formula")+'$'; window.tempbox.select(); document.execCommand('copy'); } let imgs=document.getElementsByTagName("img"); for(let i=0;i<imgs.length;i++){ if(imgs[i].alt){ imgs[i].onclick=copyTex; imgs[i].title='点击即可复制公式'; } } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址