您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
04/26/2023, 11:35:27 AM
- // ==UserScript==
- // @name Youtube: Remove Overlays
- // @namespace https://greasyfork.org/en/users/221281-klaufir
- // @match https://www.youtube.com/embed/*
- // @match https://www.youtube.com/*
- // @match https://www.youtube-nocookie.com/*
- // @grant none
- // @version 1.12
- // @author -
- // @description 04/26/2023, 11: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
- 'ytd-reel-shelf-renderer'
- ];
- var style="";
- classes.forEach(cls => {
- style += "." + cls + " { visibility: hidden !important; }\n";
- });
- return style;
- }
- addStyle(getRuleForClasses());