Web scripts

Greasemonkey scripts that should be in a code repository instead of here

Youtube redirect watch later video to normal video

// @name     Youtube redirect watch later video to normal video
// @version  1
// @grant    none
// @include     https://www.youtube.com/watch*
// @run-at document-start
// ==/UserScript==

let urlParams = new URLSearchParams(window.location.search); if (urlParams.get('v') != null && urlParams.get('list') != null && urlParams.get('list') == 'WL') { // Rewrite the URL to only have the video parameter let youtubeVideoUrlRoot = window.location.href.split('?')[0]; if (!youtubeVideoUrlRoot.endsWith('watch')) { return; }

// Redirect the user to the video window.location.replace(youtubeVideoUrlRoot + '?v=' + urlParams.get('v')); }


Last updated: Mon Nov 25 2024 00:29:26 GMT-0600 (Central Standard Time)