Youtube Link Fix for addons/scripts

[Works in FF and Chrome!] changes youtube links to refresh whole page, so other scripts will work.

  1. // ==UserScript==
  2. // @name Youtube Link Fix for addons/scripts
  3. // @namespace http://www.youtube.com/
  4. // @version 0.7
  5. // @description [Works in FF and Chrome!] changes youtube links to refresh whole page, so other scripts will work.
  6. // @author William H
  7. // @include *youtube.com/*
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-latest.js
  10. // ==/UserScript==
  11.  
  12.  
  13. window.addEventListener("load", convertMyLinks($('a[class*="spf-link"]')), false);
  14. if(document.readyState == "complete"){
  15. convertMyLinks($('a[class*="spf-link"]'));
  16. }
  17.  
  18. function convertMyLinks(elemArray) {
  19. for (i = 0; i < elemArray.length; i += 1) {
  20. $(elemArray[i]).attr("href", elemArray[i].href).removeAttr('data-sessionlink').removeAttr('rel').attr('class', $(elemArray[i]).attr('class').split(" spf-link ")[0]);
  21. }
  22. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址