隐藏B站视频播放中的推荐视频

寸金难买寸光阴

// ==UserScript==
// @name         隐藏B站视频播放中的推荐视频
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  寸金难买寸光阴
// @author       You
// @match        *://www.bilibili.com/video*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    //window.addEventListener('load', ()=>{
        const newStyle = document.createElement("style")
        newStyle.innerHTML = `
        .r-con {
            visibility: hidden;
        }

        .bpx-player-ending-panel{
            display: none !important;
        }

        `
        document.head.appendChild(newStyle)
        localStorage.setItem("recommend_auto_play", "close")
    //})


    var intv = setInterval(()=>{
        var rcon = document.getElementsByClassName("right-container")[0]
        var rconLis = rcon.childNodes
        if(rcon != void 0){
            clearInterval(intv)
            setTimeout(()=>{
                rcon.style.visibility = "visible"
                while(rconLis.length != 2){
                     rconLis[rconLis.length-1].remove()
                 }
            }, 5000)
        }
    }, 300)
    // Your code here...
})();