精簡MOJi辭書

A Tampermonkey browser script is used to make MOJiDict more streamlined to use.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         精简MOJi辞书
// @name:ja      簡潔MOJi辞書
// @name:zh-TW   精簡MOJi辭書
// @namespace    https://github.com/scarletkc/StreamlineMOJiDict
// @version      1.0
// @description  A Tampermonkey browser script is used to make MOJiDict more streamlined to use.
// @description:zh-TW  A Tampermonkey browser script is used to make MOJiDict more streamlined to use.
// @description:ja  A Tampermonkey browser script is used to make MOJiDict more streamlined to use.
// @author       Kc
// @match        *://www.mojidict.com/search
// @match        *://www.mojidict.com/
// @license      GPL-3.0 License
// ==/UserScript==

(function() {
    'use strict';
    var counters = 0;

    function DeleteDiv(className) {
        var elements = document.getElementsByClassName(className);
        var loop = setInterval(function(){            
            if(elements.length > 0) {              
                for (var i = 0; i < elements.length; i++) {
                    elements[i].remove();
                } 
                clearInterval(loop);
            }
            else{
                counters++;
                if(counters > 10){ 
                    clearInterval(loop);
                }
            }
        },3000);  
    }

    DeleteDiv("advertising-banner");
    DeleteDiv("sidebar-container hidden_scrollbar sidebar hidden_scrollbar");
    DeleteDiv("sidebar-container hidden_scrollbar sidebar hidden_scrollbar isfold");
    DeleteDiv("header-basic sideBarisfold");
    DeleteDiv("header-basic");
    DeleteDiv("footer-main");
    DeleteDiv("feedback-container");
    
})();