m-team https fix - default tracker

Convert in-site http links to https

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        m-team https fix - default tracker
// @namespace   m-team
// @version     0.99
// @grant       none
// @include     https://tp.m-team.cc/*
// @description Convert in-site http links to https
// @description:zh-CN 站内种子默认下载 https tracker 版本
// @description:zh-TW 站內種子默認下載 https tracker 版本
// ==/UserScript==

//替换默认 download 链接为 https tracker 版本
(function () {
  var snapResults = document.evaluate('//a[starts-with(@href, \'download.php?\')]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  for (var i = snapResults.snapshotLength - 1; i >= 0; i--) {
    var elm = snapResults.snapshotItem(i);
    var href = elm.getAttribute('href');
    href = href + '&https=1';
    elm.setAttribute('href', href);
  }
}) ();