Youtube Cleaner Video Player

Removes any overlay youtube might put on top of the video player that isn't important, like the branding watermark or product ads from the channel, for slightly better video visibility.

安裝腳本?
作者推薦腳本

您可能也會喜歡 Remove Youtube Propaganda

安裝腳本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Youtube Cleaner Video Player
// @namespace    https://gitlab.com/Dwyriel
// @version      1.4.1
// @description  Removes any overlay youtube might put on top of the video player that isn't important, like the branding watermark or product ads from the channel, for slightly better video visibility.
// @author       Dwyriel
// @license      MIT
// @match        *://*.youtube.com/*
// @grant        none
// @homepageURL  https://gitlab.com/Dwyriel/Greasyfork-Scripts
// ==/UserScript==

(function () {
    'use strict';
    const userscriptName = "[Youtube Cleaner Video Player]";
    const callback = () => {
        document.getElementsByClassName("branding-img")[0]?.remove(); //removes the image inside the button, making the button have a size of 0x0, keeping its functionality to avoid errors but essentially removing it.
        let productAds = document.getElementsByClassName("ytp-featured-product-container");
        for (let pruductEle of productAds) { //remove product ads that show mid video
            pruductEle.parentElement.parentElement.remove();
            console.log(`${userscriptName} Removed element with class: ytp-featured-product-container`);
        }
    };
    const config = { attributes: true, childList: true, subtree: true };
    new MutationObserver(callback).observe(document.body, config);
})();