← Back to context

Comment by hikewkwek

20 hours ago

Turning off youtube watch history stops the shorts tab from working. And you can use a userscript to swap the "shorts" word to "watch" in the url to convert all shorts to normal videos.

For example:

  // ==UserScript==
  // @name         Redirect YouTube Shorts to Regular Videos (Mobile-Friendly)
  // @namespace    https://example.com/
  // @version      1.4
  // @description  Redirects YouTube Shorts URLs to regular video URLs on mobile
  // @author       YourName
  // @match        *://*.youtube.com/*
  // @run-at       document-end
  // @grant        none
  // ==/UserScript==
  
  //Written by GPT-4o Mini
  (function () {
      'use strict';
  
      // Function to redirect Shorts to regular video URLs
      function redirect() {
          if (location.pathname.startsWith("/shorts")) {
              const videoId = location.pathname.split("/")[2];
              const newUrl = "https://www.youtube.com/watch?v=" + videoId;
              window.location.replace(newUrl);
          }
      }
  
      // Observe changes to the DOM and check for navigation
      const observer = new MutationObserver(() => {
          redirect();
      });
  
      // Start observing the body for changes
      observer.observe(document.body, { childList: true, subtree: true });
  
      // Initial check in case a Shorts URL is loaded directly
      redirect();
  })();