1
0
mirror of https://github.com/chylex/Userscripts.git synced 2025-05-04 19:34:04 +02:00

Add 'Redirect YouTube Shorts'

This commit is contained in:
chylex 2025-03-24 00:53:06 +01:00
parent 602ad9298d
commit 035aed7554
Signed by: chylex
SSH Key Fingerprint: SHA256:WqM8X/1DDn11LbYM0H5wsqZUjbcKxVsic37L+ERcF4o

View File

@ -0,0 +1,23 @@
// ==UserScript==
// @name Redirect YouTube Shorts
// @description Redirects YouTube shorts to normal video URLs.
// @version 1
// @license MPL-2.0
// @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts
// @supportURL https://github.com/chylex/Userscripts/issues
// @include https://youtube.com/*
// @include https://*.youtube.com/*
// @run-at document-start
// @grant none
// @noframes
// ==/UserScript==
function redirectShort() {
if (location.pathname.startsWith("/shorts/")) {
location.replace(location.href.replace("/shorts/", "/watch?v="));
}
}
redirectShort();
document.addEventListener("yt-navigate-start", redirectShort);