logoalt Hacker News

susamyesterday at 9:07 PM1 replyview on HN

I wrote this little quick and dirty userscript for myself sometime back:

  // ==UserScript==
  // @name No Shorts
  // @match https://www.youtube.com/shorts/*
  // @match https://www.facebook.com/reel/*
  // ==/UserScript==
  window.document.body.innerHTML = ''
This isn't as comprehensive as the uBlock filter but it has worked pretty well for me so far.

Replies

susamyesterday at 11:58 PM

Here is another one I found in my personal userscripts:

  // ==UserScript==
  // @name  No YT Sidebar
  // @match https://www.youtube.com/*
  // ==/UserScript==
  function noYTSidebar () {
    if (document.getElementById('secondary') === null) {
      window.setTimeout(noYTSidebar, 1000)
    } else {
      document.getElementById('secondary').style.display = 'none'
    }
  }
  noYTSidebar()