Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev to main, v3.8.1 #103

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 3.8.1

- 新增:播放页 禁用新版评论区灰度测试(临时功能)
- 优化:功能名称、功能细节

## 3.8.0

- 新增:动态过滤器
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@
- 启用用户名过滤后,在评论区右键单击用户名即可屏蔽
- 关键词黑名单大小写不敏感。支持正则,语法:`/abc|\d+/`,无需flag(一律默认`iv`模式,大小写不敏感)
- **白名单权限高于黑名单,命中白名单的评论不会被隐藏**

> [!NOTE]
>
> - **关键词不宜过于简单**,会误伤很多评论
> - **编写正则要慎重**,可能造成大量评论屏蔽和频繁载入
> - **屏蔽后,如果评论没有消失,很可能命中了白名单**
- **关键词不宜过于简单**,会误伤很多评论
- **编写正则要慎重**,可能造成大量评论屏蔽和频繁载入
- **屏蔽后,如果评论没有消失,很可能命中了白名单**

### 4. 快捷键

Expand Down
14 changes: 6 additions & 8 deletions src/filters/dynFilter/filters/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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)
}
Expand Down
27 changes: 15 additions & 12 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
}
}
58 changes: 27 additions & 31 deletions src/rules/bangumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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),
Expand Down Expand Up @@ -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',
Expand All @@ -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;}`,
}),
// 隐藏 一级评论用户等级
Expand All @@ -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, 默认开启
Expand All @@ -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;}`,
}),
Expand Down
102 changes: 51 additions & 51 deletions src/rules/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -681,7 +642,7 @@ if (!isPageLiveHome()) {
display: none !important;
}`,
}),
// 隐藏 所有官方活动(blackboard)
// 隐藏 所有官方活动
new CheckboxItem({
itemID: 'common-hide-nav-blackboard',
description: '隐藏 所有官方活动(强制)',
Expand All @@ -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',
Expand Down Expand Up @@ -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))

Expand Down
Loading