Обновить ss_conditions.pac
parent
65235fbe2e
commit
34b46a3fbc
|
|
@ -49,7 +49,7 @@ var __BLOCKEDSITES__ = [
|
||||||
"*.azattyq.com",
|
"*.azattyq.com",
|
||||||
"*.bbc.com",
|
"*.bbc.com",
|
||||||
"*.bbci.co.uk",
|
"*.bbci.co.uk",
|
||||||
"*..bluetoothgoodies.com",
|
"*.bluetoothgoodies.com",
|
||||||
"*.bellingcat.com",
|
"*.bellingcat.com",
|
||||||
"*.bild.de",
|
"*.bild.de",
|
||||||
"*.bing.com",
|
"*.bing.com",
|
||||||
|
|
@ -333,7 +333,7 @@ var __BLOCKEDSITES__ = [
|
||||||
"*.qualcomm.com",
|
"*.qualcomm.com",
|
||||||
"*.paypal.com",
|
"*.paypal.com",
|
||||||
"*.sms-activate.io",
|
"*.sms-activate.io",
|
||||||
"*.https://windows64.net",
|
"*.windows64.net",
|
||||||
"*.myprepaidcenter.com",
|
"*.myprepaidcenter.com",
|
||||||
"*.live.com",
|
"*.live.com",
|
||||||
"*.outlook.com",
|
"*.outlook.com",
|
||||||
|
|
@ -369,7 +369,7 @@ var __BLOCKEDSITES__ = [
|
||||||
"*.cloudapps.cisco.com",
|
"*.cloudapps.cisco.com",
|
||||||
"*.visit.xikestor.com",
|
"*.visit.xikestor.com",
|
||||||
"*.visit.seekswan.com",
|
"*.visit.seekswan.com",
|
||||||
".armbian.com"
|
"*.armbian.com"
|
||||||
];
|
];
|
||||||
|
|
||||||
var proxy;
|
var proxy;
|
||||||
|
|
@ -383,31 +383,47 @@ if (typeof __PROXY__ === "undefined") {
|
||||||
direct = "DIRECT;";
|
direct = "DIRECT;";
|
||||||
}
|
}
|
||||||
|
|
||||||
var FindProxyForURL = function(init, profiles) {
|
function __isBlockedHost__(host) {
|
||||||
return function(url, host) {
|
var i, blockedSite, reText;
|
||||||
"use strict";
|
for (i = 0; i < __BLOCKEDSITES__.length; i++) {
|
||||||
var result = init, scheme = url.substr(0, url.indexOf(":"));
|
blockedSite = __BLOCKEDSITES__[i];
|
||||||
do {
|
if (blockedSite.charAt(0) === "*") {
|
||||||
result = profiles[result];
|
reText = "(?:^|\\.)" + blockedSite.replace(/\./g, "\\.").replace(/^\*\\\./, "") + "$";
|
||||||
if (typeof result === "function") result = result(url, host, scheme);
|
} else {
|
||||||
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
|
reText = "^" + blockedSite.replace(/\./g, "\\.") + "$";
|
||||||
return result;
|
|
||||||
};
|
|
||||||
}("+auto switch", {
|
|
||||||
"+auto switch": function(url, host, scheme) {
|
|
||||||
"use strict";
|
|
||||||
if (__BLOCKEDSITES__.some(function(blockedSite) {
|
|
||||||
return new RegExp((blockedSite.startsWith("*") ? "(?:^|\\.)" : "^") + blockedSite.replace(/\./g, "\\.").replace(/^\*\\\./, "") + "$").test(host);
|
|
||||||
})) {
|
|
||||||
return "+proxy";
|
|
||||||
}
|
|
||||||
return "DIRECT";
|
|
||||||
},
|
|
||||||
"+proxy": function(url, host, scheme) {
|
|
||||||
"use strict";
|
|
||||||
if (/^127\.0\.0\.1$/.test(host) || /^::1$/.test(host) || /^localhost$/.test(host) || /^192\.168\.[0-9]{1-3}\.[0-9]{1-3}$/.test(host)) {
|
|
||||||
return direct;
|
|
||||||
}
|
|
||||||
return proxy;
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
if ((new RegExp(reText)).test(host)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var FindProxyForURL = function(init, profiles) {
|
||||||
|
return function(url, host) {
|
||||||
|
"use strict";
|
||||||
|
var result = init, scheme = url.substr(0, url.indexOf(":"));
|
||||||
|
do {
|
||||||
|
result = profiles[result];
|
||||||
|
if (typeof result === "function") result = result(url, host, scheme);
|
||||||
|
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}("+auto switch", {
|
||||||
|
"+auto switch": function(url, host, scheme) {
|
||||||
|
"use strict";
|
||||||
|
if (__isBlockedHost__(host)) {
|
||||||
|
return "+proxy";
|
||||||
|
}
|
||||||
|
return "DIRECT";
|
||||||
|
},
|
||||||
|
"+proxy": function(url, host, scheme) {
|
||||||
|
"use strict";
|
||||||
|
if (/^127\.0\.0\.1$/.test(host) || /^::1$/.test(host) || /^localhost$/.test(host) || /^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$/.test(host)) {
|
||||||
|
return direct;
|
||||||
|
}
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue