from Hacker News

Browser extension that globally blocks vertical video?

by kradeelav on 6/14/24, 8:50 PM with 16 comments

I dislike nearly everything about the recent vertical video format/medium that's taken over the internet since ~2018 or so. Is there an extension that globally blocks it across twitter/tumblr/youtube/anywhere embedded? Feels like it'd be pretty trivial to code if not, and I know there's a few other old web farts who would gladly use such an extension.
  • by runjake on 6/14/24, 9:51 PM

    I'm probably much older than you and I don't mind, and in fact, I regularly watch vertical videos. They don't bother me.

    But here is some sloppy code you could create a basic browser extension and shove in content.js:

      function hideVerticalVideos() {
        const videos = document.querySelectorAll('video');
        videos.forEach(video => {
          if (video.videoHeight > video.videoWidth) {
            video.style.display = 'none';
          }
        });
      }
    
      // Run hideVerticalVideos() when the page loads
      window.addEventListener('load', hideVerticalVideos);
    
      // Run when the DOM updates
      const observer = new MutationObserver(hideVerticalVideos);
      observer.observe(document.body, { childList: true, subtree: true });
  • by ryandetzel on 6/14/24, 11:34 PM

    I wish everything was so great in my life that this could be a concern.
  • by musicale on 6/16/24, 3:32 AM

    I need a browser extension to block video autoplay because no browser setting seems to work consistently.

    Safari in particular has never worked, but I've had bad luck with Chrome and Firefox as well.

  • by gentile on 6/15/24, 6:05 PM

    On youtube you can block the section with shorts in them with ublock (rclick > block element), this was good enough for my use. I don't know about other sites.
  • by danjl on 6/16/24, 5:53 PM

    Someone should use generative AI to convert portrait video into landscape by extending the sides (rather than cropping).
  • by musicale on 6/15/24, 3:59 AM

    I dislike vertical video also. Last I checked, phones can rotate 90 degrees to play landscape video.

    On a related note, is there a browser that can completely block auto-playing video with a setting that actually works?

    I find it depressing that web developers seem willing to do anything to ignore user preferences, especially when intrusive advertising is involved.

  • by cpach on 6/15/24, 2:34 PM

    I’m not wild about vertical videos either. But are you sure a technical solution is the best solution for this issue?
  • by ivanjermakov on 6/14/24, 10:47 PM

    It would be very hard to get rid of portrait videos that were uploaded as landscape but padded with black bars.