Last active
January 10, 2024 01:40
-
-
Save Hunlongyu/fbd80bac47b8a2aba216fe5c3399b464 to your computer and use it in GitHub Desktop.
精简页面,移除广告,优化布局。适配:百度翻译、谷歌翻译、有道翻译、金山词霸、必应翻译、搜狗翻译、DeepL翻译。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 『净网卫士』 在线翻译 | |
// @author Hunlongyu | |
// @namespace https://github.com/Hunlongyu | |
// @icon https://i.loli.net/2019/04/22/5cbd720718fdb.png | |
// @description 精简页面,移除广告,优化布局。适配:百度翻译、谷歌翻译、有道翻译、金山词霸、必应翻译、搜狗翻译、DeepL翻译。 | |
// @version 0.2.0 | |
// @match *://fanyi.baidu.com/* | |
// @match *://*.iciba.com/translate | |
// @match *://translate.google.com/* | |
// @match *://fanyi.youdao.com/* | |
// @match *://*.bing.com/translator* | |
// @match *://fanyi.sogou.com/* | |
// @match *://*.deepl.com/translator | |
// @grant GM_addStyle | |
// @run-at document-start | |
// @supportURL https://gist.github.com/Hunlongyu/fbd80bac47b8a2aba216fe5c3399b464 | |
// ==/UserScript== | |
(function () { | |
'use strict' | |
const website = [ | |
{ | |
name: 'baidu', | |
css: ` | |
#header{display:none !important;} | |
.collection-btn{display: none !important;} | |
.footer{display: none !important;} | |
.manual-trans-btn{display: none !important;} | |
.trans-other-right{display: none;} | |
#app-read{display: none !important;} | |
.app-guide{display: none !important;} | |
.trans-domain-btn{display: none !important;} | |
.op-trans-fb{display: none !important;} | |
.domain-trans-wrapper{display: none !important;} | |
.select-to-language:after{display: none !important;} | |
.desktop-guide-wrapper{display: none !important;} | |
` | |
}, | |
{ | |
name: 'iciba', | |
css: ` | |
nav{display: none !important;} | |
` | |
}, | |
{ | |
name: 'google', | |
css: ` | |
.app-download-bar, #gb{display: none !important;} | |
` | |
}, | |
{ | |
name: 'youdao', | |
css: ` | |
.top, .banner, .footer, .sticky-sidebar{ | |
display:none !important; | |
} | |
.index{ | |
background: url("") !important; | |
} | |
` | |
}, | |
{ | |
name: 'bing', | |
css: ` | |
.desktop_header, .desktop_header_menu, #b_footer{display: none !important;} | |
#tt_translatorHome{width: 96% !important;} | |
` | |
}, | |
{ | |
name: 'sogou', | |
css: ` | |
.translate-pc-header, .header-pc, .trans-type, .img-banner, .footer-pc{display: none !important;} | |
.trans-box{margin-top: 20px;} | |
` | |
}, | |
{ | |
name: 'deepl', | |
css: ` | |
[data-testid="dl-footer"], [data-testid="write-promo-banner"], [data-testid="pro_ad_content"], [data-testid="app_banner_content"], | |
[data-testid="dl-header"], aside, #cookieBanner{ | |
display: none !important; | |
} | |
` | |
} | |
] | |
let url = window.location.href | |
for (let i = 0; i < website.length; i++) { | |
if (url.indexOf(website[i].name) !== -1) { | |
return GM_addStyle(website[i].css) | |
} | |
} | |
})() |
百度翻译中有时需要切换水利、生物等翻译领域,开启脚本后无法更换,请问有解决的办法嘛
百度翻译中有时需要切换水利、生物等翻译领域,开启脚本后无法更换,请问有解决的办法嘛
@YuDi0-0 你可以在脚本中删除以下内容。
.domain-trans-wrapper{display: none !important;}
非常感谢
发件人: Scomarlf ***@***.***>
发送时间: 2023年1月2日 13:03
收件人: Scomarlf ***@***.***>
抄送: Mention ***@***.***>
主题: Re: Hunlongyu/fanyi.user.js
@Scomarlf commented on this gist.
…_____
百度翻译中有时需要切换水利、生物等翻译领域,开启脚本后无法更换,请问有解决的办法嘛
@YuDi0-0 <https://github.com/YuDi0-0> 你可以在脚本中删除以下内容。
.domain-trans-wrapper{display: none !important;}
—
Reply to this email directly, view it on GitHub <https://gist.github.com/fbd80bac47b8a2aba216fe5c3399b464#gistcomment-4420791> or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARPNDQ4GOZQKHLBF3SWEMN3WQJOP5BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVA4TONBUGI3TINFHORZGSZ3HMVZKMY3SMVQXIZI> .
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有道翻译
保留必要的 header 和 footer 。
因无法提交 PR ,所以采用此方式,请 review 。