Purify Baidu

Purify Your Baidu Homepage

目前为 2021-02-01 提交的版本。查看 最新版本

// ==UserScript==
// @name         Purify Baidu
// @namespace    HangLark
// @version      0.1.1
// @description  Purify Your Baidu Homepage
// @author       HangLark
// @match        https://www.baidu.com/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Delete useless elements
    console.log("By HangLark");
    var bottom_layer=document.getElementById("bottom_layer");
    bottom_layer.remove();
    var s_top_wrap=document.getElementById("s_top_wrap");
    s_top_wrap.remove();

    // Hide scrollbar
    var style = document.createElement("style");
    style.innerHTML = `body::-webkit-scrollbar {display: none;}`;
    document.head.appendChild(style);

    // Nickname clear
    var nickname_bar=document.getElementById("s-top-username");
    var nickname=nickname_bar.childNodes[1];
    nickname.innerText="     ";
    console.log(nickname.innerText);

    function createSite(bar,title,address){//Create website element
        var site= document.createElement("a");
        site.href=address;
        site.target="_blank";
        site.className="mnav c-font-normal c-color-t";
        site.innerHTML=title;
        bar.appendChild(site);
    }

    // Customize navigation bar
    var navigation_bar=document.getElementById("s-top-left");
    var navigation_list=navigation_bar.childNodes;
    for(var i=0;i<=7;i++){
        navigation_bar.removeChild(navigation_list[0]);
    }

    //设置自己的网址
    //createSite(navigation_bar,网址名,网址)
    createSite(navigation_bar,"Map","https://map.baidu.com/");
    createSite(navigation_bar,"Mail QQ","https://mail.qq.com/");
    createSite(navigation_bar,"Bilibili","https://www.bilibili.com/");
    createSite(navigation_bar,"Game Streaming","https://www.douyu.com/");

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址