PrimewireLinks

If link text is missing, it will fill it so you can see which CDNs to click on. This will also strip out Promo / Sponsor hosts.

当前为 2017-06-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name PrimewireLinks
  3. // @namespace nitrocode
  4. // @description If link text is missing, it will fill it so you can see which CDNs to click on. This will also strip out Promo / Sponsor hosts.
  5. // @version 0.1
  6. // @match *://*.primewire.ag/tv-*
  7. // @match *://*.primewire.ag/watch-*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // Purposely did not use jquery because it didn't seem to work too well with FF
  12. // Only run script after the page has fully loaded
  13. window.addEventListener('load', function() {
  14. // grab all version_host class vars that hold the rocker script
  15. var links = document.querySelectorAll('.version_host');
  16. var link_text = "";
  17. var real_link_count = 0;
  18. for (var i=0; i<links.length; i++) {
  19. // cut up the string instead of eval'ing so it's safe
  20. link_text = links[i].innerHTML.substring(
  21. links[i].innerHTML.indexOf("'") + 1,
  22. links[i].innerHTML.lastIndexOf("'")
  23. );
  24. // Remove Promo Host and Sponsor Host
  25. if (!link_text.includes('Host')) {
  26. links[i].innerHTML = link_text;
  27. console.log('Found real link: ' + link_text);
  28. real_link_count++;
  29. } else {
  30. links[i].closest('table').remove();
  31. console.log('Removed: ' + link_text);
  32. }
  33. }
  34. console.log('Found ' + real_link_count + ' real links');
  35. }, false);