Youtube: Remove Overlays

10/30/2021, 12:35:27 AM

اعتبارا من 26-04-2023. شاهد أحدث إصدار.

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 or Violentmonkey 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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        Youtube: Remove Overlays
// @namespace   https://greatest.deepsurf.us/en/users/221281-klaufir
// @match       https://www.youtube.com/embed/*
// @match       https://www.youtube.com/*
// @grant       none
// @version     1.11
// @author      -
// @description 10/30/2021, 12:35:27 AM
// ==/UserScript==

function addStyle(style)
{
    var headelem = document.getElementsByTagName("head")[0];
    var styleelem = document.createElement("style");
    styleelem.setAttribute("id","remove-overlays");
    styleelem.type="text/css";
    styleelem.appendChild(document.createTextNode(style));
    headelem.appendChild(styleelem);
}

function getRuleForClasses() {
  var classes = [
        'ytp-paid-content-overlay',  // paid promotion notification overlay in the bottom left corner
        'ytp-pause-overlay',         // "More Videos" overlay on paused embeds
        'ytp-ce-element',            // covering overlays at the end of the video
        'iv-branding',               // branding overlay in the bottom right corner
        'ytp-cards-teaser',          // info cards in the top right corner
        'ytp-cards-button-icon',     // info cards in the top right corner
        'ytp-cards-button-title',    // info cards in the top right corner
        'ytp-endscreen-content',     // endscreen recommended videos
        'ytp-spinner'                // remove spinner stuck on screen
      ];
  var style="";
  classes.forEach(cls => {
    style += "." + cls + " { visibility: hidden !important; }\n";
  });
  return style;
}

addStyle(getRuleForClasses());