Skip to content

Commit

Permalink
Merge pull request #67 from festoney8/dev
Browse files Browse the repository at this point in the history
merge dev to main, v3.4.7
  • Loading branch information
festoney8 committed Apr 24, 2024
2 parents 7f52b77 + 2010dfc commit f7813ab
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 37 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 3.4.7

- 优化:播放页视频信息置底
- 修复:视频切换分P后评论过滤失效bug
- 新增:直播页顶栏隐藏关注、电池、客户端

## 3.4.6

- 优化:优化评论区净化规则
Expand Down
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<div align="center">
<image src="./images/logo.png" height="120"></image>
<image src="./images/logo.png" height="100"></image>
<h1>bilibili 页面净化大师</h1>
<div>高度定制化的 bilibili 网页净化插件,提供 300+ 个功能开关,深度净化页面</div>
<div>支持「精简功能、去广告、播放器净化、过滤视频、过滤评论、全站黑白名单」等功能</div>
<a href="https://greasyfork.org/zh-CN/scripts/479861"><img alt="Greasyfork Version" src="https://img.shields.io/greasyfork/v/479861?style=flat-square"></a>
<a href="https://greasyfork.org/zh-CN/scripts/479861"><img alt="Downloads Total" src="https://img.shields.io/greasyfork/dt/479861?style=flat-square"></a>
<a href="https://greasyfork.org/zh-CN/scripts/479861"><img alt="Downloads Per Day" src="https://img.shields.io/greasyfork/dd/479861?style=flat-square"></a>
<a href="https://greasyfork.org/zh-CN/scripts/479861"><img alt="Rating" src="https://img.shields.io/greasyfork/rating-count/479861?style=flat-square"></a>
<br>
<br>

