Greasy Fork

百度翻译精简脚本

去除百度翻译无用内容,保留主要翻译功能。

目前为 2022-09-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         百度翻译精简脚本
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  去除百度翻译无用内容,保留主要翻译功能。
// @author       Loyal-Wind
// @match        https://fanyi.baidu.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=baidu.com
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

(function () {
  'use strict'
GM_addStyle('#left-result-container{display:none !important}')
  const website = [
    {
        name: 'baidu',
        css: `
            .op-favo, .collection-btn, .correct-txt, .note-expand-btn, .navigation-wrapper, .domain-trans-wrapper, .header, .footer, .trans-other-right, .manual-trans-btn{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)
    }
  }
})()