Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Youtube redirect b gone
  3. // @namespace www.dwedit.org
  4. // @description Removes redirect URLs from Youtube
  5. // @include http://www.youtube.com/*
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. function fixLinks()
  11. {
  12. var documentLinks = document.getElementsByTagName("a");
  13. var lookFor = "redirect?q=";
  14. var lookFor2 = "&";
  15.  
  16. for (var i = 0; i < documentLinks.length; i++)
  17. {
  18. var docLink = documentLinks[i];
  19. alert(doclink.class);
  20. if (docLink.class == "yt-uix-redirect-link")
  21. {
  22. docLink.class = "";
  23. alert (docLink.href);
  24. }
  25. }
  26. }
  27.  
  28. fixLinks();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement