【美化】videoTogther嵌入自己的Alist中并优化

发布时间 2023-05-02 13:00:53作者: Tnxts

将下面的代码加到设置->全局->自定义头部里

image-20230502124943483

<script>
    // 排除登陆与后台页面
    if(document.location.pathname.substr(1,6) != "@login" && document.location.pathname.substr(1,7) != "@manage" )
    {
        // 动态引入videoTogther
        setTimeout(() => {
            const script = document.createElement("script");
            script.src = "https://2gether.video/release/extension.website.user.js";
            document.body.appendChild(script);
            
            // 将图标放到右下角,防止与alist的控制栏重叠
            setTimeout(() => {
                const video2getherIcon = document.querySelector("#VideoTogetherWrapper").shadowRoot.querySelector("#videoTogetherSamllIcon")
                video2getherIcon.style.cssText = "left: var(--hope-space-5);right: auto;"
                const video2getherPanel = document.querySelector("#VideoTogetherWrapper").shadowRoot.querySelector("#videoTogetherFlyPannel")
                video2getherPanel.style.cssText = "left: var(--hope-space-5);right: auto; display:none;"
            }, 500);
            
        }, 1000);
    }
</script>