Greasy Fork

屏蔽百度搜索右边栏热搜

屏蔽百度搜索热搜

// ==UserScript==
// @name         屏蔽百度搜索右边栏热搜
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  屏蔽百度搜索热搜
// @author       reallybigmistake
// @match        https://www.baidu.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = () => {
        var p;
        var cnt = 0;
        var cnt2 = 0;
        function clear(){
            clearInterval(p);
        }
        p = setInterval(function(){
            cnt++;
            console.log('hello ' + cnt);
            var hs = document.getElementById("content_right");
            if(cnt > 20){
                clear();
            }
            if(hs){
                hs.remove();
                clear();
            }
        }, 100);
        setInterval(function(){
            console.log(cnt2++);
            var hs = document.getElementById("content_right");
            if(hs){
                hs.remove();
            }
        }, 1000);
    };
})();