Xunlei KuaiChuan Export Links

在新标签页显示迅雷快传中已勾选链接文本

  1. // ==UserScript==
  2. // @name Xunlei KuaiChuan Export Links
  3. // @namespace qixinglu.com
  4. // @description 在新标签页显示迅雷快传中已勾选链接文本
  5. // @grant none
  6. // @include http://kuai.xunlei.com/d/*
  7. // @version 0.2
  8. // modified by Kun Wang <ifreedom.cn AT gmail.com>
  9. // ==/UserScript==
  10.  
  11. var addStyle = function(cssText) {
  12. var head = document.querySelector('head');
  13. var style = document.createElement('style');
  14. style.setAttribute('type', 'text/css');
  15. style.textContent = cssText;
  16. head.appendChild(style);
  17. };
  18.  
  19. var replaceButton = function() {
  20. // 复制按钮,避免处理点击事件而弹出下载迅雷提示
  21. var orignalButton = document.querySelector('.general_btn');
  22. var newButton = orignalButton.cloneNode(true);
  23.  
  24. newButton.addEventListener('click', function() {
  25. var rows = document.querySelectorAll('.file_src li');
  26. var i, row;
  27. var links = [];
  28. for (i = 0; i < rows.length; i += 1) {
  29. row = rows[i];
  30. if (row.querySelector('input.file_chk').checked) {
  31. links.push(row.querySelector('a.file_name').href);
  32. }
  33. }
  34. var text = 'data:text/plain,' + encodeURIComponent(links.join('\n'));
  35. window.open(text);
  36. });
  37.  
  38. orignalButton.parentNode.replaceChild(newButton, orignalButton);
  39. };
  40.  
  41. // 需要用到这个脚本都不需要显示「高速下载」按钮,隐藏掉。
  42. var fileCSS = 'a.high_btn, .adb_txt { display: none; }';
  43.  
  44. // 干掉「离线下载」按钮的菜单
  45. document.querySelector('.operation').remove();
  46.  
  47. addStyle(fileCSS);
  48. replaceButton();

QingJ © 2025

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