Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name YouTube Channel Playlist Remover
- // @namespace nullv
- // @description Gets rid of playlist links in video channels.
- // @include http://www.youtube.com/user/*/videos
- // @include https://www.youtube.com/user/*/videos
- // ==/UserScript==
- //Get all link URLs on page.
- var links = document.getElementsByTagName("a");
- //Start checking the list of URLs.
- for (var i=0, imax=links.length; i<imax; i++) {
- //Find the position of the playlist part of the URL.
- var p = links[i].href.search("&list=");
- //Make sure we're only applying the changes to the correct URLs.
- if(p != -1) {
- //Snip the playlist section out of the URL.
- links[i].href = links[i].href.slice(0, p);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement