Skip to content

Commit 42b58a3

Browse files
authored
Merge pull request #11 from festoney8/dev
merge dev to main
2 parents d7f4b50 + dd39551 commit 42b58a3

File tree

8 files changed

+181
-101
lines changed

8 files changed

+181
-101
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## 2.2.2
4+
5+
- 新增:顶栏 稍后再看相关选项
6+
- 新增:评论区规则、净化分享适配稍后再看页面、收藏夹页面
7+
- 优化:首页 隐藏下载桌面端弹窗 改为默认开启
8+
- 优化:全屏下隐藏弹幕输入框,完整展示章节名
9+
- 优化:用户开启开关时执行功能函数
10+
- 修复:视频列表增加高度
11+
312
## 2.2.1
413

514
- 新增:全屏下隐藏弹幕栏

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
### 注意事项
6464

6565
- 给 UP 主充电时,若出现 **充电窗口载入失败 (报错NaN)**,请关闭 **通用项「URL参数净化」** 功能,刷新页面再充电
66-
- **「版权视频播放页」大部分功能与「普通播放页」一致且互相同步,小部分功能为该页面独有,已用 "★" 重点标出**
66+
- **「版权视频播放页」大部分功能与「播放页」一致且互相同步,小部分独有功能已用 "★" 重点标出**
6767
- **已知Bug:** 在打开「版权作品播放页」时,小概率出现顶栏未净化的情况。已通过打补丁的方式暂时补救,副作用为打开页面数秒后顶栏净化规则才生效
6868

6969
## 浏览器适配

src/core/item.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ export class NormalItem implements IItem {
118118
if ((<HTMLInputElement>event.target).checked) {
119119
this.setStatus(true)
120120
this.insertItemCSS()
121+
if (this.itemFunc !== undefined) {
122+
this.itemFunc()
123+
}
121124
} else {
122125
this.setStatus(false)
123126
this.removeItemCSS()
@@ -164,24 +167,3 @@ export class NormalItem implements IItem {
164167
}
165168
}
166169
}
167-
168-
// export class SeparatorItem implements IItem {
169-
// constructor() {}
170-
// /**
171-
// * 向item list中添加分隔符<hr>, 用于划分功能组别
172-
// * @param groupID 由调用SeparatorItem的上级Group提供
173-
// */
174-
// insertItem(groupID: string) {
175-
// try {
176-
// const e = document.createElement('hr')
177-
// const itemGroupList = document.querySelector(`#${groupID} .bili-cleaner-item-list`) as HTMLFormElement
178-
// if (itemGroupList) {
179-
// itemGroupList.appendChild(e)
180-
// debug(`insertItem separator OK`)
181-
// }
182-
// } catch (err) {
183-
// error(`insertItem separator err`)
184-
// error(err)
185-
// }
186-
// }
187-
// }

src/pages/bangumi.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ if (location.href.startsWith('https://www.bilibili.com/bangumi/play/')) {
181181
),
182182
)
183183
}
184-
bangumiGroupList.push(new Group('bangumi-player', '播放器', playerItems))
184+
bangumiGroupList.push(new Group('bangumi-player', '播放器 (★为独有项)', playerItems))
185185

