Bilibili-Evolved/min/bvid-convert.min.js
2020-03-23 22:05:13 +08:00

1 line
657 B
JavaScript

(()=>{return(i,n)=>{return{widget:{content:`<div class="bvid-convert"></div>`,condition:async()=>{if(["https://www.bilibili.com/video/","https://www.bilibili.com/bangumi/"].some(i=>document.URL.startsWith(i))){return Boolean(await SpinQuery.select(()=>unsafeWindow.aid||unsafeWindow.bvid))}else{return false}},success:()=>{n.applyStyle("bvidConvertStyle");const i=dq(".bvid-convert");const e=(()=>{if(unsafeWindow.bvid){return unsafeWindow.bvid}const i=dq(".av-link,.bv-link,.bvid-link");return i.innerHTML||"未找到BV号"})();i.innerHTML=`\n<div class="bvid-convert-item">av${unsafeWindow.aid}</div>\n<div class="bvid-convert-item">${e}</div>\n`}}}}})();