您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
双倍文字,双倍快乐; 单行变双行,原文档一行,翻译一行
当前为
// ==UserScript== // @name 双倍快乐 // @author xcl & Zilewang7(啥也没做) // @description 双倍文字,双倍快乐; 单行变双行,原文档一行,翻译一行 // @version 0.0.1 // @match *://*/* // @namespace http://greasyfork.icu/users/513536 // ==/UserScript== (function () { "use strict"; let isPressed = false; const duplicateBtn = document.createElement("button"); duplicateBtn.style.backgroundColor = "skyblue"; duplicateBtn.style.zIndex = 10000; duplicateBtn.style.opacity = 0.5; duplicateBtn.style.width = '88px !important'; duplicateBtn.style.height = '30px !important'; duplicateBtn.style.position = "fixed !important"; duplicateBtn.style.top = "50px !important"; duplicateBtn.style.left = "-78px !important"; duplicateBtn.style.transition = 'all 0.3s !important'; duplicateBtn.onmouseover = () => { duplicateBtn.style.opacity = 1; duplicateBtn.innerHTML = "双倍文字"; duplicateBtn.style.left = 0; }; duplicateBtn.onmouseleave = () => { duplicateBtn.style.opacity = 0.5; duplicateBtn.innerHTML = ""; duplicateBtn.style.left = "-78px !important"; }; document.body.appendChild(duplicateBtn); duplicateBtn.onclick = () => { if (isPressed) return; for (const node of document.querySelectorAll("p")) { const copy = document.createElement(node.nodeName); copy.textContent = node.textContent; node.parentElement.insertBefore(copy, node.nextElementSibling); node.setAttribute("translate", "no"); } let Title = "h"; for (let i = 1; i <= 6; i++) { let h = "h" + i; document.querySelectorAll(h).forEach((node) => { const copy = document.createElement(node.nodeName); copy.textContent = node.textContent; node.parentElement.insertBefore(copy, node.nextElementSibling); node.setAttribute("translate", "no"); }); } document.querySelectorAll("a").forEach((node) => { const copy = document.createElement(node.nodeName); copy.textContent = node.textContent; node.parentElement.insertBefore(copy, node.nextElementSibling); node.setAttribute("translate", "no"); }); isPressed = true; }; })();