m-team https fix - img

Convert in-site http links to https

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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 - img
// @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 将站内 图片 http 链接转换为 https
// @description:zh-TW 將站內 图片 http 鏈接轉換為 https
// ==/UserScript==

//替换 站内图片 地址为 https
(function () {
  var snapResults = document.evaluate('//img[starts-with(@src,\'http://img.m-team.cc/\')]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  for (var i = snapResults.snapshotLength - 1; i >= 0; i--) {
    var elm = snapResults.snapshotItem(i);
    var attrs = elm.attributes;
    for (var j = attrs.length - 1; j >= 0; j--) {
      var name = attrs[j].name;
      var value = attrs[j].value;
      elm.setAttribute(name, value.replace(/http(:\/\/img\.m-team\.cc)/gi, 'https$1'));
    }
  }
}) ();