Remove YouTube Video End Screen Thumbnails

Remove YouTube video end screen thumbnails that cover the end of the video

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Remove YouTube Video End Screen Thumbnails
// @namespace    https://www.example.com/
// @version      1
// @description  Remove YouTube video end screen thumbnails that cover the end of the video
// @author       ChatGPT fr fr
// @match        https://www.youtube.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.type === 'childList') {
                mutation.addedNodes.forEach(function(node) {
                    if (node.nodeName === 'DIV' && node.classList.contains('ytp-ce-element')) {
                        node.remove();
                    }
                });
            }
        });
    });

    observer.observe(document.body, { childList: true, subtree: true });

    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = `
        .ytp-ce-covering-overlay,
        .ytp-ce-element-shadow,
        .ytp-ce-covering-image,
        .ytp-ce-expanding-image,
        .ytp-ce-element.ytp-ce-video.ytp-ce-element-show,
        .ytp-ce-element.ytp-ce-channel.ytp-ce-channel-this,
        .ytp-ce-element-overlay {
            display: none !important;
            visibility: hidden !important;
        }
    `;

    document.head.appendChild(style);

})();