Redirect YouTube Shorts to Watch
The Redirect YouTube Shorts to Watch userscript is a script that can be installed in the web browser extension called Tampermonkey. This userscript is designed to redirect URLs containing "/shorts" on YouTube to the regular watch page.
Once installed, the userscript runs in the background and automatically detects when a YouTube page is loaded. It monitors the URL and checks if the pathname contains "/shorts". If it does, the userscript extracts the video ID from the URL and redirects the page to the regular watch page by replacing "/shorts" with "/watch?v=" and appending the extracted video ID.
The userscript continuously monitors the page for any changes in the URL or page content, ensuring that even if the user navigates within YouTube or the page dynamically updates, the redirection is still applied. This is achieved through event listeners that capture various events such as page navigation, data fetching, and page updates.
By redirecting YouTube Shorts URLs to the watch page, this userscript enables a seamless viewing experience for users who prefer to watch shorts in the regular format. It simplifies the process of accessing and interacting with shorts content on YouTube, providing a more consistent and familiar interface for users.