[安装使用](#安装) / [功能介绍](#功能介绍) / [浏览器适配](#浏览器适配) / [净化效果](#净化效果对比) / [插件兼容](#与其他-bilibili-插件的兼容性) / [数据备份](#数据导入与导出)
Expand All @@ -13,9 +16,9 @@

## 主要功能:页面净化、视频过滤、评论过滤

- **页面净化**:隐藏网页内各种元素,去除无用功能,净化顶栏、播放器、评论区等
- **页面净化**:隐藏网页内各种元素,去除无用功能,净化顶栏、播放器、评论区等,提供 300+ 功能开关

- **视频过滤**:根据视频时长、UP 主黑名单、标题关键词、BV 号筛选视频推荐
- **视频过滤**:根据视频时长、UP 主黑白名单、标题关键词黑白名单、BV 号筛选视频推荐

- **评论过滤**:根据用户名、评论内容关键词筛选评论

Expand All @@ -36,7 +39,7 @@

> [!IMPORTANT]
>
> - **重要:下列页面均有独立菜单,不同页面菜单各不相同**,按下图打开菜单进行设置,实时生效
> - **重要:下列页面均有独立菜单,不同页面菜单不同**,按下图打开菜单进行设置,实时生效
> - **页面净化:「首页、播放页、影视番剧播放页、直播间、搜索页、动态页、热门页、频道页」**
> - **视频过滤:「首页、播放页、搜索页、热门页、频道页、空间页」**
> - **评论过滤:「播放页、影视番剧播放页」**
Expand All @@ -47,25 +50,25 @@

### 1. 页面净化

- 适用于 **净化新版 bilibili 网页**,不做老版本页面适配
- 混搭各种功能,调节浏览器缩放比例,可调节出自己满意的页面效果
- 默认用户已登录,默认开启基础屏蔽功能,大会员体验最佳
- 已知bug:支持切换视角的直播、特殊活动直播,调节脚本设置后需刷新页面才生效,弹幕净化不生效

> [!NOTE]
>
> - 给 UP 主充电时,若出现 **充电窗口载入失败 (报错NaN)**,请关闭 **通用项「URL参数净化」**,刷新页面再充电
> - **「影视番剧播放页」多数功能与「播放页」一致且互相同步,独有功能已用 "★" 重点标出**
> - 「动态页」评论区功能与「播放页」一致且互相同步
- 适用于净化新版 bilibili 网页,不适配老版本页面,默认用户已登录,大会员体验最佳
- 混搭各种功能,调节浏览器缩放比例,可得到满意的页面效果
- 「影视番剧播放页」多数功能与「播放页」一致且同步,「动态页」评论区功能与「播放页」一致且同步
- 已知bug:给 UP 主充电时,若出现 **充电窗口载入失败 (报错NaN)**,请关闭通用项「URL参数净化」,刷新页面再充电
- 已知bug:特殊活动直播,调节脚本设置后需刷新页面才生效,弹幕净化不生效

### 2. 视频过滤

> [!CAUTION]
>
> - **如果屏蔽了大量内容,请定时备份,更换电脑或浏览器务必备份,[备份方法](#数据导入与导出)**
> - 如果你在意推送质量,不要点开不喜欢的视频,不要点开不喜欢的 UP 主的个人页,请在无痕浏览打开
- 视频过滤支持「UP主、BV号、标题关键词、视频时长」四种模式
- 启用 UP 主过滤后,右键单击 UP 主即可屏蔽;启用 BV 号过滤后,右键单击视频标题即可屏蔽
- **每个页面有独立的功能开关,但黑名单、白名单全站共用一份**
- **白名单权限高于黑名单,命中白名单的视频不会被隐藏**
- 「标题关键词过滤」和「标题关键词白名单」大小写不敏感。均支持正则(大小写不敏感),正则用 `/ ... /` 括起来,如:`/abc|\d+/`
- **已知bug:视频过滤在带`index.html`后缀的首页不生效**,请使用无后缀首页 `https://www.bilibili.com/`
- 已知bug:视频过滤在带`index.html`后缀的首页不生效,请使用无后缀首页 `https://www.bilibili.com/`

> [!NOTE]
>
Expand All @@ -78,12 +81,6 @@
> - 屏蔽视频时会在 Console 输出日志,按 F12 查看日志
> - 这里有一些常见标题关键词整理:[查看](./NOTE.md)
> [!CAUTION]
>
> - **如果屏蔽了大量内容,请定时备份,更换电脑或浏览器务必备份,[备份方法](#数据导入与导出)**
> - 如果你在意推送质量,不要点开不喜欢的视频,不要点开不喜欢的 UP 主的个人页
> - 点开视频/点开个人页是正反馈,推荐系统误认为你喜欢,导致推送变差,请复制链接使用无痕浏览
### 3. 评论过滤

- 评论过滤支持「用户名、关键词」两种模式
Expand All @@ -99,10 +96,7 @@
### 4. 快捷键

- 支持使用快捷键 `Alt + B``Ctrl + Alt + B` 快速开启/关闭**页面净化**功能,迅速查看净化对比
- Firefox 浏览器仅支持 `Ctrl + Alt + B`
- 临时使用被隐藏的按钮时,只需快捷键快速关闭插件,不用打开菜单寻找选项
- 快速关闭只支持停用CSS规则
- 支持使用快捷键 `Alt + B``Ctrl + Alt + B` 快速开启/关闭 页面净化,可用于临时使用一些功能(Firefox 仅支持 `Ctrl + Alt + B`

## 浏览器适配

Expand Down Expand Up @@ -211,6 +205,7 @@
### 2. 与 [bilibili-app-recommend](https://greasyfork.org/zh-CN/scripts/443530) 的兼容性

- **兼容**,提供 **隐藏 视频tag / 隐藏 弹幕数 / 隐藏 点赞数** 功能,在首页功能菜单末尾
- bilibili-app-recommend 自带 UP 主黑名单,无需使用本插件的视频过滤

### 3. 与 [Bilibili 旧播放页](https://github.com/MotooriKashin/Bilibili-Old) 的兼容性

Expand All @@ -220,6 +215,10 @@

- **兼容**,推荐搭配使用

### 5. 与 [BewlyBewly](https://github.com/hakadao/BewlyBewly) 的兼容性

- **不兼容 BewlyBewly 新版首页**,只兼容 BewlyBewly 使用原版 B 站首页

## 数据导入与导出

<details>
Expand Down
Binary file modified images/usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/filters/commentFilter/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ if (isPageVideo() || isPageBangumi() || isPagePlaylist()) {
}

try {
waitForEle(document, '.reply-warp', (node: Node): boolean => {
return node instanceof HTMLElement && (node as HTMLElement).className === 'reply-warp'
waitForEle(document, '#comment, #comment-body, .playlist-comment', (node: Node): boolean => {
return (
node instanceof HTMLElement &&
(['comment', 'comment-body'].includes((node as HTMLElement).id) ||
(node as HTMLElement).className === 'playlist-comment')
)
}).then((ele) => {
if (ele) {
commentListContainer = ele
Expand Down
26 changes: 22 additions & 4 deletions src/rules/live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,27 +614,45 @@ if (isPageLiveHome() || isPageLiveRoom()) {
new CheckboxItem({
itemID: 'live-page-header-dynamic',
description: '隐藏 动态',
itemCSS: `#right-part .shortcuts-ctnr .shortcut-item:has(.link-panel-ctnr) {display: none !important;}`,
itemCSS: `#right-part .shortcut-item:has(.link-panel-ctnr) {display: none !important;}`,
}),
// 隐藏 签到
new CheckboxItem({
itemID: 'live-page-header-checkin',
description: '隐藏 签到',
itemCSS: `#right-part .shortcuts-ctnr .shortcut-item:has(.calendar-checkin) {display: none !important;}`,
itemCSS: `#right-part .shortcut-item:has(.calendar-checkin) {display: none !important;}`,
}),
// 隐藏 幻星互动, 默认开启
new CheckboxItem({
itemID: 'live-page-header-interact',
description: '隐藏 幻星互动',
defaultStatus: true,
itemCSS: `#right-part .shortcuts-ctnr .shortcut-item:has(.fanbox-panel-ctnr) {display: none !important;}`,
itemCSS: `#right-part .shortcut-item:has(.fanbox-panel-ctnr) {display: none !important;}`,
}),
// 隐藏 关注
new CheckboxItem({
itemID: 'live-page-header-follow-panel',
description: '隐藏 关注',
itemCSS: `#right-part .shortcut-item:has(.follow-panel-set) {display: none;}`,
}),
// 隐藏 购买电池
new CheckboxItem({
itemID: 'live-page-header-recharge',
description: '隐藏 购买电池',
itemCSS: `#right-part .shortcut-item:has(.item-icon-recharge) {display: none;}`,
}),
// 隐藏 下载客户端
new CheckboxItem({
itemID: 'live-page-header-bili-download-panel',
description: '隐藏 下载客户端',
itemCSS: `#right-part .shortcut-item:has(.bili-download-panel) {visibility: hidden;}`,
}),
// 隐藏 我要开播, 默认开启
new CheckboxItem({
itemID: 'live-page-header-go-live',
description: '隐藏 我要开播',
defaultStatus: true,
itemCSS: `#right-part .shortcuts-ctnr .shortcut-item:has(.download-panel-ctnr) {visibility: hidden;}`,
itemCSS: `#right-part .shortcut-item:has(.download-panel-ctnr) {visibility: hidden;}`,
}),
]
liveGroupList.push(new Group('live-header-right', '顶栏 右侧', headerRightItems))
Expand Down
4 changes: 2 additions & 2 deletions src/rules/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ if (isPageVideo() || isPagePlaylist()) {
itemID: 'video-page-right-container-set-info-bottom',
description: '相关视频 视频信息置底',
defaultStatus: true,
itemCSS: `.video-page-card-small .card-box .info {display: flex !important; flex-direction: column !important;}
.video-page-card-small .card-box .info .upname {margin-top: auto !important;}`,
itemCSS: `:is(.video-page-card-small, .video-page-operator-card-small) .card-box .info {display: flex !important; flex-direction: column !important;}
:is(.video-page-card-small, .video-page-operator-card-small) .card-box .info .upname {margin-top: auto !important;}`,
}),
// 隐藏 相关视频 视频时长
new CheckboxItem({
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '3.4.6',
version: '3.4.7',
description:
'净化 B站/哔哩哔哩 网页元素,去广告,BV号转AV号,播放器净化过滤视频过滤评论,提供300+项功能,定制自己的B站页面',
'净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化过滤视频过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站',
author: 'festoney8',
homepage: 'https://github.com/festoney8/bilibili-cleaner',
supportURL: 'https://github.com/festoney8/bilibili-cleaner',
Expand Down

0 comments on commit f7813ab

Please sign in to comment.