Skip to content

Commit f12c2c3

Browse files
authored
Create weixin110.js
1 parent 55361b6 commit f12c2c3

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Script/weixin110.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
在微信中打开淘宝等被屏蔽链接,点击 Surge/QuantumultX 通知跳转到 Safari 或淘宝 App
3+
by @HotKids & @XIAO_KOP,修改自 @江湖中人
4+
5+
/*********************
6+
QuantumultX 远程脚本配置:
7+
**********************
8+
[rewrite_local]
9+
^https?:\/\/weixin110\.qq\.com\/cgi-bin\/mmspamsupport-bin\/newredirectconfirmcgi url script-response-body https://raw.githubusercontent.com/HotKids/Rules/master/Script/weixin110.js
10+
[mitm]
11+
hostname= weixin110.qq.com
12+
**********************
13+
Surge 4.2.0+ 脚本配置:
14+
**********************
15+
[Script]
16+
tbopener.js = type=http-response,pattern=^https?:\/\/weixin110\.qq\.com\/cgi-bin\/mmspamsupport-bin\/newredirectconfirmcgi,script-path=https://raw.githubusercontent.com/HotKids/Rules/master/Script/weixin110.js
17+
[MITM]
18+
hostname= weixin110.qq.com
19+
*/
20+
21+
var str = ($response.body);
22+
23+
str = str.match(/://(\S*)"}/)[1].replace(///g, '/').replace(/&/g, '&').split("\"")[0]
24+
let opener = str.indexOf("m.tb.cn") != -1 ? "taobao://" + str: ($response.body)
25+
//console.log(str);
26+
27+
const $ = new cmp()
28+
29+
if (str.indexOf("m.tb.cn") != -1) {
30+
$.notify(``, "", "🛍️点击打开淘宝", opener)
31+
} else if (str.indexOf("如需浏览")) {
32+
$.notify(``,"", "🔗点击打开链接", "https://"+str)
33+
}
34+
35+
$done({body: $response.body});
36+
37+
function cmp() {
38+
_isQuanX = typeof $task != "undefined"
39+
_isLoon = typeof $loon != "undefined"
40+
_isSurge = typeof $httpClient != "undefined" && !_isLoon
41+
this.notify = (title, subtitle, message, url) => {
42+
if (_isLoon) $notification.post(title, subtitle, message, url)
43+
if (_isQuanX) $notify(title, subtitle, message, { "open-url": url })
44+
if (_isSurge) $notification.post(title, subtitle, message, { url: url })
45+
}
46+
}

0 commit comments

Comments
 (0)