diff --git a/.prettierrc.json b/.prettierrc similarity index 100% rename from .prettierrc.json rename to .prettierrc diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e17971..c1d7ec53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## 3.8.1 + +- 新增:播放页 禁用新版评论区灰度测试(临时功能) +- 优化:功能名称、功能细节 + ## 3.8.0 - 新增:动态过滤器 diff --git a/README.md b/README.md index 9f41a3fd..86f2cd34 100644 --- a/README.md +++ b/README.md @@ -88,12 +88,9 @@ - 启用用户名过滤后,在评论区右键单击用户名即可屏蔽 - 关键词黑名单大小写不敏感。支持正则,语法:`/abc|\d+/`,无需flag(一律默认`iv`模式,大小写不敏感) - **白名单权限高于黑名单,命中白名单的评论不会被隐藏** - -> [!NOTE] -> -> - **关键词不宜过于简单**,会误伤很多评论 -> - **编写正则要慎重**,可能造成大量评论屏蔽和频繁载入 -> - **屏蔽后,如果评论没有消失,很可能命中了白名单** +- **关键词不宜过于简单**,会误伤很多评论 +- **编写正则要慎重**,可能造成大量评论屏蔽和频繁载入 +- **屏蔽后,如果评论没有消失,很可能命中了白名单** ### 4. 快捷键 diff --git a/src/filters/dynFilter/filters/core.ts b/src/filters/dynFilter/filters/core.ts index 19cbf5df..8c53ee82 100644 --- a/src/filters/dynFilter/filters/core.ts +++ b/src/filters/dynFilter/filters/core.ts @@ -92,10 +92,9 @@ class CoreDynFilter { // 命中黑名单,未命中白名单 // debug(_result) if (!isEleHide(dyn)) { - log(`hide dyn - dynUploader: ${info.dynUploader} - dynDuration: ${info.dynDuration} - dynTitle: ${info.dynTitle}`) + log( + `hide dyn\ndynUploader: ${info.dynUploader}\ndynDuration: ${info.dynDuration}\ndynTitle: ${info.dynTitle}`, + ) } hideEle(dyn) }) @@ -106,10 +105,9 @@ class CoreDynFilter { }) } else { if (!isEleHide(dyn)) { - log(`hide dyn - dynUploader: ${info.dynUploader} - dynDuration: ${info.dynDuration} - dynTitle: ${info.dynTitle}`) + log( + `hide dyn\ndynUploader: ${info.dynUploader}\ndynDuration: ${info.dynDuration}\ndynTitle: ${info.dynTitle}`, + ) } hideEle(dyn) } diff --git a/src/global.d.ts b/src/global.d.ts index cf2e27b1..13b1dbbe 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -7,17 +7,20 @@ export declare global { aid?: number bvid?: string } - player: - | { - __core: () => { - uiStore: { - state: { - miniScreenBottom: number - miniScreenRight: number - } - } - } - } - | undefined + player?: { + __core: () => { + uiStore: { + state: { + miniScreenBottom: number + miniScreenRight: number + } + } + } + } + __INITIAL_STATE__?: { + abtest?: { + comment_next_version?: 'ELEMENTS' | 'DEFAULT' + } + } } } diff --git a/src/rules/bangumi.ts b/src/rules/bangumi.ts index 56bbc2e6..9e6e31e8 100644 --- a/src/rules/bangumi.ts +++ b/src/rules/bangumi.ts @@ -200,15 +200,11 @@ if (isPageBangumi()) { break case 'f11': // f11全屏模式 - if (isWebScreen()) { - webBtn.click() - } else { - webBtn.click() - } + webBtn.click() break case 'not': // 申请可滚动全屏 - document.body.requestFullscreen().then().catch() + document.documentElement.requestFullscreen().then().catch() if (!isWebScreen()) { webBtn.click() } @@ -219,9 +215,9 @@ if (isPageBangumi()) { fullBtn.parentElement?.replaceChild(newFullBtn, fullBtn) } else { cnt++ - cnt > 100 && clearInterval(id) + cnt > 50 && clearInterval(id) } - }, 100) + }, 200) }, enableFuncRunAt: 'document-end', disableFunc: async () => document.removeEventListener('wheel', disableAdjustVolume), @@ -786,20 +782,13 @@ if (isPageBangumi()) { defaultStatus: true, itemCSS: `.reply-header .reply-notice {display: none !important;}`, }), - // 隐藏 整个评论框 + // 隐藏 评论编辑器 new CheckboxItem({ itemID: 'video-page-hide-main-reply-box', - description: '隐藏 整个评论框', + description: '隐藏 评论编辑器', itemCSS: `.main-reply-box {height: 0 !important; visibility: hidden !important;} .reply-list {margin-top: -20px !important;}`, }), - // 隐藏 页面底部 吸附评论框, 默认开启 - new CheckboxItem({ - itemID: 'video-page-hide-fixed-reply-box', - description: '隐藏 页面底部 吸附评论框', - defaultStatus: true, - itemCSS: `.fixed-reply-box {display: none !important;}`, - }), // 隐藏 评论编辑器内占位文字, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-reply-box-textarea-placeholder', @@ -808,22 +797,29 @@ if (isPageBangumi()) { itemCSS: `.main-reply-box .reply-box-textarea::placeholder {color: transparent !important;} .fixed-reply-box .reply-box-textarea::placeholder {color: transparent !important;}`, }), + // 隐藏 页面底部 吸附评论框, 默认开启 + new CheckboxItem({ + itemID: 'video-page-hide-fixed-reply-box', + description: '隐藏 页面底部 吸附评论框', + defaultStatus: true, + itemCSS: `.fixed-reply-box {display: none !important;}`, + }), // 隐藏 评论区用户卡片 new CheckboxItem({ itemID: 'video-page-hide-comment-user-card', description: '隐藏 评论区用户卡片\n鼠标放在用户名上时不显示卡片', itemCSS: `.user-card {display: none!important;}`, }), - // 隐藏 评论内容右侧装饰 + // 隐藏 评论右侧装饰 new CheckboxItem({ itemID: 'video-page-hide-reply-decorate', - description: '隐藏 评论内容右侧装饰', + description: '隐藏 评论右侧装饰', itemCSS: `.reply-decorate {display: none !important;}`, }), - // 隐藏 ID后粉丝牌 + // 隐藏 粉丝牌 new CheckboxItem({ itemID: 'video-page-hide-fan-badge', - description: '隐藏 ID后粉丝牌', + description: '隐藏 粉丝牌', itemCSS: `.fan-badge {display: none !important;}`, }), // 隐藏 一级评论用户等级 @@ -838,24 +834,24 @@ if (isPageBangumi()) { description: '隐藏 二级评论用户等级', itemCSS: `.sub-user-level {display: none !important;}`, }), - // 隐藏 用户头像外圈饰品 + // 隐藏 用户头像饰品 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-pendent-dom', - description: '隐藏 用户头像外圈饰品', + description: '隐藏 用户头像饰品', itemCSS: `.root-reply-avatar .bili-avatar-pendent-dom {display: none !important;} .root-reply-avatar .bili-avatar {width: 48px !important; height:48px !important;}`, }), - // 隐藏 用户头像右下小icon + // 隐藏 用户头像徽章 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-nft-icon', - description: '隐藏 用户头像右下小icon', + description: '隐藏 用户头像徽章', itemCSS: `.bili-avatar-nft-icon {display: none !important;} .bili-avatar-icon {display: none !important;}`, }), - // 隐藏 评论内容下tag(热评) + // 隐藏 评论内容下Tag(热评) new CheckboxItem({ itemID: 'video-page-hide-reply-tag-list', - description: '隐藏 评论内容下tag(热评)', + description: '隐藏 评论内容下Tag(热评)', itemCSS: `.reply-tag-list {display: none !important;}`, }), // 隐藏 笔记评论前的小Logo, 默认开启 @@ -865,19 +861,19 @@ if (isPageBangumi()) { defaultStatus: true, itemCSS: `.note-prefix {display: none !important;}`, }), - // 隐藏 评论内容搜索关键词高亮, 默认开启 + // 禁用 评论内容搜索关键词高亮, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-jump-link-search-word', - description: '隐藏 评论内容搜索关键词高亮', + description: '禁用 评论内容搜索关键词高亮', defaultStatus: true, itemCSS: `.reply-content .jump-link.search-word {color: inherit !important;} .reply-content .jump-link.search-word:hover {color: #008AC5 !important;} .reply-content .icon.search-word {display: none !important;}`, }), - // 隐藏 二级评论中的@高亮 + // 禁用 二级评论中的@高亮 new CheckboxItem({ itemID: 'video-page-hide-reply-content-user-highlight', - description: '隐藏 二级评论中的@高亮', + description: '禁用 二级评论中的@高亮', itemCSS: `.sub-reply-container .reply-content .jump-link.user {color: inherit !important;} .sub-reply-container .reply-content .jump-link.user:hover {color: #40C5F1 !important;}`, }), diff --git a/src/rules/common.ts b/src/rules/common.ts index 0cfdcf4f..038cc1d9 100644 --- a/src/rules/common.ts +++ b/src/rules/common.ts @@ -478,13 +478,6 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 分区弹出框 - new CheckboxItem({ - itemID: 'common-hide-nav-channel-panel-popover', - description: '隐藏 分区弹出框', - itemCSS: `.bili-header .left-entry .bili-header-channel-panel {display: none !important;} - .bili-header .left-entry .mini-header__title .mini-header__arrow {display: none !important;}`, - }), // 隐藏 番剧 new CheckboxItem({ itemID: 'common-hide-nav-anime', @@ -504,14 +497,6 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 番剧弹出框 - new CheckboxItem({ - itemID: 'common-hide-nav-anime-popover', - description: '隐藏 番剧弹出框', - itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//www.bilibili.com/anime/"] + .v-popover { - display: none !important; - }`, - }), // 隐藏 直播 new CheckboxItem({ itemID: 'common-hide-nav-live', @@ -531,14 +516,6 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 直播弹出框 - new CheckboxItem({ - itemID: 'common-hide-nav-live-popover', - description: '隐藏 直播弹出框', - itemCSS: `.bili-header__bar .left-entry :is(.default-entry[href*="//live.bilibili.com"]) + .v-popover { - display: none !important; - }`, - }), // 隐藏 游戏中心 new CheckboxItem({ itemID: 'common-hide-nav-game', @@ -558,14 +535,6 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 游戏中心弹出框 - new CheckboxItem({ - itemID: 'common-hide-nav-game-popover', - description: '隐藏 游戏中心弹出框', - itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//game.bilibili.com"] + .v-popover { - display: none !important; - }`, - }), // 隐藏 会员购 new CheckboxItem({ itemID: 'common-hide-nav-vipshop', @@ -604,14 +573,6 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 漫画弹出框 - new CheckboxItem({ - itemID: 'common-hide-nav-manga-popover', - description: '隐藏 漫画弹出框', - itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//manga.bilibili.com"] + .v-popover { - display: none !important; - }`, - }), // 隐藏 赛事 new CheckboxItem({ itemID: 'common-hide-nav-match', @@ -681,7 +642,7 @@ if (!isPageLiveHome()) { display: none !important; }`, }), - // 隐藏 所有官方活动(blackboard) + // 隐藏 所有官方活动 new CheckboxItem({ itemID: 'common-hide-nav-blackboard', description: '隐藏 所有官方活动(强制)', @@ -706,22 +667,50 @@ if (!isPageLiveHome()) { display: none !important; }`, }), + // 隐藏 首页弹出框 + new CheckboxItem({ + itemID: 'common-hide-nav-channel-panel-popover', + description: '隐藏 首页弹出框', + itemCSS: `.bili-header .left-entry .bili-header-channel-panel {display: none !important;} + .bili-header .left-entry .mini-header__title .mini-header__arrow {display: none !important;}`, + }), + // 隐藏 番剧弹出框 + new CheckboxItem({ + itemID: 'common-hide-nav-anime-popover', + description: '隐藏 番剧弹出框', + itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//www.bilibili.com/anime/"] + .v-popover { + display: none !important; + }`, + }), + // 隐藏 直播弹出框 + new CheckboxItem({ + itemID: 'common-hide-nav-live-popover', + description: '隐藏 直播弹出框', + itemCSS: `.bili-header__bar .left-entry :is(.default-entry[href*="//live.bilibili.com"]) + .v-popover { + display: none !important; + }`, + }), + // 隐藏 游戏中心弹出框 + new CheckboxItem({ + itemID: 'common-hide-nav-game-popover', + description: '隐藏 游戏中心弹出框', + itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//game.bilibili.com"] + .v-popover { + display: none !important; + }`, + }), + // 隐藏 漫画弹出框 + new CheckboxItem({ + itemID: 'common-hide-nav-manga-popover', + description: '隐藏 漫画弹出框', + itemCSS: `.bili-header__bar .left-entry .default-entry[href*="//manga.bilibili.com"] + .v-popover { + display: none !important; + }`, + }), ] commonGroupList.push(new Group('common-header-left', '全站通用项 顶栏 左侧', headerLeftItems)) // 顶栏中间 const headerCenterItems = [ - // 修复 搜索框居中 - new CheckboxItem({ - itemID: 'common-nav-search-middle-justify', - description: '修复 搜索框居中', - itemCSS: ` - @media (min-width: 1100px) and (max-width: 1366.9px) { - .mini-header .center-search-container .center-search__bar { - margin: 0 auto; - } - }`, - }), // 隐藏 推荐搜索 new CheckboxItem({ itemID: 'common-hide-nav-search-rcmd', @@ -749,6 +738,17 @@ if (!isPageLiveHome()) { /* 旧版header */ #internationalHeader .nav-search-box .trending {display: none !important;}`, }), + // 修复 搜索框居中 + new CheckboxItem({ + itemID: 'common-nav-search-middle-justify', + description: '修复 搜索框居中', + itemCSS: ` + @media (min-width: 1100px) and (max-width: 1366.9px) { + .mini-header .center-search-container .center-search__bar { + margin: 0 auto; + } + }`, + }), ] commonGroupList.push(new Group('common-header-center', '全站通用项 顶栏 搜索框', headerCenterItems)) diff --git a/src/rules/dynamic.ts b/src/rules/dynamic.ts index 1a8e6760..fb3b4e52 100644 --- a/src/rules/dynamic.ts +++ b/src/rules/dynamic.ts @@ -245,32 +245,32 @@ if (isPageDynamic()) { description: '隐藏 动态右侧饰品', itemCSS: `.bili-dyn-ornament, .bili-dyn-item__ornament {display: none !important;}`, }), - // 隐藏 动态内容中 警告notice, 默认开启 + // 隐藏 警告notice, 默认开启 new CheckboxItem({ itemID: 'hide-dynamic-page-bili-dyn-dispute', - description: '隐藏 动态内容中 警告notice', + description: '隐藏 警告notice', defaultStatus: true, itemCSS: `.bili-dyn-content__dispute {display: none !important;}`, }), - // 隐藏 动态内容中 稍后再看按钮 + // 隐藏 稍后再看按钮 new CheckboxItem({ itemID: 'hide-dynamic-page-bili-dyn-watchlater', - description: '隐藏 动态内容中 稍后再看按钮', + description: '隐藏 稍后再看按钮', itemCSS: `.bili-dyn-card-video__mark {display: none !important;}`, }), - // 隐藏 动态内容中 官方话题Tag + // 隐藏 官方话题Tag new CheckboxItem({ itemID: 'hide-dynamic-page-bili-dyn-official-topic', - description: '隐藏 动态内容中 官方话题Tag', + description: '隐藏 官方话题Tag', // 不得隐藏普通tag .bili-rich-text-topic itemCSS: `.bili-dyn-content__orig__topic, .bili-dyn-content__forw__topic { display: none !important; }`, }), - // 动态内容中 普通Tag 去除高亮 + // 禁用 普通话题#Tag#高亮 new CheckboxItem({ itemID: 'hide-dynamic-page-bili-dyn-text-topic', - description: '动态内容中 普通Tag 去除高亮', + description: '禁用 普通话题#Tag#高亮', itemCSS: `.bili-rich-text-topic {color: inherit !important;} .bili-rich-text-topic:hover {color: var(--brand_blue) !important;}`, }), @@ -392,19 +392,12 @@ if (isPageDynamic()) { description: '隐藏 投票', itemCSS: `.comment-container .top-vote-card {display: none !important;}`, }), - // 隐藏 整个评论框 + // 隐藏 评论编辑器 new CheckboxItem({ itemID: 'video-page-hide-main-reply-box', - description: '隐藏 整个评论框', + description: '隐藏 评论编辑器', itemCSS: `.main-reply-box, .comment-container .fixed-reply-box {display: none !important;}`, }), - // 隐藏 页面底部 吸附评论框, 默认开启 - new CheckboxItem({ - itemID: 'video-page-hide-fixed-reply-box', - description: '隐藏 页面底部 吸附评论框', - defaultStatus: true, - itemCSS: `.fixed-reply-box {display: none !important;}`, - }), // 隐藏 评论编辑器内占位文字, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-reply-box-textarea-placeholder', @@ -412,10 +405,17 @@ if (isPageDynamic()) { defaultStatus: true, itemCSS: `:not(.reply-item) .reply-box-textarea::placeholder {color: transparent !important;}`, }), - // 隐藏 评论区用户卡片 + // 隐藏 页面底部 吸附评论框, 默认开启 + new CheckboxItem({ + itemID: 'video-page-hide-fixed-reply-box', + description: '隐藏 页面底部 吸附评论框', + defaultStatus: true, + itemCSS: `.fixed-reply-box {display: none !important;}`, + }), + // 隐藏 用户卡片 new CheckboxItem({ itemID: 'video-page-hide-comment-user-card', - description: '隐藏 评论区用户卡片\n鼠标放在用户名上时不显示卡片', + description: '隐藏 用户卡片\n鼠标放在用户名上时不显示卡片', itemCSS: `.user-card {display: none!important;}`, }), // 隐藏 评论右侧装饰 @@ -424,10 +424,10 @@ if (isPageDynamic()) { description: '隐藏 评论右侧装饰', itemCSS: `.reply-decorate {display: none !important;}`, }), - // 隐藏 ID后粉丝牌 + // 隐藏 粉丝牌 new CheckboxItem({ itemID: 'video-page-hide-fan-badge', - description: '隐藏 ID后粉丝牌', + description: '隐藏 粉丝牌', itemCSS: `.fan-badge {display: none !important;}`, }), // 隐藏 老粉、原始粉丝Tag @@ -448,16 +448,16 @@ if (isPageDynamic()) { description: '隐藏 二级评论用户等级', itemCSS: `.sub-user-level {display: none !important;}`, }), - // 隐藏 用户头像外圈饰品 + // 隐藏 用户头像饰品 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-pendent-dom', - description: '隐藏 用户头像外圈饰品', + description: '隐藏 用户头像饰品', itemCSS: `.bili-avatar-pendent-dom {display: none !important;}`, }), - // 隐藏 用户头像右下小icon + // 隐藏 用户头像徽章 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-nft-icon', - description: '隐藏 用户头像右下小icon', + description: '隐藏 用户头像徽章', itemCSS: `.bili-avatar-nft-icon {display: none !important;} .comment-container .bili-avatar-icon {display: none !important;}`, }), @@ -467,10 +467,10 @@ if (isPageDynamic()) { description: '隐藏 用户投票 (红方/蓝方)', itemCSS: `.comment-container .vote-info {display: none !important;}`, }), - // 隐藏 评论内容下tag(UP觉得很赞) + // 隐藏 评论内容下Tag(UP觉得很赞) new CheckboxItem({ itemID: 'video-page-hide-reply-tag-list', - description: '隐藏 评论内容下tag(UP觉得很赞)', + description: '隐藏 评论内容下Tag(UP觉得很赞)', itemCSS: `.reply-tag-list {display: none !important;}`, }), // 隐藏 笔记评论前的小Logo, 默认开启 @@ -480,18 +480,18 @@ if (isPageDynamic()) { defaultStatus: true, itemCSS: `.note-prefix {display: none !important;}`, }), - // 隐藏 评论内容搜索关键词高亮, 默认开启 + // 禁用 评论内容搜索关键词高亮, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-jump-link-search-word', - description: '隐藏 评论内容搜索关键词高亮', + description: '禁用 评论内容搜索关键词高亮', defaultStatus: true, itemCSS: `.reply-content .jump-link.search-word {color: inherit !important;} .comment-container .reply-content .icon.search-word {display: none !important;}`, }), - // 隐藏 二级评论中的@高亮 + // 禁用 二级评论中的@高亮 new CheckboxItem({ itemID: 'video-page-hide-reply-content-user-highlight', - description: '隐藏 二级评论中的@高亮', + description: '禁用 二级评论中的@高亮', itemCSS: `.sub-reply-container .reply-content .jump-link.user {color: inherit !important;} .comment-container .sub-reply-container .reply-content .jump-link.user:hover {color: #40C5F1 !important;}`, }), diff --git a/src/rules/homepage.ts b/src/rules/homepage.ts index f43cc62f..3c365434 100644 --- a/src/rules/homepage.ts +++ b/src/rules/homepage.ts @@ -258,10 +258,10 @@ if (isPageHomepage()) { ], defaultStatus: true, }), - // 强制使用 4 列布局 + // 使用 4 列布局 new RadioItem({ itemID: 'homepage-layout-4-column', - description: '强制使用 4 列布局', + description: '使用 4 列布局', radioName: 'homepage-layout-option', radioItemIDList: [ 'homepage-layout-default', @@ -273,10 +273,10 @@ if (isPageHomepage()) { grid-template-columns: repeat(4,1fr) !important; }`, }), - // 强制使用 5 列布局 + // 使用 5 列布局 new RadioItem({ itemID: 'homepage-layout-5-column', - description: '强制使用 5 列布局\n建议开启 增大视频信息字号', + description: '使用 5 列布局\n建议开启 增大视频信息字号', radioName: 'homepage-layout-option', radioItemIDList: [ 'homepage-layout-default', @@ -288,10 +288,10 @@ if (isPageHomepage()) { grid-template-columns: repeat(5,1fr) !important; }`, }), - // 强制使用 6 列布局 + // 使用 6 列布局 new RadioItem({ itemID: 'homepage-layout-6-column', - description: '强制使用 6 列布局\n建议 隐藏发布时间,可选 显示活动轮播', + description: '使用 6 列布局\n建议 隐藏发布时间,可选 显示活动轮播', radioName: 'homepage-layout-option', radioItemIDList: [ 'homepage-layout-default', diff --git a/src/rules/live.ts b/src/rules/live.ts index 5888308b..312c3867 100644 --- a/src/rules/live.ts +++ b/src/rules/live.ts @@ -237,11 +237,13 @@ if (isPageLiveRoom()) { defaultStatus: true, itemCSS: `#head-info-vm .lower-row .right-ctnr .activity-gather-entry {display: none !important;}`, }), - // 隐藏 全部直播信息栏 + // 隐藏 整个信息栏 new CheckboxItem({ itemID: 'live-page-head-info-vm', description: '隐藏 整个信息栏', itemCSS: `#head-info-vm {display: none !important;} + /* 壁纸高度 */ + #room-background-vm {min-height: calc(100vh - 64px) !important;} /* 补齐圆角, 不可important */ #player-ctnr { border-top-left-radius: 12px; @@ -347,7 +349,9 @@ if (isPageLiveRoom()) { new CheckboxItem({ itemID: 'live-page-gift-control-vm', description: '隐藏 礼物栏', - itemCSS: `#gift-control-vm, #gift-control-vm-new {display: none !important;} + itemCSS: `#gift-control-vm {display: none !important;} + /* 壁纸高度 */ + #room-background-vm {min-height: calc(100vh - 64px) !important;} /* 补齐圆角, 不可important */ #player-ctnr { border-bottom-left-radius: 12px; @@ -835,28 +839,28 @@ if (isPageLiveHome() || isPageLiveRoom()) { // 顶栏中间, headerCenterItems const headerCenterItems = [ - // 隐藏 搜索框 推荐搜索 + // 隐藏 推荐搜索 new CheckboxItem({ itemID: 'live-page-nav-search-rcmd', - description: '隐藏 搜索框 推荐搜索', + description: '隐藏 推荐搜索', itemCSS: `#nav-searchform input::placeholder {visibility: hidden;}`, }), - // 隐藏 搜索框 搜索历史 + // 隐藏 搜索历史 new CheckboxItem({ itemID: 'live-page-nav-search-history', - description: '隐藏 搜索框 搜索历史', + description: '隐藏 搜索历史', itemCSS: `#nav-searchform .history {display: none !important;}`, }), - // 隐藏 搜索框 bilibili热搜 + // 隐藏 bilibili热搜 new CheckboxItem({ itemID: 'live-page-nav-search-trending', - description: '隐藏 搜索框 bilibili热搜', + description: '隐藏 bilibili热搜', itemCSS: `#nav-searchform .trending {display: none !important;}`, }), - // 隐藏 整个搜索框 + // 隐藏 搜索框 new CheckboxItem({ itemID: 'live-page-header-search-block', - description: '隐藏 整个搜索框', + description: '隐藏 搜索框', itemCSS: `#nav-searchform {display: none !important;}`, }), ] diff --git a/src/rules/video.ts b/src/rules/video.ts index 581f78fb..fc5a7f4d 100644 --- a/src/rules/video.ts +++ b/src/rules/video.ts @@ -397,15 +397,11 @@ if (isPageVideo() || isPagePlaylist()) { break case 'f11': // f11全屏模式 - if (isWebScreen()) { - webBtn.click() - } else { - webBtn.click() - } + webBtn.click() break case 'not': // 申请可滚动全屏 - document.body.requestFullscreen().then().catch() + document.documentElement.requestFullscreen().then().catch() if (!isWebScreen()) { webBtn.click() } @@ -416,9 +412,9 @@ if (isPageVideo() || isPagePlaylist()) { fullBtn.parentElement?.replaceChild(newFullBtn, fullBtn) } else { cnt++ - cnt > 100 && clearInterval(id) + cnt > 50 && clearInterval(id) } - }, 100) + }, 200) }, enableFuncRunAt: 'document-end', disableFunc: async () => document.removeEventListener('wheel', disableAdjustVolume), @@ -544,10 +540,10 @@ if (isPageVideo() || isPagePlaylist()) { // 视频信息 const infoItems = [ - // 展开 完整视频标题 + // 展开 多行视频标题 new CheckboxItem({ itemID: 'video-page-unfold-video-info-title', - description: '展开 完整视频标题(多行)', + description: '展开 多行视频标题', itemCSS: ` .video-info-container:has(.show-more) { height: fit-content !important; @@ -604,16 +600,16 @@ if (isPageVideo() || isPagePlaylist()) { if (isPageVideo() || isPagePlaylist() || isPageFestival()) { // 播放器 const playerItems = [ - // 隐藏 一键三连弹窗 + // 隐藏 一键三连 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-guide-all', - description: '隐藏 一键三连弹窗', + description: '隐藏 一键三连', itemCSS: `.bpx-player-video-area .bili-guide, .bpx-player-video-area .bili-guide-all {display: none !important;}`, }), - // 隐藏 投票弹窗 + // 隐藏 投票 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-vote', - description: '隐藏 投票弹窗', + description: '隐藏 投票', itemCSS: `.bpx-player-video-area .bili-vote, .bpx-player-video-area .bili-cmd-shrink {display: none !important;}`, }), // 隐藏 播放效果调查, 默认开启 @@ -623,40 +619,40 @@ if (isPageVideo() || isPagePlaylist() || isPageFestival()) { defaultStatus: true, itemCSS: `.bpx-player-video-area .bili-qoeFeedback {display: none !important;}`, }), - // 隐藏 评分弹窗 + // 隐藏 评分 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-score', - description: '隐藏 评分弹窗', + description: '隐藏 评分', itemCSS: `.bpx-player-video-area .bili-score {display: none !important;}`, }), - // 隐藏 评分总结弹窗 + // 隐藏 评分总结 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-score-sum', - description: '隐藏 评分总结弹窗', + description: '隐藏 评分总结', itemCSS: `.bpx-player-video-area .bili-scoreSum {display: none !important;}`, }), - // 隐藏 打卡弹窗 + // 隐藏 打卡 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-clock', - description: '隐藏 打卡弹窗', + description: '隐藏 打卡', itemCSS: `.bpx-player-video-area .bili-clock {display: none !important;}`, }), - // 隐藏 视频预告弹窗 + // 隐藏 视频预告 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-reserve', - description: '隐藏 视频预告弹窗', + description: '隐藏 视频预告', itemCSS: `.bpx-player-video-area .bili-reserve {display: none !important;}`, }), - // 隐藏 视频链接弹窗 + // 隐藏 视频链接 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-bili-link', - description: '隐藏 视频链接弹窗(稍后再看)', + description: '隐藏 视频链接(稍后再看)', itemCSS: `.bpx-player-video-area .bili-link {display: none !important;}`, }), - // 隐藏 左上角 播放器内标题 + // 隐藏 播放器内标题 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-top-left-title', - description: '隐藏 左上角 播放器内标题', + description: '隐藏 播放器内标题', itemCSS: `.bpx-player-top-title {display: none !important;} .bpx-player-top-left-title {display: none !important;} /* 播放器上方阴影渐变 */ @@ -665,7 +661,7 @@ if (isPageVideo() || isPagePlaylist() || isPageFestival()) { // 隐藏 左上角 视频音乐链接 new CheckboxItem({ itemID: 'video-page-hide-bpx-player-top-left-music', - description: '隐藏 左上角 视频音乐链接', + description: '隐藏 视频音乐链接', itemCSS: `.bpx-player-top-left-music {display: none !important;}`, }), // 隐藏 左上角 关注UP主, 默认开启 @@ -1302,17 +1298,17 @@ if (isPageVideo() || isPagePlaylist()) { // up主信息 const upInfoItems = [ - // 隐藏 给UP发消息, 默认开启 + // 隐藏 发消息, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-up-sendmsg', - description: '隐藏 给UP发消息', + description: '隐藏 发消息', defaultStatus: true, itemCSS: `.up-detail .send-msg {display: none !important;}`, }), - // 隐藏 UP简介 + // 隐藏 UP主简介 new CheckboxItem({ itemID: 'video-page-hide-up-description', - description: '隐藏 UP简介', + description: '隐藏 UP主简介', itemCSS: `.up-detail .up-description {display: none !important;}`, }), // 隐藏 充电 @@ -1586,6 +1582,28 @@ if (isPageVideo() || isPagePlaylist()) { // 评论区 const commentItems = [ + // 禁用 新版评论区灰测 + new CheckboxItem({ + itemID: 'video-page-disable-next-comment-abtest', + description: '禁用 新版评论区灰测 (临时功能)\n评论区功能失效时 开启本项并刷新', + enableFunc: async () => { + let origValue = unsafeWindow.__INITIAL_STATE__ + if (origValue?.abtest?.comment_next_version) { + origValue.abtest.comment_next_version = 'DEFAULT' + } + Object.defineProperty(unsafeWindow, '__INITIAL_STATE__', { + get() { + return origValue + }, + set(value) { + if (value.abtest) { + value.abtest.comment_next_version = 'DEFAULT' + } + origValue = value + }, + }) + }, + }), // 隐藏 活动/notice, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-reply-notice', @@ -1593,21 +1611,14 @@ if (isPageVideo() || isPagePlaylist()) { defaultStatus: true, itemCSS: `.reply-header .reply-notice {display: none !important;}`, }), - // 隐藏 整个评论框 + // 隐藏 评论编辑器 new CheckboxItem({ itemID: 'video-page-hide-main-reply-box', - description: '隐藏 整个评论框', + description: '隐藏 评论编辑器', // 不可使用display: none, 会使底部吸附评论框宽度变化 itemCSS: `.main-reply-box {height: 0 !important; visibility: hidden !important;} .comment-container .reply-list {margin-top: -20px !important;}`, }), - // 隐藏 页面底部 吸附评论框, 默认开启 - new CheckboxItem({ - itemID: 'video-page-hide-fixed-reply-box', - description: '隐藏 页面底部 吸附评论框', - defaultStatus: true, - itemCSS: `.fixed-reply-box {display: none !important;}`, - }), // 隐藏 评论编辑器内占位文字, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-reply-box-textarea-placeholder', @@ -1616,22 +1627,29 @@ if (isPageVideo() || isPagePlaylist()) { itemCSS: `.main-reply-box .reply-box-textarea::placeholder {color: transparent !important;} .fixed-reply-box .reply-box-textarea::placeholder {color: transparent !important;}`, }), - // 隐藏 评论区用户卡片 + // 隐藏 页面底部 吸附评论框, 默认开启 + new CheckboxItem({ + itemID: 'video-page-hide-fixed-reply-box', + description: '隐藏 页面底部 吸附评论框', + defaultStatus: true, + itemCSS: `.fixed-reply-box {display: none !important;}`, + }), + // 隐藏 用户卡片 new CheckboxItem({ itemID: 'video-page-hide-comment-user-card', - description: '隐藏 评论区用户卡片\n鼠标放在用户名上时不显示卡片', + description: '隐藏 用户卡片\n鼠标放在用户名上时不显示卡片', itemCSS: `.user-card {display: none!important;}`, }), - // 隐藏 评论内容右侧装饰 + // 隐藏 评论右侧装饰 new CheckboxItem({ itemID: 'video-page-hide-reply-decorate', - description: '隐藏 评论内容右侧装饰', + description: '隐藏 评论右侧装饰', itemCSS: `.reply-decorate {display: none !important;}`, }), - // 隐藏 ID后粉丝牌 + // 隐藏 粉丝牌 new CheckboxItem({ itemID: 'video-page-hide-fan-badge', - description: '隐藏 ID后粉丝牌', + description: '隐藏 粉丝牌', itemCSS: `.fan-badge {display: none !important;}`, }), // 隐藏 老粉、原始粉丝Tag @@ -1652,17 +1670,17 @@ if (isPageVideo() || isPagePlaylist()) { description: '隐藏 二级评论用户等级', itemCSS: `.sub-user-level {display: none !important;}`, }), - // 隐藏 用户头像外圈饰品 + // 隐藏 用户头像饰品 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-pendent-dom', - description: '隐藏 用户头像外圈饰品', + description: '隐藏 用户头像饰品', itemCSS: `.root-reply-avatar .bili-avatar-pendent-dom {display: none !important;} .comment-container .root-reply-avatar .bili-avatar {width: 48px !important; height:48px !important;}`, }), - // 隐藏 用户头像右下小icon + // 隐藏 用户头像徽章 new CheckboxItem({ itemID: 'video-page-hide-bili-avatar-nft-icon', - description: '隐藏 用户头像右下小icon', + description: '隐藏 用户头像徽章', itemCSS: `.bili-avatar-nft-icon {display: none !important;} .comment-container .bili-avatar-icon {display: none !important;}`, }), @@ -1672,10 +1690,10 @@ if (isPageVideo() || isPagePlaylist()) { description: '隐藏 用户投票 (红方/蓝方)', itemCSS: `.vote-info {display: none !important;}`, }), - // 隐藏 评论内容下tag(UP觉得很赞) + // 隐藏 评论内容下Tag(UP觉得很赞) new CheckboxItem({ itemID: 'video-page-hide-reply-tag-list', - description: '隐藏 评论内容下tag(UP觉得很赞)', + description: '隐藏 评论内容下Tag(UP觉得很赞)', itemCSS: `.reply-tag-list {display: none !important;}`, }), // 隐藏 笔记评论前的小Logo, 默认开启 @@ -1685,19 +1703,19 @@ if (isPageVideo() || isPagePlaylist()) { defaultStatus: true, itemCSS: `.note-prefix {display: none !important;}`, }), - // 隐藏 评论内容搜索关键词高亮, 默认开启 + // 禁用 评论内容搜索关键词高亮, 默认开启 new CheckboxItem({ itemID: 'video-page-hide-jump-link-search-word', - description: '隐藏 评论内容搜索关键词高亮', + description: '禁用 评论内容搜索关键词高亮', defaultStatus: true, itemCSS: `.reply-content .jump-link.search-word {color: inherit !important;} .comment-container .reply-content .jump-link.search-word:hover {color: #008AC5 !important;} .comment-container .reply-content .icon.search-word {display: none !important;}`, }), - // 隐藏 二级评论中的@高亮 + // 禁用 二级评论中的@高亮 new CheckboxItem({ itemID: 'video-page-hide-reply-content-user-highlight', - description: '隐藏 二级评论中的@高亮', + description: '禁用 二级评论中的@高亮', itemCSS: `.sub-reply-container .reply-content .jump-link.user {color: inherit !important;} .comment-container .sub-reply-container .reply-content .jump-link.user:hover {color: #40C5F1 !important;}`, }), diff --git a/vite.config.ts b/vite.config.ts index e54352c8..339a3693 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ userscript: { name: 'bilibili 页面净化大师', namespace: 'http://tampermonkey.net/', - version: '3.8.0', + version: '3.8.1', description: '净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站', author: 'festoney8',