From 7e26afe994455aaf483610a853319ac56c94881e Mon Sep 17 00:00:00 2001 From: festoney8 Date: Thu, 7 Nov 2024 15:27:41 +0800 Subject: [PATCH] update: close shadowDOM, revert comment filter to last verision --- CHANGELOG.md | 1 - src/main.ts | 2 +- src/modules/filters/index.ts | 6 +++--- src/modules/rules/video/groups/right.scss | 2 +- src/utils/shadow.ts | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b2a1bd..2f7200e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ - 修复:播放页 调节播放器宽度 Firefox页面抖动bug - 更新:播放页 右列功能适配页面变动 -- 更新:空间页 动态评论过滤适配新版评论区 - 更新:部分功能细节 ## 4.0.7 diff --git a/src/main.ts b/src/main.ts index a6d61a4d..9e55469e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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) diff --git a/src/modules/filters/index.ts b/src/modules/filters/index.ts index 928f6b45..273ca92f 100644 --- a/src/modules/filters/index.ts +++ b/src/modules/filters/index.ts @@ -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(), diff --git a/src/modules/rules/video/groups/right.scss b/src/modules/rules/video/groups/right.scss index 3736c82f..761102d7 100644 --- a/src/modules/rules/video/groups/right.scss +++ b/src/modules/rules/video/groups/right.scss @@ -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; } } diff --git a/src/utils/shadow.ts b/src/utils/shadow.ts index 95dea354..a9df7dc5 100644 --- a/src/utils/shadow.ts +++ b/src/utils/shadow.ts @@ -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 @@ -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) {