去除有道翻译上边功能tab及弹窗

有道翻译打开后有很多用不到的功能,只想简单的进行中英文转换,此插件可以有效去除有道翻译上边功能tab及弹窗,进入页面后干净整洁

// ==UserScript==
// @name         去除有道翻译上边功能tab及弹窗
// @namespace    小冰鸡
// @version      0.1
// @description  有道翻译打开后有很多用不到的功能,只想简单的进行中英文转换,此插件可以有效去除有道翻译上边功能tab及弹窗,进入页面后干净整洁
// @match        *://fanyi.youdao.com/*
// @author       小冰鸡
// @match        *://*/*
// @grant        none
// @license MIT

// ==/UserScript==

(function() {
    'use strict';
    function customFun() {
        let timer = setInterval(function () {
            let dom = document.querySelector(".tab-header");
            if (dom) {
                clearInterval(timer);
                dom.style.display = 'none'
                let removeList = ['.sidebar-inner-container','.header-content','.top-banner-outer-container','.banner-outer-container','.document-upload-entrance-container','.sidebar-container','.dict-website-footer']
                removeList.forEach(domName=>{
                   let dom = document.querySelector(domName)
                   if(dom) dom.style.display = 'none'
                })
            }
            let dialog = document.querySelector(".pop-up-comp")
            if(dialog){
                let ad = document.querySelector(".pop-up-comp .inner-content .ad")
                dialog.style.display = 'none'
            }
        }, 20);
    }
        customFun();
})();