mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
942 B
JavaScript
1 line
942 B
JavaScript
(()=>(e,t)=>{(async()=>{if(document.URL.replace(window.location.search,"")!=="https://t.bilibili.com/"&&!document.URL.startsWith("https://space.bilibili.com")){return}const{forEachFeedsCard:e}=await t.importAsync("feeds-apis");t.applyImportantStyle("foldCommentStyle");const n=e=>{const t=t=>{const n=document.createElement("div");n.classList.add("fold-comment");n.innerHTML="收起评论";const l=t.querySelector(".bb-comment");if(l===null){console.error("未找到评论区");return}else if(l.querySelector(".fold-comment")!==null){return}else{n.addEventListener("click",(()=>{const t=e.querySelector(".button-bar").children[1];if(t!==null){t.click();e.scrollIntoView()}}));l.insertAdjacentElement("beforeend",n)}};const n=e.querySelector(".panel-area");if(n===null){console.log(e)}if(n.childElementCount===0){const e=Observer.childList(n,(l=>{if(l.length>0){t(n);e.forEach((e=>e.stop()))}}))}else{t(n)}};e({added:e=>n(e.element)})})()})(); |