您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在微软文档的右侧加一个快速切换中英文的按钮
// ==UserScript== // @name 微软文档中英文切换 // @version 1.3 // @description 在微软文档的右侧加一个快速切换中英文的按钮 // @match https://*.microsoft.com/zh-cn/* // @match https://*.microsoft.com/zh-CN/* // @match https://*.microsoft.com/en-us/* // @match https://*.microsoft.com/zh-tw/* // @icon https://www.microsoft.com/favicon.ico // @run-at document-body // @namespace https://greasyfork.org/users/728259 // ==/UserScript== (function() { var href = window.location.href; var div = document.createElement('div'); div.style.position = 'fixed'; div.style.top = '25vh'; div.style.right = '0'; var button = document.createElement('button'); button.type='button'; button.style.height = '2.5em'; button.style.width = '5em'; button.style.opacity = '0.4'; button.style.borderStyle = 'none'; if(href.match(/\/en-us\//i)){ button.innerText = '中文'; button.onclick = () => { window.location.href = href.replace(/\/en-us\//i, "/zh-cn/"); }; } else if (href.match(/\/zh-cn\//i)) { button.innerText = '英文'; button.onclick = () => { window.location.href = href.replace(/\/zh-cn\//i, "/en-us/"); }; } else if (href.match(/\/zh-tw\//i)) { button.innerText = '英文'; button.onclick = () => { window.location.href = href.replace(/\/zh-tw\//i, "/en-us/"); }; } div.appendChild(button); document.body.appendChild(div); })();