Skip to content

Commit

Permalink
update: close shadowDOM, revert comment filter to last verision
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Nov 7, 2024
1 parent 1700037 commit 7e26afe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- 修复:播放页 调节播放器宽度 Firefox页面抖动bug
- 更新:播放页 右列功能适配页面变动
- 更新:空间页 动态评论过滤适配新版评论区
- 更新:部分功能细节

## 4.0.7
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const main = () => {
// 创建插件面板用shadowDOM节点
const wrap = document.createElement('div')
wrap.id = 'bili-cleaner'
const root = wrap.attachShadow({ mode: 'open' })
const root = wrap.attachShadow({ mode: 'closed' })
const style = document.createElement('style')
style.textContent = css
root.appendChild(style)
Expand Down
6 changes: 3 additions & 3 deletions src/modules/filters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ export const commentFilters: Filter[] = [
checkFn: () => isPageVideo() || isPageBangumi() || isPagePlaylist(),
},
{
name: '动态页/空间页 动态评论过滤', // 新版空间页评论区
name: '动态页 动态评论过滤',
groups: commentFilterDynamicGroups,
entry: commentFilterDynamicEntry,
checkFn: () => isPageDynamic() || isPageSpace(),
checkFn: () => isPageDynamic(),
},
{
name: '空间页 动态评论过滤', // 旧版空间页评论区
name: '空间页 动态评论过滤',
groups: commentFilterSpaceGroups,
entry: commentFilterSpaceEntry,
checkFn: () => isPageSpace(),
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rules/video/groups/right.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ html[video-page-hide-right-container-section-height] {
.video-sections-content-list,
.video-pod__body {
height: fit-content !important;
max-height: 370px !important;
max-height: 340px !important;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/shadow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { error } from './logger'
import { isPageBangumi, isPageDynamic, isPagePlaylist, isPageVideo } from './pageType'
import { isPageBangumi, isPageDynamic, isPagePlaylist, isPageSpace, isPageVideo } from './pageType'

type TagName = string

Expand Down Expand Up @@ -36,7 +36,7 @@ export class Shadow {
private constructor() {
try {
// 特定页面运行
if (isPageVideo() || isPageBangumi() || isPageDynamic() || isPagePlaylist()) {
if (isPageVideo() || isPageBangumi() || isPageSpace() || isPageDynamic() || isPagePlaylist()) {
this.hook()
}
} catch (err) {
Expand Down

0 comments on commit 7e26afe

Please sign in to comment.