// ==UserScript== // @name 百度优化去广告+Moe背景/自定义网页背景图片 // @namespace ??? // @version 1.0.8 // @description 建议使用stylus插件加载css,虽然油猴也行。已适配手机端 // @author yui // @grant GM_addStyle // @run-at document-start // @match *://*.baidu.com/* // @match https://www.baidu.com/* // @downloadURL none // ==/UserScript== (function() { let css = ""; if ((location.hostname === "baidu.com" || location.hostname.endsWith(".baidu.com"))) { css += ` body:before { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -100; background-image: url(https://i0.hdslb.com/bfs/album/18bb3416bc1177f2a98dce92dd02596d29a15226.jpg); background-position: center ; background-size: cover; background-attachment: fixed; background-repeat: no-repeat; opacity: .2 } .FYB_RD, .se-ft-promlink, .c-line-clamp1{display: none} #head{background: rgba(0,0,0,0);} #form{background: rgba(255, 255, 255, .2);} #rs,#page-relative{opacity: .4} .bdsug{background: rgba(255, 255, 255, .8);} .wrapper_new .sam_newgrid~#page {background-color: rgba(0,0,0,0);} .wrapper_new #foot {background-color: rgba(0,0,0,0);} .wrapper_new #foot #help {background-color: rgba(0,0,0,0);} body .se-page-hd {background: rgba(0,0,0,0);} #page-bd, .se-head-tablink,.c-container, .se-page-controller .new-pagenav, .se-page-copyright, .se-page-ft {background: rgba(0,0,0,0);} .banner{opacity:0!important} .se-form{background: rgba(0,0,0,0)} `; } if (location.href.startsWith("https://www.baidu.com/")) { css += ` /*百度首页优化*/ #s_wrap,#bottom_layer,.s-top-nav{display: none!important} #s_top_wrap{background: rgba(0,0,0,0);} #form{opacity:.5} #lg{opacity:0}`; } if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();