Youtube - Video Player Bar Simplified

Youtube Video Player Bar Simplified. Removed "Next", "Auto Play", "Mini Player" Buttons. YT播放栏简化,移除了“播放下一个”,“自动播放”,“迷你窗口”按钮。

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Youtube - Video Player Bar Simplified
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Youtube Video Player Bar Simplified. Removed "Next", "Auto Play", "Mini Player" Buttons. YT播放栏简化,移除了“播放下一个”,“自动播放”,“迷你窗口”按钮。
// @author       Martin______X
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @license      MIT
// ==/UserScript==

let __$videoId = "";
//Loop
const videoIdCheckVBInterval = setInterval(() => {
    let video_des = document.getElementsByClassName("watch-active-metadata style-scope ytd-watch-flexy style-scope ytd-watch-flexy")[0];
    let videoId = "";
    if (video_des) {
        videoId = video_des.getAttribute("video-id");
    }
    if (__$videoId != videoId) {
        let count = 0;
        let nextButton;
        let buttons = document.getElementsByClassName("ytp-next-button ytp-button");
        for (let i = 0; i < buttons.length; i++) {
            let temp = buttons[i];
            let e1 = temp.hasAttribute("data-title-no-tooltip");
            let e2 = temp.hasAttribute("aria-keyshortcuts");
            let e3 = temp.hasAttribute("data-duration");
            let e4 = temp.hasAttribute("data-preview");
            let e5 = temp.hasAttribute("title");
            if (e1 && e2 && e3 && e4 && e5) {
                nextButton = temp;
            }
        }
        if (nextButton) {
            nextButton.style.visibility = "hidden";
            count++;
        }
        let autoPlayButton = document.querySelector("[data-tooltip-target-id=ytp-autonav-toggle-button]");
        if (autoPlayButton) {
            autoPlayButton.style.visibility = "hidden";
            count++;
        }
        let miniButton = document.querySelector("[data-tooltip-target-id=ytp-miniplayer-button]");
        if (miniButton) {
            miniButton.style.visibility = "hidden";
            count++;
        }
        if (count >= 3) {
            console.warn("Unnecessary Buttons Has Hidden!");
            __$videoId = videoId;
        }
    }
}, 100);