mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
1019 B
JavaScript
1 line
1019 B
JavaScript
(()=>{return(t,i)=>{const n=[`a.read-more[href*='t.bilibili.com']`,`.link-navbar a[href*='t.bilibili.com']`,`.bili-header-m .nav-menu .nav-con .nav-item [href*='t.bilibili.com']`];const o=`https://www.bilibili.com/account/dynamic`;const e=`https://t.bilibili.com/`;const c=()=>{for(const t of n){SpinQuery.any(()=>document.querySelectorAll(t),t=>t.forEach(t=>t.setAttribute("href",o)))}};SpinQuery.select(".dynamic-m .wnd_bottom .r-l").then(t=>{if(t!==null){Observer.childList(".dynamic-m .wnd_bottom .r-l",c)}});c();const s=location.host==="t.bilibili.com";return{widget:{condition:()=>{return document.URL.startsWith(e)||document.URL.startsWith(o)},content:`\n <button class="gui-settings-flat-button" id="old-tweets">\n <i class="mdi mdi-24px mdi-swap-horizontal-variant"></i>\n <span>${s?"回到旧版":"转到新版"}</span>\n </button>`,success:()=>{const t=document.querySelector("#old-tweets");t.addEventListener("click",()=>{location.assign(s?o:e)})}}}}})(); |