知乎 去广告重写部分
This commit is contained in:
parent
85d5f7b399
commit
81c83847bb
|
@ -0,0 +1,10 @@
|
|||
let body = $response.body
|
||||
body = JSON.parse(body)
|
||||
delete body['ad_info']
|
||||
body['data'].forEach((element, index) => {
|
||||
if (element['author']['name'] === "盐选推荐" || element['author']['name'] === "盐选科普") {
|
||||
body['data'].splice(index, 1)
|
||||
}
|
||||
})
|
||||
body = JSON.stringify(body)
|
||||
$done({body})
|
|
@ -0,0 +1,9 @@
|
|||
let body = $response.body
|
||||
body = JSON.parse(body)
|
||||
body['data'].forEach((element, index) => {
|
||||
if (element.hasOwnProperty('ad')) {
|
||||
body['data'].splice(index, 1)
|
||||
}
|
||||
})
|
||||
body = JSON.stringify(body)
|
||||
$done({body})
|
|
@ -0,0 +1,9 @@
|
|||
//通知中心链接跳转到默认浏览器
|
||||
let url = $request.url
|
||||
let regex = /link.zhihu.com\/\?target=(.*?)&source/
|
||||
let target = regex.exec(url)
|
||||
let tmpurl = target[1]
|
||||
|
||||
let realurl = decodeURIComponent(tmpurl)
|
||||
$notification.post('', '', realurl)
|
||||
$done({})
|
|
@ -0,0 +1,5 @@
|
|||
let body = $response.body
|
||||
body = JSON.parse(body)
|
||||
delete body['mcn_user_info']
|
||||
body = JSON.stringify(body)
|
||||
$done({body})
|
|
@ -0,0 +1,9 @@
|
|||
let body = $response.body
|
||||
body = JSON.parse(body)
|
||||
body['data'].forEach((element, index) => {
|
||||
if (element['card_type'] === 'slot_event_card' || element.hasOwnProperty('ad')) {
|
||||
body['data'].splice(index, 1)
|
||||
}
|
||||
})
|
||||
body = JSON.stringify(body)
|
||||
$done({body})
|
Loading…
Reference in New Issue