Block YouTube Playables iPad

Blocks YouTube Playables section

  1. // ==UserScript==
  2. // @name Block YouTube Playables iPad
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Blocks YouTube Playables section
  6. // @author You
  7. // @match https://www.youtube.com/*
  8. // @grant none
  9. //@ license GNU GPLv3
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const hidePlayables = () => {
  16. // Target the Playables section or "View all" button
  17. const playablesSection = document.querySelector('a[href="/playables?bp=EgZicm93c2U%3D"]')?.closest('ytd-rich-section-renderer');
  18. if (playablesSection) {
  19. playablesSection.style.display = 'none';
  20. }
  21. };
  22.  
  23. // Run initially and monitor DOM changes
  24. const observer = new MutationObserver(hidePlayables);
  25. observer.observe(document.body, { childList: true, subtree: true });
  26.  
  27. hidePlayables();
  28. })();