mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 13:05:10 +00:00
Update resource-parser.js
This commit is contained in:
@@ -1430,11 +1430,15 @@ function rule_list_handle(cnt) {
|
||||
} else if (cnt.indexOf("payload:") == -1) { //host - suffix, not clash rule list
|
||||
//$notify("xxx","xxxx",cnt)
|
||||
cnt = cnt.replace(/'|"/g, "").trim()//replace(/'|"|\+\.|\*\.|\*\.\*/g,"") 2023-04-10
|
||||
if(!/\*|\+/.test(cnt[0])) {
|
||||
cnt = cnt[0]=="." ? cnt.replace(".",""): cnt
|
||||
cnt = "host-suffix, " + cnt
|
||||
} else {
|
||||
//clash中以.或*.开头匹配的都是子域名,只存在匹配层级区别,qx中有无此设计不明,只能确定*可用
|
||||
if (/^\.|\*\./.test(cnt)) {//以.开头 = 匹配子域名 .stun.playstation.net/*.stun.playstation.net -> *.stun.playstation.net
|
||||
cnt = "host-wildcard, " + cnt.replace(/^\.|\*\./, "*.")
|
||||
} else if (/^(\+\.)/.test(cnt)) {//以+.开头 = 匹配当前域名及其子域名,走后缀匹配即可 +.xboxlive.com -> suffix xboxlive.com
|
||||
cnt = "host-suffix, " + cnt.replace(/^(\+\.)/, "")
|
||||
} else if (cnt.indexOf("*") != -1) {//不以*.开头的字符串中包含*的情况 -> 保持该规则
|
||||
cnt = "host-wildcard, " + cnt
|
||||
} else {
|
||||
cnt = "host-suffix, " + cnt
|
||||
}
|
||||
cnt = Ppolicy == "Shawn" ? cnt + ", Shawn" : cnt + ", " + Ppolicy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user