百度去广告+美化

清洁百度搜索引擎的广告

目前為 2021-06-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name         百度去广告+美化
// @namespace    https://www.huankong.top/
// @version      1.25
// @description  清洁百度搜索引擎的广告
// @author       幻空
// @match        https://www.baidu.com/*
// @match        https://fanyi.baidu.com/*
// @icon         https://www.huankong.top/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    //初始化变量
    let vm = 0;
    //浏览器窗口大小变化时
    window.onresize = function(){
        size();
        fresh();
    };
    function size(){
        vm = $(window).width()/100;
        console.log(vm);
    }
    //监听页面内容是否刷新
    $("#wrapper_wrapper").bind('DOMNodeInserted', function(e) {
        fresh();
    });
    function fresh(){
        //百度搜索
        $("#content_right").css({display:"none"});
        $(".s_form_wrapper").css({position:"relative",left:25*vm + "px"});
        $(".s_tab_inner").css({position:"relative",left:25*vm+"px",width:"720px"});
        $("#container").css({left:25*vm+"px"});
        $(".ec_tuiguang_pplink").parent().parent().css({display:"none"});
        $("#page").css({height:"140px"});
        $(".page-inner").css({position:"relative",left:25*vm+"px",width:29*vm+"px",lineHeight:"140px",height:"110px"});
        $("#u").css({display:"none"});
        $("#foot").css({display:"none"});
        //百度翻译
        $(".header").css({display:"none"});
        $(".manual-trans-btn").css({display:"none"});
        $(".translate-setting").css({display:"none"});
        $(".domain-trans-wrapper").remove();
        $(".footer").remove();
        $(".trans-other-right").remove();
        $("#left-result-container").bind('DOMNodeInserted', function() {
            $("#app-read").remove();
        });
        $(".translateio").css({position:"relative",top:"15px"});
        $(".trans-operation").css({marginLeft:16.207455429497568*vm+"px"});
    }
    //在百度首页时
    if(window.location.href === "https://www.baidu.com/"){
        //去除百度首页的广告
        $("#s_wrap").css({display:"none"});
        //去除首页下滑时出现的导航栏bug
        $(".s-top-nav").remove();
    }else{
        //页面加载完成
        size();
        fresh();
    }
})();

QingJ © 2025

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