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:
parent
602ad9298d
commit
035aed7554
23
YouTube/RedirectShorts.user.js
Normal file
23
YouTube/RedirectShorts.user.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user