Skip to content

Instantly share code, notes, and snippets.

@Hunlongyu
Last active January 23, 2024 10:40
Show Gist options
  • Save Hunlongyu/2d7cc7db66b79831c3af23cc52a85845 to your computer and use it in GitHub Desktop.
Save Hunlongyu/2d7cc7db66b79831c3af23cc52a85845 to your computer and use it in GitHub Desktop.
『净网卫士』 百度翻译
// ==UserScript==
// @name 『净网卫士』 百度翻译
// @author Hunlongyu
// @namespace https://github.com/Hunlongyu
// @icon https://i.loli.net/2019/04/22/5cbd720718fdb.png
// @description 页面精简,去除广告,只保留主要功能的部分。
// @version 0.1.11
// @match *://fanyi.baidu.com/*
// @grant GM_addStyle
// @grant GM_log
// @run-at document-start
// @supportURL https://gist.github.com/Hunlongyu/2d7cc7db66b79831c3af23cc52a85845
// @note 2019/09/05 移除第一次进入百度翻译时,弹出的向导弹框
// @note 2020/07/28 移除按钮
// @note 2022/03/04 隐藏新版头部导航
// @note 2023/06/07 隐藏 app 推广、领域、评价
// @note 2023/07/13 隐藏 桌面端软件推广
// ==/UserScript==
(function () {
'use strict'
let 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;}
.ai-trans-btn{display: none !important;}
`
try {
GM_addStyle(css)
} catch (e) {
GM_log(new Error('GM_addStyle stopped working!'))
}
})()
@ningpengfei
Copy link

666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment