mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
750 B
JavaScript
1 line
750 B
JavaScript
(()=>(e,t)=>{const n=async()=>{const e=await SpinQuery.select(".bpx-player-container");if(!e){console.warn("[bpx player polyfill] bpxContainer not found");return}Observer.attributes(e,(()=>{const t=e.getAttribute("data-screen");document.body.classList.toggle("player-mode-webfullscreen",t==="full"||t==="web");document.body.classList.toggle("player-mode-widescreen",t==="wide")}))};const i=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.ep));if(!e){console.warn("[bpx player polyfill] ep not found");return}Object.assign(unsafeWindow,{aid:e.aid.toString(),cid:e.cid.toString(),bvid:e.bvid})};const o=async()=>{if(!document.URL.startsWith("https://www.bilibili.com/bangumi/play/")){return}n();i()};return{export:{bpxPlayerPolyfill:o}}})(); |