mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
feat: 添加debug选项
This commit is contained in:
parent
6fe8acfe1f
commit
4ec6faec2b
@ -1,4 +1,7 @@
|
||||
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \`占位文本\` 选项.
|
||||
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.
|
||||
|
||||
- \`占位文本\`: 删除首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
|
||||
- \`保留活动横幅\`: 保留视频页面的活动横幅.
|
||||
>注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 `占位文本` 选项.
|
||||
|
||||
- `占位文本`: 删除首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
|
||||
- `保留活动横幅`: 保留视频页面的活动横幅.
|
||||
- `debug`: 调试模式,用于查看是否正确屏蔽广告
|
||||
|
||||
@ -88,6 +88,13 @@ const entry: ComponentEntry = async ({ settings, metadata }) => {
|
||||
},
|
||||
true,
|
||||
)
|
||||
addComponentListener(
|
||||
`${metadata.name}.debug`,
|
||||
(value: boolean) => {
|
||||
document.body.classList.toggle('debug', value)
|
||||
},
|
||||
true,
|
||||
)
|
||||
}
|
||||
export const component = defineComponentMetadata({
|
||||
name: 'removePromotions',
|
||||
@ -113,5 +120,9 @@ export const component = defineComponentMetadata({
|
||||
displayName: '保留动态商品推荐',
|
||||
defaultValue: false,
|
||||
},
|
||||
debug: {
|
||||
displayName: 'debug',
|
||||
defaultValue: false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@ -117,5 +117,14 @@ body:not(.preserve-feed-goods) .bili-dyn-content__orig__additional:has(.dyn-good
|
||||
body.promotion-show-placeholder & {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
body.debug & {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
}
|
||||
|
||||
body.debug & {
|
||||
visibility: visible;
|
||||
border: red 1px solid;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user