RandomProxy

[PT] Carrega paginas e links atraves de um proxy aleatorio. [EN] Load webpages and links through a random proxy.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           RandomProxy
// @namespace      http://stackoverflow.com/users/982924/rasg
// @author         RASG
// @version        2012.06.14
// @description    [PT] Carrega paginas e links atraves de um proxy aleatorio. [EN] Load webpages and links through a random proxy.
// @include        http*://*
// ==/UserScript==

var matriz =   ['https://cache-001.appspot.com/','https://cache-003.appspot.com/','https://cache-017.appspot.com/','https://meme-darwin.appspot.com/'];
var proxy =    matriz[Math.floor(Math.random() * matriz.length)];
var temproxy = 0;
var url =      window.location.href;

for (i in matriz) {
	if (url.indexOf(matriz[i]) > -1) {
		temproxy = 1;
	}
}
		
if (temproxy == 0) {
	window.location.replace(location.href.replace(location.protocol + '//', proxy));
	for (var i=0,link; (link=document.links[i]); i++) {
		if (link.href.indexOf(proxy) < 0) {
			link.href = link.href.replace(link.href.substring(0,7), proxy);
		}
	}
}