Advertisement
deuxdoom

Remove YouTube Sponsored Label Overlay

Apr 11th, 2025
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.18 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name         Remove YouTube Sponsored Label Overlay
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  유료 광고 포함 라벨 오클릭 방지 제거 Hides YouTube "includes promotion" overlays & disables redirection
  6. // @author       SAKURA
  7. // @match        https://www.youtube.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     const BLOCK_SELECTORS = [
  15.         'a[href*="https://support.google.com/youtube?p=ppp"]',
  16.         '.ytm-paid-content-overlay-renderer',
  17.         '.YtmPaidContentOverlayHost',
  18.         '#paid-content-overlay', // 기타 다양한 이름들 고려함
  19.         '[aria-label*="includes promotion"]', // 접근성 기준으로도 제거
  20.         'tp-yt-paper-tooltip' // 일부 툴팁도 차단
  21.     ];
  22.  
  23.     const observer = new MutationObserver(() => {
  24.         BLOCK_SELECTORS.forEach(selector => {
  25.             document.querySelectorAll(selector).forEach(el => {
  26.                 el.remove(); // 아주 그냥 통째로 제거
  27.             });
  28.         });
  29.     });
  30.  
  31.     observer.observe(document.body, {
  32.         childList: true,
  33.         subtree: true
  34.     });
  35. })();
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement