-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathheader.js
93 lines (91 loc) · 2.82 KB
/
header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// 2024-08-11 13:40
const url = $request.url;
const header = $request.headers;
const contype = header["Content-Type"] || header["content-type"];
const headopt = header["Operation-Type"] || header["operation-type"];
const ua = header["User-Agent"] || header["user-agent"];
const isQuanX = typeof $task !== "undefined";
if (url.includes("/amdc/mobileDispatch")) {
if (
ua.includes("AMapiPhone") || // 高德地图
ua.includes("Alibaba") || // 阿里巴巴
ua.includes("Cainiao4iPhone") || // 菜鸟
ua.includes("%E9%A3%9E%E7%8C%AA%E6%97%85%E8%A1%8C") // 飞猪旅行
) {
if (isQuanX) {
$done({ status: "HTTP/1.1 404 Not Found" });
} else {
$done();
}
} else {
$done({});
}
} else if (url.includes("/mobile.12306.cn/otsmobile/app/mgs/")) {
// 12306页面内容
const list12306 = [
// "com.cars.otsmobile.bangbangSafe.deciveInfo", // 设备序列号
// "com.cars.otsmobile.checkLoginStatus", // 登录信息
// "com.cars.otsmobile.city",
// "com.cars.otsmobile.initCountry",
// "com.cars.otsmobile.initNewSysCache",
// "com.cars.otsmobile.initProvince",
"com.cars.otsmobile.integration.activityBanner", // 活动横幅
"com.cars.otsmobile.memberInfo.getMemberQa", // 铁路会员 常见问题
// "com.cars.otsmobile.memberInfo.integrationHomeInit", // 铁路会员 会员信息
// "com.cars.otsmobile.newHomePage.getWeatherByStationCode", // 天气信息
"com.cars.otsmobile.newHomePage.initData", // 热门资讯
"com.cars.otsmobile.newHomePageBussData", // 商品信息流
// "com.cars.otsmobile.newHomePageRefresh",
"com.cars.otsmobile.paySuccBuss.bussEntryShow" // 商业推广
// "com.cars.otsmobile.travelPage.initData", // 出行服务
];
if (isQuanX) {
if (list12306?.includes(headopt)) {
$done({ status: "HTTP/1.1 404 Not Found" });
} else {
$done({});
}
} else {
if (list12306?.includes(headopt)) {
$done();
} else {
$done({});
}
}
} else if (url.includes("/mobilepaas.abchina.com.cn:441/mgw")) {
// 中国农业银行开屏广告
const listbankabc = [
"com.bankabc.recommendcenter.homepage.gethpadverinfo",
"com.abchina.mbank.common.homepage.getStartParam"
];
if (isQuanX) {
if (listbankabc?.includes(headopt)) {
$done({ status: "HTTP/1.1 404 Not Found" });
} else {
$done({});
}
} else {
if (listbankabc?.includes(headopt)) {
$done();
} else {
$done({});
}
}
} else if (url.includes("/sec.sginput.qq.com/q")) {
// 搜狗输入法候选词推广
if (isQuanX) {
if (contype === "application/octet-stream") {
$done({ status: "HTTP/1.1 404 Not Found" });
} else {
$done({});
}
} else {
if (contype === "application/octet-stream") {
$done();
} else {
$done({});
}
}
} else {
$done({});
}