知乎 去广告重写部分

This commit is contained in:
sve1r 2021-04-04 21:26:13 +08:00
parent 85d5f7b399
commit 81c83847bb
No known key found for this signature in database
GPG Key ID: C3F86D043AD46ED6
5 changed files with 42 additions and 0 deletions

View File

@ -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})

View File

@ -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})

View File

@ -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({})

View File

@ -0,0 +1,5 @@
let body = $response.body
body = JSON.parse(body)
delete body['mcn_user_info']
body = JSON.stringify(body)
$done({body})

View File

@ -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})