Skip to content

Commit

Permalink
feat: dyn page hide bili-dyn-live
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Apr 18, 2024
1 parent b5dcd0f commit ec9fbe2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 优化:优化评论区净化规则
- 新增:隐藏播放器内评分总结弹窗
- 新增:隐藏动态页直播通知动态

## 3.4.5

Expand Down
18 changes: 10 additions & 8 deletions src/rules/dynamic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Group } from '../components/group'
import { CheckboxItem } from '../components/item'
import { debugRules as debug } from '../utils/logger'
import { isPageDynamic } from '../utils/page-type'

// 自动展开 相同UP主被折叠的动态
Expand All @@ -10,11 +9,8 @@ const dynamicUnfold = () => {
const dynFoldNodes = document.querySelectorAll('main .bili-dyn-list__item .bili-dyn-item-fold')
if (dynFoldNodes.length) {
dynFoldNodes.forEach((e) => {
if (e instanceof HTMLDivElement) {
e.click()
}
e instanceof HTMLDivElement && e.click()
})
debug(`unfold ${dynFoldNodes.length} fold`)
}
}
setInterval(unfold, 500)
Expand Down Expand Up @@ -178,9 +174,7 @@ if (isPageDynamic()) {
itemID: 'hide-dynamic-page-bili-dyn-forward',
description: '隐藏 转发的动态',
itemCSS: `.bili-dyn-list__item:has(.bili-dyn-content__orig.reference) {
visibility: hidden !important;
height: 0 !important;
margin: 0 !important;
display: none !important;
}`,
}),
// 隐藏 投票动态
Expand All @@ -191,6 +185,14 @@ if (isPageDynamic()) {
display: none !important;
}`,
}),
// 隐藏 直播通知动态
new CheckboxItem({
itemID: 'hide-dynamic-page-bili-dyn-live',
description: '隐藏 直播通知动态',
itemCSS: `.bili-dyn-list__item:has(.bili-dyn-card-live) {
display: none !important;
}`,
}),
// 隐藏 被block的充电动态
new CheckboxItem({
itemID: 'hide-dynamic-page-bili-dyn-blocked',
Expand Down

0 comments on commit ec9fbe2

Please sign in to comment.