BaiduGreener

make Baidu Green

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         BaiduGreener
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  make Baidu Green
// @match        https://*.baidu.com/*
// @author       VNVILE
// @license MIT
// ==/UserScript==
var idList = ['novel-ranking', 'celebrity', 'j_navtab_game', 'moreConfigNavtab','s_main'];
var classList = ['.tbui_aside_float_bar', '.app_download_box', '.topic_list_box', '.more-config-navtab.j_tbnav_tab',];


(function() {
    'use strict';
    clearById(idList);
    clearByClass(classList);

})();





function clearById(idList) {
    for (let i in idList) {
        try {
            document.getElementById(idList[i]).style.cssText = 'display: none';
            console.log(i + ' DEL(byId): ' + idList[i]);
        } finally {
            continue;
        }

    }
}
function clearByClass(classList) {
    for (let i in classList) {
        try {
            document.querySelector(classList[i]).style.cssText = 'display: none';
            console.log(i + ' DEL(byClass): ' + classList[i]);
        } finally {
            continue;
        }
    }

}