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