Skip to content

Commit

Permalink
merge dev to main, v4.0.8 (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 authored Nov 7, 2024
2 parents f96e3ce + 7e26afe commit 7fa1b48
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 44 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 4.0.8

- 修复:播放页 调节播放器宽度 Firefox页面抖动bug
- 更新:播放页 右列功能适配页面变动
- 更新:部分功能细节

## 4.0.7

- 新增:首页 按播放量过滤
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const main = () => {
// 创建插件面板用shadowDOM节点
const wrap = document.createElement('div')
wrap.id = 'bili-cleaner'
const root = wrap.attachShadow({ mode: 'open' })
const root = wrap.attachShadow({ mode: 'closed' })
const style = document.createElement('style')
style.textContent = css
root.appendChild(style)
Expand Down
4 changes: 2 additions & 2 deletions src/modules/filters/variety/comment/pages/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const GM_KEYS = {
statusKey: 'dynamic-comment-call-user-filter-status',
},
callUserOnly: {
statusKey: 'video-comment-call-user-only-filter-status',
statusKey: 'dynamic-comment-call-user-only-filter-status',
},
isAD: {
statusKey: 'video-comment-ad-filter-status',
statusKey: 'dynamic-comment-ad-filter-status',
},
},
white: {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/variety/comment/pages/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GM_KEYS = {
statusKey: 'dynamic-comment-call-user-only-filter-status',
},
isAD: {
statusKey: 'video-comment-ad-filter-status',
statusKey: 'dynamic-comment-ad-filter-status',
},
},
white: {
Expand Down
8 changes: 7 additions & 1 deletion src/modules/rules/video/groups/playerLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ html[normalscreen-width] {
#playerWrap {
width: $normal-width !important;
height: fit-content !important;
display: flex !important;
#bilibili-player-placeholder {
position: static;
width: $normal-width !important;
Expand All @@ -267,5 +268,10 @@ html[normalscreen-width] {
}
}

// wide 不调节任何宽度
// wide 仅wide mini模式下调节背景色,去除切换小窗模式时宽度跳变
&[player-is-wide]:has(#bilibili-player [data-screen='mini']) {
#bilibili-player {
background-color: black !important;
}
}
}
42 changes: 19 additions & 23 deletions src/modules/rules/video/groups/right.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
// 优化 右栏底部吸附 (实验功能) 搭配“全屏时页面可滚动”使用
// 优化 右栏底部吸附
html[video-page-right-container-sticky-optimize] {
// 修复右栏底部吸附计算top时位置跳变
.video-container-v1 .right-container {
.right-container {
display: flex !important;
}
.video-container-v1 .right-container .right-container-inner {
position: sticky !important;
top: unset !important;
align-self: flex-end !important;

// fix #87, #84
max-width: 100% !important;
padding-bottom: 0 !important;
.right-container-inner {
width: 100% !important;
position: sticky !important;
top: unset !important;
align-self: flex-end !important;
min-height: calc(100vh - 64px) !important;

// fix #87, #84
max-width: 100% !important;
padding-bottom: 0 !important;
}
}

// 小窗播放器挡住下方视频 #87
body:has(.mini-player-window.on) .video-container-v1 .right-container .right-container-inner {
body:has(.mini-player-window.on) .right-container .right-container-inner {
min-height: calc(100vh - 304px) !important;
bottom: 240px !important;
}
body:has(.mini-player-window:not(.on)) .video-container-v1 .right-container .right-container-inner {
body:has(.mini-player-window:not(.on)) .right-container .right-container-inner {
min-height: calc(100vh - 74px) !important;
bottom: 10px !important;
}
}
Expand Down Expand Up @@ -91,11 +94,11 @@ html[video-page-hide-right-container-section-height] {
.video-sections-content-list,
.video-pod__body {
height: fit-content !important;
max-height: 350px !important;
max-height: 340px !important;
}
}

// 隐藏 视频合集 自动连播
// 隐藏 视频合集 自动连播开关
html[video-page-hide-right-container-section-next-btn] {
.base-video-sections-v1 .next-button {
display: none !important;
Expand Down Expand Up @@ -159,13 +162,6 @@ html[video-page-hide-right-container-section-subscribe] {
}
}

// 隐藏 分P视频 自动连播
html[video-page-hide-right-container-multi-page-next-btn] {
#multi_page .next-button {
display: none !important;
}
}

// 恢复 分P视频 编号
html[video-page-hide-right-container-multi-page-add-counter] {
.video-pod__list.multip.list {
Expand Down
20 changes: 7 additions & 13 deletions src/modules/rules/video/groups/right.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export const videoRightItems: Item[] = [
{
type: 'switch',
id: 'video-page-right-container-sticky-optimize',
name: '优化 全屏滚动时右栏底部吸附 (实验功能)',
description: ['搭配 "全屏时页面可滚动" 使用'],
name: '优化 右栏底部吸附',
},
{
type: 'switch',
Expand All @@ -31,7 +30,7 @@ export const videoRightItems: Item[] = [
{
type: 'switch',
id: 'video-page-hide-right-container-reco-list-next-play-next-button',
name: '隐藏 自动连播按钮',
name: '隐藏 自动连播开关',
},
{
type: 'switch',
Expand All @@ -40,14 +39,14 @@ export const videoRightItems: Item[] = [
},
{
type: 'switch',
id: 'video-page-hide-right-container-section-height',
name: '优化 视频合集列表高度',
defaultEnable: true,
id: 'video-page-hide-right-container-section-next-btn',
name: '隐藏 视频合集 自动连播开关',
},
{
type: 'switch',
id: 'video-page-hide-right-container-section-next-btn',
name: '隐藏 视频合集 自动连播',
id: 'video-page-hide-right-container-section-height',
name: '优化 视频合集列表高度',
defaultEnable: true,
},
{
type: 'switch',
Expand All @@ -65,11 +64,6 @@ export const videoRightItems: Item[] = [
id: 'video-page-hide-right-container-section-subscribe',
name: '隐藏 视频合集 订阅合集',
},
{
type: 'switch',
id: 'video-page-hide-right-container-multi-page-next-btn',
name: '隐藏 分P视频 自动连播',
},
{
type: 'switch',
id: 'video-page-hide-right-container-multi-page-add-counter',
Expand Down
4 changes: 2 additions & 2 deletions src/utils/shadow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { error } from './logger'
import { isPageBangumi, isPageDynamic, isPagePlaylist, isPageVideo } from './pageType'
import { isPageBangumi, isPageDynamic, isPagePlaylist, isPageSpace, isPageVideo } from './pageType'

type TagName = string

Expand Down Expand Up @@ -36,7 +36,7 @@ export class Shadow {
private constructor() {
try {
// 特定页面运行
if (isPageVideo() || isPageBangumi() || isPageDynamic() || isPagePlaylist()) {
if (isPageVideo() || isPageBangumi() || isPageSpace() || isPageDynamic() || isPagePlaylist()) {
this.hook()
}
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '4.0.7',
version: '4.0.8',
description:
'净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站',
author: 'festoney8',
Expand Down

0 comments on commit 7fa1b48

Please sign in to comment.