mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
1.1 KiB
JavaScript
1 line
1.1 KiB
JavaScript
(()=>(e,n)=>{if(document.URL.replace(window.location.search,"")==="https://www.bilibili.com/"){SpinQuery.select(".eva-extension-area").then((e=>{e.parentElement.style.margin="12px"}));SpinQuery.any((()=>dqa(".gg-pic")),(n=>{n.forEach((n=>{const t=n.parentElement;t.style.display="none";const l=[...t.parentElement.childNodes].indexOf(t)+1;const i=t.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(i){i.style.display="flex";const n=i.querySelector("a:not(.more-text)");n.insertAdjacentHTML("afterend",`\n<div class="blocked">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);n.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}}))}));SpinQuery.select(".focus-carousel.home-slide").then((n=>{if(!n){return}[...n.querySelectorAll(".gg-icon,.bypb-icon")].map((e=>e.parentElement.parentElement)).forEach((n=>{n.style.display="none";n.insertAdjacentHTML("afterend",`\n<div class="blocked new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)}))}))}addSettingsListener("preserveEventBanner",(e=>{document.body.classList.toggle("preserve-event-banner",e)}),true)})(); |