Advertisement
Guest User

YouTube Channel Playlist Remover

a guest
Aug 14th, 2014
1,440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           YouTube Channel Playlist Remover
  3. // @namespace      nullv
  4. // @description    Gets rid of playlist links in video channels.
  5. // @include        http://www.youtube.com/user/*/videos
  6. // @include        https://www.youtube.com/user/*/videos
  7. // ==/UserScript==
  8.  
  9. //Get all link URLs on page.
  10. var links = document.getElementsByTagName("a");
  11.  
  12. //Start checking the list of URLs.
  13. for (var i=0, imax=links.length; i<imax; i++) {
  14.    
  15.     //Find the position of the playlist part of the URL.
  16.     var p = links[i].href.search("&list=");
  17.  
  18.     //Make sure we're only applying the changes to the correct URLs.
  19.     if(p != -1) {
  20.  
  21.         //Snip the playlist section out of the URL.
  22.         links[i].href = links[i].href.slice(0, p);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement