Greasy Fork is available in English.

Redirect YouTube Shorts to Watch

Redirect /shorts to /watch

Autor
𝖢𝖸 𝖥𝗎𝗇𝗀
Denně instalací
1
Celkem instalací
224
Hodnocení
0 1 0
Verze
0.1.3
Vytvořeno
10. 06. 2023
Aktualizováno
16. 06. 2023
Licence
MIT
Spustit na

Redirect YouTube Shorts to Watch

development request #187353

Description

The Redirect YouTube Shorts to Watch userscript is a tool designed to automatically redirect URLs with the "/shorts" path on YouTube to the corresponding "/watch" page. This userscript is intended to enhance the user experience by ensuring that when a user visits a YouTube Shorts video, they are automatically redirected to the standard video watch page.

How it Works

The userscript utilizes the popular browser extension Tampermonkey to run custom JavaScript code whenever a YouTube page is loaded. The code checks the URL of the page and detects if it contains the "/shorts" path. If a "/shorts" path is found, the userscript extracts the video ID from the URL and redirects the user to the corresponding "/watch?v=" URL.

The userscript listens for various events triggered during page navigation and updates, ensuring that the redirection functionality remains active and reacts to changes in the URL. It utilizes event listeners for events such as "yt-navigate," "yt-navigate-start," "yt-page-data-fetched," "yt-page-data-updated," and "yt-navigate-finish" to continuously monitor the page and perform the necessary redirection when required.

By automatically redirecting YouTube Shorts URLs to the watch page, this userscript eliminates the need for users to manually change the URL or search for the video they want to watch. It provides a seamless and efficient browsing experience for users who prefer to watch YouTube videos on the standard watch page rather than the Shorts format.

Please note that this userscript requires a browser extension like Tampermonkey to be installed and enabled in your browser. The installation process may vary depending on your browser and extension manager.