From 34b46a3fbc65ccb61402d3b2e3dc2abd2b75e36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=98=D0=BB=D1=8C?= =?UTF-8?q?=D1=8F=D1=81=D0=BE=D0=B2?= Date: Mon, 24 Aug 2026 22:19:00 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20ss=5Fconditions.pac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ss_conditions.pac | 74 ++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/ss_conditions.pac b/ss_conditions.pac index 1c5f0db..156a5cd 100644 --- a/ss_conditions.pac +++ b/ss_conditions.pac @@ -49,7 +49,7 @@ var __BLOCKEDSITES__ = [ "*.azattyq.com", "*.bbc.com", "*.bbci.co.uk", - "*..bluetoothgoodies.com", + "*.bluetoothgoodies.com", "*.bellingcat.com", "*.bild.de", "*.bing.com", @@ -333,7 +333,7 @@ var __BLOCKEDSITES__ = [ "*.qualcomm.com", "*.paypal.com", "*.sms-activate.io", - "*.https://windows64.net", + "*.windows64.net", "*.myprepaidcenter.com", "*.live.com", "*.outlook.com", @@ -369,7 +369,7 @@ var __BLOCKEDSITES__ = [ "*.cloudapps.cisco.com", "*.visit.xikestor.com", "*.visit.seekswan.com", - ".armbian.com" + "*.armbian.com" ]; var proxy; @@ -383,31 +383,47 @@ if (typeof __PROXY__ === "undefined") { direct = "DIRECT;"; } -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 (__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; +function __isBlockedHost__(host) { + var i, blockedSite, reText; + for (i = 0; i < __BLOCKEDSITES__.length; i++) { + blockedSite = __BLOCKEDSITES__[i]; + if (blockedSite.charAt(0) === "*") { + reText = "(?:^|\\.)" + blockedSite.replace(/\./g, "\\.").replace(/^\*\\\./, "") + "$"; + } else { + reText = "^" + blockedSite.replace(/\./g, "\\.") + "$"; } + 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; + } });