Redirect YouTube Shorts to Watch

Redirect /shorts to /watch

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
𝖢𝖸 𝖥𝗎𝗇𝗀
今日安裝
0
安裝總數
265
評價
0 1 0
版本
0.1.3
建立日期
2023-06-10
更新日期
2023-06-16
尺寸
2.1 KB
授權條款
MIT
腳本執行於

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.