m-team https fix

Convert in-site http links to https

Verze ze dne 28. 02. 2016. Zobrazit nejnovější verzi.

// ==UserScript==
// @name        m-team https fix
// @namespace   m-team
// @version     0.01
// @grant       none
// @include     https://tp.m-team.cc/*
// @require     http://code.jquery.com/jquery-1.12.1.min.js
// @description Convert in-site http links to https
// @description:zh-CN 将站内 http 链接转换为 https
// @description:zh-TW 將站內 http 鏈接轉換為 https
// ==/UserScript==

(function(){
	var snapResults = document.evaluate("//a[contains(@href,
	'http://tp.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);
		elm.setAttribute('href', elm.getAttribute('href').replace(/^http:\/\/(tp\.m-team\.cc\/)/i, "https://$1"))
	}
})()