From f37b282e188c6c2e3f1aab972fe091b921106c2f Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Sun, 6 Dec 2020 09:23:05 +0800 Subject: [PATCH] support mixed rewrite --- .DS_Store | Bin 14340 -> 14340 bytes Scripts/resource-parser.js | 15 ++++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.DS_Store b/.DS_Store index c9ff19c70a280929dfa6ea15eee8880f6e79abcd..fe3c161c50f03ca80885d98a33e01462aa4ae1fe 100644 GIT binary patch delta 19 acmZoEXeromR-DP)aI%z!!)AVoukrv(G6w1Z delta 28 jcmZoEXeromR-E6$xK>A@+R)6xKu5vS#Ax#!aSa6kj^GI6 diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 5e23e23..7d6eac1 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1171,7 +1171,7 @@ function isQuanX(content) { return nlist } -//surge script - > quanx +//surge script/rewrite - > quanx function isQuanXRewrite(content) { cnt = content cnt0=[] @@ -1180,10 +1180,15 @@ 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 }