Greasy Fork is available in English.
2022/2/19 下午2:46:37
当前为
// ==UserScript==
// @name 彩云小译脚本修复版
// @namespace Violentmonkey Scripts
// @match *://*/*
// @version 1.0
// @author guzz
// @description 2022/2/19 下午2:46:37
// @include https://*
// @include http://*
// @exclude *://*.google*/*
// @exclude *://*.cn/*
// @exclude *://*.baidu.com/*
// @exclude *://*.qq.com/*
// @exclude *://*.bilibili.com/*
// @exclude *://*.jianshu.com/*
// @exclude *://*sspai.com/*
// @exclude *://*zhihu/*
// @exclude *://*acfun/*
// @exclude *://*csdn/*
// @exclude *://*china/*
// @grant GM_registerMenuCommand
// @license MIT
// @note 2022年2月19日 更改自 彩云小译脚本 修复某些网站不能翻译
// ==/UserScript==
document.addEventListener('keydown', keydownEvent);
function keydownEvent(e) {
if(e.key==';'&&!(e.metaKey || e.ctrlKey) && e.altKey ){
if(['input','text','textarea'].includes(e.target.tagName.toLowerCase())){
return
}
translation();
}
}
GM_registerMenuCommand("翻译当前网页",translation);
function translation() {
var cyfy = document.createElement("script");
cyfy.type = "text/javascript";
cyfy.charset = "UTF-8";
cyfy.src = ("https:" == document.location.protocol ? "https://" : "http://") + "caiyunapp.com/dest/trs.js";
document.body.appendChild(cyfy);
var c='.cyxy-personal{display:none}.cyxy-favorite{display:none}.cyxy-function{display:none}#asdazcasdiovb{position:fixed;bottom:0;right:0;width:50px}';
var ele1=document.createElement("style");
ele1.innerHTML=c;
document.getElementsByTagName('head')[0].appendChild(ele1)
var p = document.createElement("p");
p.innerHTML='<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAAWCAYAAABkKwTVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADrSURBVFhH7ZTRCcMwDEQ7TZftdl0hO/SvpLhgOB6SrMZ2wSEfD0s6yfbhkNv7te1n5TK3Kpe5Hu6P5xdLI9m+LKG5erEM3pzWVWOsusYeOuMx5OX0sJ74SB4x3JzmXKlbmoW3T4vmZ2nVCS8boT2cjcj2KcPNac61xlpnXHOFPdQ9hv9QemJLox7VyZCX+xXdl2d4Zx65yxRzZY5QY6w6c6J6xDRzrZW1CvNWPeLvL1d1K9Y8mskyzJz28oLcx+rVXOcidM5imjkS9Xpaph4RmiuUTbPoDPfQuOYat8j2KU1zK3OZW5UTm9v2D+YFKhrcs62yAAAAAElFTkSuQmCC" />'
p.id='asdazcasdiovb';
document.body.appendChild(p);
setTimeout(()=>{
document.querySelector('#asdazcasdiovb').hidden=true;
},3000)
}