186186
// 播放控制part, playerControlItems
187187
{
@@ -451,6 +451,15 @@ if (location.href.startsWith('https://www.bilibili.com/bangumi/play/')) {
451451
.bpx-player-container[data-screen=full] .bpx-player-control-bottom-center,
452452
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-center {
453453
padding: 0 0 !important;
454+
}
455+
/* 弹幕开关按钮贴紧左侧, 有章节列表时增大列表宽度 */
456+
.bpx-player-container[data-screen=full] .bpx-player-control-bottom-left,
457+
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-left {
458+
min-width: unset !important;
459+
}
460+
.bpx-player-container[data-screen=full] .bpx-player-ctrl-viewpoint,
461+
.bpx-player-container[data-screen=web] .bpx-player-ctrl-viewpoint {
462+
width: fit-content !important;
454463
}`,
455464
),
456465
)

src/pages/common.ts

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ if (host === 't.bilibili.com') {
174174
border-radius: 3px !important;
175175
}`
176176
} else {
177-
if (href.startsWith('https://www.bilibili.com/video/')) {
177+
// 普通播放页, 稍后再看播放页, 收藏夹播放页
178+
if (
179+
href.includes('bilibili.com/video/') ||
180+
href.includes('bilibili.com/list/watchlater') ||
181+
href.includes('bilibili.com/list/ml')
182+
) {
178183
borderRadiusCSS = `
179184
#nav-searchform,
180185
.nav-search-content,
@@ -207,7 +212,7 @@ if (host === 't.bilibili.com') {
207212
.bpx-player-dm-btn-send .bui-button {
208213
border-radius: 3px 0 0 3px !important;
209214
}`
210-
} else if (href.startsWith('https://www.bilibili.com/bangumi/play/')) {
215+
} else if (href.includes('bilibili.com/bangumi/play/')) {
211216
borderRadiusCSS = `
212217
a[class^="mediainfo_mediaCover"],
213218
a[class^="mediainfo_btnHome"],
@@ -517,7 +522,7 @@ if (location.host != 'live.bilibili.com') {
517522
false,
518523
undefined,
519524
false,
520-
`div.bili-header__bar .left-entry li:has(a[href*="bilibili.com/BPU20"]) {display: none !important;}`,
525+
`div.bili-header__bar .left-entry li:has(>div>a[href*="bilibili.com/BPU20"]) {display: none !important;}`,
521526
),
522527
)
523528
// 隐藏 下载客户端, 默认开启
@@ -698,11 +703,11 @@ if (location.host != 'live.bilibili.com') {
698703
}`,
699704
),
700705
)
701-
// 隐藏 收藏
706+
// 隐藏 收藏, 隐藏 稍后再看
702707
headerRightItems.push(
703708
new NormalItem(
704709
'common-hide-nav-favorite',
705-
'隐藏 收藏/稍后再看',
710+
'隐藏 收藏,隐藏 稍后再看',
706711
false,
707712
undefined,
708713
false,
@@ -715,6 +720,56 @@ if (location.host != 'live.bilibili.com') {
715720
}`,
716721
),
717722
)
723+
// 隐藏 收藏, 显示 稍后再看(实验性)
724+
headerRightItems.push(
725+
new NormalItem(
726+
'common-hide-nav-favorite-keep-watchlater',
727+
'隐藏 收藏,显示 稍后再看(实验性)',
728+
false,
729+
undefined,
730+
false,
731+
`
732+
/* 移除加入稍后再看时的上翻动画 */
733+
.right-entry .v-popover-wrap .header-favorite-container-box {
734+
animation: unset !important;
735+
}
736+
.right-entry .v-popover-wrap .header-favorite-container-box .header-favorite-container__up {
737+
display: none !important;
738+
}
739+
.right-entry .v-popover-wrap .header-favorite-container-box .header-favorite-container__down {
740+
margin-top: 4px !important;
741+
}
742+
@media (max-width: 1279.9px) {
743+
.right-entry .v-popover-wrap .header-favorite-container-box .header-favorite-container__down {
744+
top: 10px;
745+
}
746+
}`,
747+
),
748+
)
749+
// 显示 收藏, 显示 稍后再看(实验性)
750+
headerRightItems.push(
751+
new NormalItem(
752+
'common-nav-keep-watchlater',
753+
'显示 收藏,显示 稍后再看(实验性)',
754+
false,
755+
undefined,
756+
false,
757+
`
758+
/* 移除加入稍后再看时的上翻动画 */
759+
.right-entry .v-popover-wrap .header-favorite-container-box {
760+
display: flex !important;
761+
animation: unset !important;
762+
}
763+
.right-entry .v-popover-wrap .header-favorite-container-box .header-favorite-container__down {
764+
margin-top: 0 !important;
765+
}
766+
@media (max-width: 1279.9px) {
767+
.right-entry .v-popover-wrap .header-favorite-container-box .header-favorite-container__down {
768+
top: 15px;
769+
}
770+
}`,
771+
),
772+
)
718773
// 隐藏 历史
719774
headerRightItems.push(
720775
new NormalItem(

src/pages/homepage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ if (location.href.startsWith('https://www.bilibili.com/') && ['/index.html', '/'
407407

408408
// 右下角part, sidebarItems
409409
{
410-
// 隐藏 下载桌面端弹窗
410+
// 隐藏 下载桌面端弹窗, 默认开启
411411
sidebarItems.push(
412412
new NormalItem(
413413
'homepage-hide-desktop-download-tip',
414414
'隐藏 下载桌面端弹窗',
415-
false,
415+
true,
416416
undefined,
417417
false,
418418
`.desktop-download-tip {display: none !important;}`,

0 commit comments

Comments
 (0)