Bilibili-Evolved/style/new-styles.min.js
2018-07-16 19:38:22 +08:00

2 lines
620 B
JavaScript

function newStyle(settings){waitForQuery()(()=>$(".nav-search-keyword"),it=>it.length>0,textBox=>textBox.attr("placeholder","搜索")),waitForQuery()(()=>$(".custom-scrollbar"),it=>it.length>0,it=>it.removeClass("custom-scrollbar"));const navbar=document.getElementsByClassName("bili-wrapper")[0];let stardustStyles=!1;navbar instanceof Element&&(stardustStyles=50===parseInt(window.getComputedStyle(navbar).height));let styles="";styles=`<style id='bilibili-new-style'>${styles=stardustStyles?getStyle("style",settings):getStyle("oldStyle",settings)}</style>`,$("#bilibili-new-style").remove(),$("body").after(styles)}