Skip to content

Commit

Permalink
Merge pull request #43 from festoney8/dev
Browse files Browse the repository at this point in the history
merge dev to main, v3.1.8
  • Loading branch information
festoney8 authored Mar 1, 2024
2 parents 6b9886c + a3dd877 commit f22c501
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 15 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.1.8

- 新增:隐藏爆炸特效弹幕
- 新增:隐藏整个评论区 #42
- 优化:直播页页面判断

## 3.1.7

- 新增:视频过滤支持频道页
Expand Down
6 changes: 6 additions & 0 deletions src/rules/bangumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,12 @@ if (isPageBangumi()) {
.reply-view-image .preview-list {opacity: 0.2; transition: opacity 0.1s ease-in-out;}
.reply-view-image .preview-list:hover {opacity: 1; transition: opacity 0.1s ease-in-out;}`,
}),
// 隐藏 整个评论区
new CheckboxItem({
itemID: 'video-page-hide-comment',
description: '隐藏 整个评论区',
itemCSS: `#comment, #comment-module {display: none;}`,
}),
]
bangumiGroupList.push(new Group('bangumi-comment', '评论区', commentItems))

Expand Down
3 changes: 2 additions & 1 deletion src/rules/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ if (isPageChannel()) {
.bili-grid:has([data-report="high_energy.content"]) aside[data-report="topic.card"] {
display: none !important;
}
.bili-grid:has([data-report="high_energy.content"]) .video-card-list {
.bili-grid:has([data-report="high_energy.content"]) .video-card-list,
.video-double-full {
min-height: unset !important;
}
@media (max-width: 1099.9px) {
Expand Down
7 changes: 4 additions & 3 deletions src/rules/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
isPageChannel,
isPageDynamic,
isPageHomepage,
isPageLive,
isPageLiveHome,
isPageLiveRoom,
isPagePlaylist,
isPagePopular,
isPageSearch,
Expand Down Expand Up @@ -124,7 +125,7 @@ if (isPageDynamic()) {
.bili-dyn-card-video__body {
border-radius: 0 3px 3px 0 !important;
}`
} else if (isPageLive()) {
} else if (isPageLiveRoom()) {
borderRadiusCSS = `
#nav-searchform,
#player-ctnr,
Expand Down Expand Up @@ -413,7 +414,7 @@ const basicItems = [
]
commonGroupList.push(new Group('common-basic', '全站通用项 基本功能', basicItems))
// 通用header净化,直播页除外
if (!isPageLive()) {
if (!isPageLiveRoom() && !isPageLiveHome()) {
// 顶栏左侧
const headerLeftItems = [
// 隐藏 主站Logo
Expand Down
9 changes: 6 additions & 3 deletions src/rules/live.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Group } from '../components/group'
import { CheckboxItem } from '../components/item'
import { debug } from '../utils/logger'
import { isPageLive } from '../utils/page-type'
import { isPageLiveHome, isPageLiveRoom } from '../utils/page-type'

let isCleanLiveDanmakuRunning = false
// 清理计数结尾弹幕
Expand Down Expand Up @@ -51,8 +51,8 @@ const cleanLiveDanmaku = () => {
// GroupList
const liveGroupList: Group[] = []

/** 直播页面规则, 只适用于直播间内, 不适用于直播首页 */
if (isPageLive()) {
// 直播页面规则, 只适用于直播间内, 不适用于直播首页
if (isPageLiveRoom()) {
// 基本功能
const basicItems = [
// 隐藏 页面右侧按钮 实验室/关注, 默认开启
Expand Down Expand Up @@ -447,7 +447,10 @@ if (isPageLive()) {
}),
]
liveGroupList.push(new Group('live-below', '下方页面 主播动态/直播公告', belowItems))
}

// 直播页顶栏规则
if (isPageLiveHome() || isPageLiveRoom()) {
// 顶栏左侧
const headerLeftItems = [
// 隐藏 直播LOGO
Expand Down
21 changes: 16 additions & 5 deletions src/rules/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,12 @@ if (isPageVideo() || isPagePlaylist() || isPageBnj()) {
description: '隐藏 高赞弹幕前点赞按钮',
itemCSS: `.bili-dm .bili-high-icon {display: none !important}`,
}),
// 隐藏 爆炸特效弹幕
new CheckboxItem({
itemID: 'video-page-bpx-player-bili-dm-boom',
description: '隐藏 爆炸特效弹幕',
itemCSS: `.bili-boom {display: none !important}`,
}),
// 彩色渐变弹幕 变成白色
new CheckboxItem({
itemID: 'video-page-bpx-player-bili-dm-vip-white',
Expand Down Expand Up @@ -557,14 +563,13 @@ if (isPageVideo() || isPagePlaylist() || isPageBnj()) {
description: '隐藏 发送按钮',
itemCSS: `.bpx-player-dm-btn-send {display: none !important;}`,
}),
// 隐藏 智能弹幕/广告弹幕
// 隐藏 智能弹幕 发送提示
new CheckboxItem({
itemID: 'video-page-hide-bpx-player-postpanel',
description: '隐藏 智能弹幕/广告弹幕',
itemCSS: `.bpx-player-postpanel-sug,
.bpx-player-postpanel-carousel,
.bpx-player-postpanel-popup {
color: transparent !important;
itemCSS: `
.bpx-player-postpanel-sug, .bpx-player-postpanel-carousel, .bpx-player-postpanel-popup {
display: none !important;
}`,
}),
// 非全屏下 关闭弹幕栏
Expand Down Expand Up @@ -1156,6 +1161,12 @@ if (isPageVideo() || isPagePlaylist()) {
.reply-view-image .preview-list {opacity: 0.2; transition: opacity 0.1s ease-in-out;}
.reply-view-image .preview-list:hover {opacity: 1; transition: opacity 0.1s ease-in-out;}`,
}),
// 隐藏 整个评论区 #42
new CheckboxItem({
itemID: 'video-page-hide-comment',
description: '隐藏 整个评论区',
itemCSS: `#comment, #comment-module {display: none;}`,
}),
]
videoGroupList.push(new Group('video-comment', '评论区', commentItems))

Expand Down
8 changes: 6 additions & 2 deletions src/utils/page-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const currPage = (): string => {
return 'dynamic'
}
if (host === 'live.bilibili.com') {
return 'live'
if (pathname.match(/^\/\d+/)) {
return 'liveRoom'
}
return 'liveHome'
}
if (href.includes('bilibili.com/bangumi/play/')) {
return 'bangumi'
Expand All @@ -45,7 +48,8 @@ export const isPageVideo = () => ans === 'video'
export const isPagePopular = () => ans === 'popular'
export const isPageSearch = () => ans === 'search'
export const isPageDynamic = () => ans === 'dynamic'
export const isPageLive = () => ans === 'live'
export const isPageLiveHome = () => ans === 'liveHome'
export const isPageLiveRoom = () => ans === 'liveRoom'
export const isPageBangumi = () => ans === 'bangumi'
export const isPagePlaylist = () => ans === 'playlist'
export const isPageBnj = () => ans === 'bnj'
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '3.1.7',
version: '3.1.8',
description:
'净化 B站/哔哩哔哩 网页元素,去广告,URL净化,BV号转AV号,播放器净化,过滤推荐视频,提供300+项功能,定制自己的B站页面',
author: 'festoney8',
Expand Down

0 comments on commit f22c501

Please sign in to comment.