Youtube - Video Player Bar Simplified

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);