From 817118e19ddc565789bc66b46f9877da316d5e54 Mon Sep 17 00:00:00 2001 From: festoney8 Date: Sun, 14 Jan 2024 20:05:17 +0800 Subject: [PATCH] feat: dyn hide watchlater, fix bug --- CHANGELOG.md | 2 +- src/main.ts | 2 +- src/pages/dynamic.ts | 23 ++++++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfd7470..8a87bddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.3.3 -- 新增:动态页 支持隐藏左栏 +- 新增:动态页 支持隐藏左栏 隐藏稍后再看 - 新增:动态页 自动展开折叠动态 - 新增:动态页 支持过滤动态(隐藏Tag、预约、转发、带货) - 优化:普通播放页 关闭弹幕栏 支持去黑边(实验性) diff --git a/src/main.ts b/src/main.ts index 6ae7ca4f..a75801b7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,7 +66,7 @@ const main = async () => { GROUPS.forEach((e) => e.disableGroup()) isGroupEnable = false } else { - GROUPS.forEach((e) => e.enableGroup(true)) + GROUPS.forEach((e) => e.enableGroup(false)) isGroupEnable = true } } diff --git a/src/pages/dynamic.ts b/src/pages/dynamic.ts index 44b313fc..f08522fb 100644 --- a/src/pages/dynamic.ts +++ b/src/pages/dynamic.ts @@ -16,9 +16,7 @@ const dynamicUnfold = () => { debug(`unfold ${dynFoldNodes.length} fold`) } } - document.addEventListener('DOMContentLoaded', () => { - setInterval(unfold, 500) - }) + setInterval(unfold, 500) } const basicItems: CheckboxItem[] = [] @@ -181,22 +179,33 @@ if (location.host === 't.bilibili.com' || location.href.includes('bilibili.com/o `.bili-dyn-ornament {display: none !important;}`, ), ) - // 隐藏 动态内容内 警告notice, 默认开启 + // 隐藏 动态内容中 警告notice, 默认开启 centerItems.push( new CheckboxItem( 'hide-dynamic-page-bili-dyn-dispute', - '隐藏 动态内容内 警告notice', + '隐藏 动态内容中 警告notice', true, undefined, false, `.bili-dyn-content__dispute {display: none !important;}`, ), ) - // 隐藏 动态内容内 话题Tag + // 隐藏 动态内容中 稍后再看按钮 + centerItems.push( + new CheckboxItem( + 'hide-dynamic-page-bili-dyn-watchlater', + '隐藏 动态内容中 稍后再看按钮', + false, + undefined, + false, + `.bili-dyn-card-video__mark {display: none !important;}`, + ), + ) + // 隐藏 动态内容中 话题Tag centerItems.push( new CheckboxItem( 'hide-dynamic-page-bili-dyn-topic', - '隐藏 动态内容内 话题Tag', + '隐藏 动态内容中 话题Tag', false, undefined, false,