m-team https fix - download

Convert in-site http links to https

  1. // ==UserScript==
  2. // @name m-team https fix - download
  3. // @namespace m-team
  4. // @version 0.99
  5. // @grant none
  6. // @include https://tp.m-team.cc/*
  7. // @description Convert in-site http links to https
  8. // @description:zh-CN 将种子下载 http 链接转换为 https
  9. // @description:zh-TW 將种子下载 http 鏈接轉換為 https
  10. // ==/UserScript==
  11.  
  12. //替换 http 链接为 https
  13. (function () {
  14. var snapResults = document.evaluate('//a[starts-with(@href,\'http://tp.m-team.cc/\')]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  15. for (var i = snapResults.snapshotLength - 1; i >= 0; i--) {
  16. var elm = snapResults.snapshotItem(i);
  17. var href = elm.getAttribute('href');
  18. href = href.replace(/^http/, 'https');
  19. elm.setAttribute('href', href);
  20. }
  21. }) ();
  22.