add current script collection

This commit is contained in:
ergosteur
2025-10-02 11:57:59 -04:00
parent 587b7cf9ab
commit 19130e3207
6 changed files with 768 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
// ==UserScript==
// @name YouTube Shorts Redirect
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Redirects YouTube Shorts links to the standard watch page.
// @author You
// @match https://www.youtube.com/shorts/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// Get the current URL
const currentUrl = window.location.href;
// Check if the URL matches the Shorts pattern (e.g., https://www.youtube.com/shorts/v1de0id)
if (currentUrl.includes('youtube.com/shorts/')) {
// Extract the video ID, which is the part after the last '/'
const videoId = currentUrl.substring(currentUrl.lastIndexOf('/') + 1);
// Construct the new URL in the standard watch format
const newUrl = 'https://www.youtube.com/watch?v=' + videoId;
// Redirect the browser to the new URL
window.location.replace(newUrl);
}
})();