forked from yichahucha/surge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwb_launch.js
More file actions
27 lines (22 loc) · 730 Bytes
/
wb_launch.js
File metadata and controls
27 lines (22 loc) · 730 Bytes
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
/*
README:https://github.com/yichahucha/surge/tree/master
*/
const path1 = "/interface/sdk/sdkad.php";
const path2 = "/wbapplua/wbpullad.lua";
const url = $request.url;
var body = $response.body;
if (url.indexOf(path1) != -1) {
let re = /\{.*\}/;
body = body.match(re);
var obj = JSON.parse(body);
if (obj.background_delay_display_time) obj.background_delay_display_time = 60*60*24*365;
if (obj.show_push_splash_ad) obj.show_push_splash_ad = false;
if (obj.ads) obj.ads = [];
body = JSON.stringify(obj) + 'OK';
}
if (url.indexOf(path2) != -1) {
var obj = JSON.parse(body);
if (obj.cached_ad && obj.cached_ad.ads) obj.cached_ad.ads = [];
body = JSON.stringify(obj);
}
$done({body});