// ==UserScript== // @name YouTube No Playlist // @namespace https://git.xservers.dy.fi/cgit.cgi/stderr64/yt_noplaylist // @version 1.0 // @description Redirect youtube playlist to non-playlist url // @author stderr64 // @match https://www.youtube.com/watch?v=*&list=* // @grant none // ==/UserScript== (function() { 'use strict'; if ( window.location === undefined || window.location.length === 0 ){ console.log( "[YouTube No Playlist] Error: window.location is undefined or empty" ); return; } var win_location_str = window.location.toString(); if ( !win_location_str.match(/\/watch\?v=\w+&list=\w+$/) ){ return; } var win_location_split = win_location_str.split( "&list=" ); if ( win_location_split.length === 0 ){ return; } if ( win_location_split[1].length === 0 || !win_location_split[1].match(/\w+$/) ){ return; } window.location.assign( win_location_split[0] ); return; })();