support mixed rewrite

This commit is contained in:
Shawn
2020-12-06 09:23:05 +08:00
parent c90e434f6c
commit f37b282e18
2 changed files with 10 additions and 5 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1171,7 +1171,7 @@ function isQuanX(content) {
return nlist
}
//surge script - > quanx
//surge script/rewrite - > quanx
function isQuanXRewrite(content) {
cnt = content
cnt0=[]
@@ -1180,9 +1180,14 @@ function isQuanXRewrite(content) {
if (cnti.indexOf("pattern")!=-1 && cnti.indexOf("type")!=-1) {
cnti=SGMD2QX(cnti)[0]
//console.log(cnti)
cnt0.push(cnti)
}else {
cnt0.push(cnti)}
}else if ((cnti.indexOf(" 302")!=-1 || cnti.indexOf(" 307")!=-1) && cnti.indexOf(" url ")==-1){
cnti=SGMD2QX(cnti)[0]? SGMD2QX(cnti)[0]:""
//console.log("sss",cnti)
}else if(cnti.indexOf("URL_REGEX")!=-1){
cnti=SGMD2QX(cnti)[0]? SGMD2QX(cnti)[0]:""
}
cnt0.push(cnti)
}
//console.log(cnt0)
return cnt0