Skip to content

Commit

Permalink
Merge branch 'preview-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed May 14, 2024
2 parents d4b6ea0 + d1d675a commit 66ede2a
Show file tree
Hide file tree
Showing 20 changed files with 239 additions and 138 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
<!-- spell-checker: disable -->
# 更新日志

## v2.8.11-preview
`2024-05-14`

包含 [v2.8.11](https://github.com/the1812/Bilibili-Evolved/releases/tag/v2.8.11) 的所有更新内容.

✨新增
- `下载视频 - WASM 混流输出` 支持批量下载. (PR #4726 by [WakelessSloth56](https://github.com/WakelessSloth56))
- `夜间模式` 增加 `color-scheme` meta 信息, 适配 Chrome 的 [Fluent overlay scrollbars](chrome://flags/#fluent-overlay-scrollbars). (#4717)

## v2.8.11
`2024-05-14`

🐛修复
- 修复了搜索框中的 XSS 注入问题.
- 修复 `评论区IP属地显示` 失效. (#4690)
- 在搜索框中删除搜索历史时将不再收起下拉菜单. (#4732)
- 修复功能反复开关时, 功能面板中的按钮重复出现. (#4731)
- 修复功能面板空间不足时出现折行. (#4721)
- 修复 `启用视频截图` 在番剧区失效. (#4719)

☕开发者相关
- Comment API 调整:
- 增加对 `CommentArea` 销毁的监测.
- `forEachCommentItem` / `forEechCommentArea` 参数统一支持 `added``removed` 回调.
- `CommentReplyItem` / `CommentItem` 增加属性 `vueProps`.


## v2.8.10-preview
`2024-04-23`

Expand Down
2 changes: 2 additions & 0 deletions doc/donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ https://afdian.net/@the1812?tab=sponsor

| 时间 | 用户名 | 单号后4位 | 金额 |
| ------------------- | --------------------- | --------- | ------- |
| 2024.05.02 16:06:40 | C*6 | 9321 | ¥100.00 |
| 2024.05.02 01:51:05 | 匿名 | 7540 | ¥5.00 |
| 2024.04.08 16:02:38 | 匿名 | 2455 | ¥5.00 |
| 2024.03.31 16:36:20 | N*r | 3391 | ¥5.20 |
| 2024.03.27 21:25:21 | M*g | 0180 | ¥10.00 |
Expand Down
6 changes: 3 additions & 3 deletions doc/features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
"type": "component",
"name": "videoDefaultLocation",
"displayName": "视频页默认定位",
"description": "打开视频/番剧时自动定位到指定位置\r\n\r\n<div class=\"video-default-location-desc-detail\">\r\n\r\n位置:距离页面顶部的像素距离\\\r\n默认位置:打开视频时自动定位到此处\\\r\n位置测试:查看、调整当前页面所在位置\r\n\r\n当前版本限制默认位置的最大值为 4000。\\\r\n若有其他希望支持的页面,请提交反馈。\\\r\n脚本不会等待评论完全加载,因此较大的默认位置将无法正确定位。\r\n\r\n</div>\r\n\r\n<style>\r\n.video-default-location-desc-detail.video-default-location-desc-detail p {\r\n margin-top: 1ex;\r\n}\r\n</style>\r\n",
"description": "打开视频/番剧时自动定位到指定位置\r\n\r\n位置:距离页面顶部的像素距离\\\r\n默认位置:打开视频时自动定位到此处\\\r\n位置测试:查看、调整当前页面所在位置\r\n\r\n当前版本限制默认位置的最大值为 4000。\\\r\n若有其他希望支持的页面,请提交反馈。\\\r\n脚本不会等待评论完全加载,因此较大的默认位置将无法正确定位。\r\n",
"fullRelativePath": "../../registry/dist/components/video/default-location.js",
"fullAbsolutePath": "registry/dist/components/video/default-location.js"
},
Expand Down Expand Up @@ -779,7 +779,7 @@
"type": "component",
"name": "extendVideoSpeed",
"displayName": "扩展倍速",
"description": "by [@JLoeve](https://github.com/LonelySteve)\n\n\n\n> 扩展视频播放器的倍速菜单项,可用于突破原有播放倍数的上限或下限.\n\n### 🔧 **选项**\n\n- `隐藏滚动条`:如果添加的倍速过多,倍速菜单将出现滚动条,在 Windows 下,若没有安装并启用「细滚动条」组件会显得比较挤,建议开启此选项隐藏滚动条.\n\n- `隐藏移除图标`:如果认为倍速右侧的移除倍速图标有些突兀,可以开启此选项隐藏.\n\n- `隐藏新增图标`:如果认为顶部的新增倍速图标有些突兀,可以开启此选项隐藏.\n\n### **新增倍速**\n\n开启组件后,在默认情况下,播放器的倍速菜单就会新增 2.5x 和 3.0x 两个倍速选项.\n\n如果需要添加更多倍速,只需将鼠标指针移到菜单顶部的新增图标上,图标将变成一个输入框,根据需要键入新的倍速值,或通过滚轮增减数值,或直接使用推荐的数值,回车确认即可.\n\n新增倍速的范围要求在 0.0625 到 16 之间,数量则不受限制.\n\n**不推荐设置超高倍速(>3.0x)**:原生播放器内部没有针对超高倍速进行优化,可能导致音画不同步、播放卡顿、声音嘈杂/消失等一系列问题.\n\n### **删除倍速**\n\n将鼠标指针移到**自定义**的倍速菜单项上,其右侧将会显示一个移除图标,单击即可删除相应的倍速.\n\n",
"description": "by [@JLoeve](https://github.com/LonelySteve)\n\n\n\n> 扩展视频播放器的倍速菜单项,可用于突破原有播放倍数的上限或下限.\n\n#### 🔧 **选项**\n\n- `隐藏滚动条`:如果添加的倍速过多,倍速菜单将出现滚动条,在 Windows 下,若没有安装并启用「细滚动条」组件会显得比较挤,建议开启此选项隐藏滚动条.\n\n- `隐藏移除图标`:如果认为倍速右侧的移除倍速图标有些突兀,可以开启此选项隐藏.\n\n- `隐藏新增图标`:如果认为顶部的新增倍速图标有些突兀,可以开启此选项隐藏.\n\n#### **新增倍速**\n\n开启组件后,在默认情况下,播放器的倍速菜单就会新增 2.5x 和 3.0x 两个倍速选项.\n\n如果需要添加更多倍速,只需将鼠标指针移到菜单顶部的新增图标上,图标将变成一个输入框,根据需要键入新的倍速值,或通过滚轮增减数值,或直接使用推荐的数值,回车确认即可.\n\n新增倍速的范围要求在 0.0625 到 16 之间,数量则不受限制.\n\n**不推荐设置超高倍速(>3.0x)**:原生播放器内部没有针对超高倍速进行优化,可能导致音画不同步、播放卡顿、声音嘈杂/消失等一系列问题.\n\n#### **删除倍速**\n\n将鼠标指针移到**自定义**的倍速菜单项上,其右侧将会显示一个移除图标,单击即可删除相应的倍速.\n\n",
"fullRelativePath": "../../registry/dist/components/video/player/extend-speed.js",
"fullAbsolutePath": "registry/dist/components/video/player/extend-speed.js"
},
Expand Down Expand Up @@ -827,7 +827,7 @@
"type": "component",
"name": "rememberVideoSpeed",
"displayName": "记忆倍速",
"description": "by [@JLoeve](https://github.com/LonelySteve)\n\n\n\n> 提高视频播放器的倍速记忆体验,可实现跨页共享倍速,也可以按视频分别记忆倍速.\n\n### 🔧 **选项**\n\n- `全局记忆倍速值`:默认情况下,这是跨页共享的倍速值,如果启用「各视频分别记忆」,则作为从未独立记忆倍速视频的初始倍速值.\n- `固定全局倍速值`:默认情况下,全局倍速值将随着用户改变视频倍速而改变,打开此选项后,全局记忆倍速值不再受倍速调整的影响.\n- `各视频分别记忆`:打开此选项后,将按不同视频分别记忆倍速,对于从未被记忆过倍速的视频,将采用全局记忆倍速值,选项「固定全局倍速值」在此情况下强制生效.\n- `弹出还原倍速提示`:打开此选项后,每次成功还原倍速后都会弹出提示.\n\n### 🌈 **温馨提示**\n\n「扩展倍速」和倍速相关的快捷键插件已分离为单独的组件或插件.\n\n请根据自身需要:\n\n- 前往「组件」页面安装[「扩展倍速」]((branch, ownerOverride) => `https://${host}/${ownerOverride || owner}/Bilibili-Evolved/${branch}/`registry/dist/components/video/player/extend-speed.js)组件\n- 前往「插件」页面安装[「快捷键扩展 - 视频倍速」]((branch, ownerOverride) => `https://${host}/${ownerOverride || owner}/Bilibili-Evolved/${branch}/`registry/dist/plugins/video/player/speed.js)插件.\n\n*如果想要清除当前视频的记忆状态,需要安装「快捷键扩展 - 视频倍速」插件.*\n",
"description": "by [@JLoeve](https://github.com/LonelySteve)\n\n\n\n> 提高视频播放器的倍速记忆体验,可实现跨页共享倍速,也可以按视频分别记忆倍速.\n\n#### 🔧 **选项**\n\n- `全局记忆倍速值`:默认情况下,这是跨页共享的倍速值,如果启用「各视频分别记忆」,则作为从未独立记忆倍速视频的初始倍速值.\n- `固定全局倍速值`:默认情况下,全局倍速值将随着用户改变视频倍速而改变,打开此选项后,全局记忆倍速值不再受倍速调整的影响.\n- `各视频分别记忆`:打开此选项后,将按不同视频分别记忆倍速,对于从未被记忆过倍速的视频,将采用全局记忆倍速值,选项「固定全局倍速值」在此情况下强制生效.\n- `弹出还原倍速提示`:打开此选项后,每次成功还原倍速后都会弹出提示.\n\n#### 🌈 **温馨提示**\n\n「扩展倍速」和倍速相关的快捷键插件已分离为单独的组件或插件.\n\n请根据自身需要:\n\n- 前往「组件」页面安装[「扩展倍速」]((branch, ownerOverride) => `https://${host}/${ownerOverride || owner}/Bilibili-Evolved/${branch}/`registry/dist/components/video/player/extend-speed.js)组件\n- 前往「插件」页面安装[「快捷键扩展 - 视频倍速」]((branch, ownerOverride) => `https://${host}/${ownerOverride || owner}/Bilibili-Evolved/${branch}/`registry/dist/plugins/video/player/speed.js)插件.\n\n*如果想要清除当前视频的记忆状态,需要安装「快捷键扩展 - 视频倍速」插件.*\n",
"fullRelativePath": "../../registry/dist/components/video/player/remember-speed.js",
"fullAbsolutePath": "registry/dist/components/video/player/remember-speed.js"
},
Expand Down
20 changes: 5 additions & 15 deletions doc/features/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,6 @@ by [@kdxcxs](https://github.com/kdxcxs)

打开视频/番剧时自动定位到指定位置

<div class="video-default-location-desc-detail">

位置:距离页面顶部的像素距离\
默认位置:打开视频时自动定位到此处\
位置测试:查看、调整当前页面所在位置
Expand All @@ -937,14 +935,6 @@ by [@kdxcxs](https://github.com/kdxcxs)
若有其他希望支持的页面,请提交反馈。\
脚本不会等待评论完全加载,因此较大的默认位置将无法正确定位。

</div>

<style>
.video-default-location-desc-detail.video-default-location-desc-detail p {
margin-top: 1ex;
}
</style>

### [下载视频](../../registry/dist/components/video/download.js)
`downloadVideo`

Expand Down Expand Up @@ -1045,15 +1035,15 @@ by [@JLoeve](https://github.com/LonelySteve)

> 扩展视频播放器的倍速菜单项,可用于突破原有播放倍数的上限或下限.
### 🔧 **选项**
#### 🔧 **选项**

- `隐藏滚动条`:如果添加的倍速过多,倍速菜单将出现滚动条,在 Windows 下,若没有安装并启用「细滚动条」组件会显得比较挤,建议开启此选项隐藏滚动条.

- `隐藏移除图标`:如果认为倍速右侧的移除倍速图标有些突兀,可以开启此选项隐藏.

- `隐藏新增图标`:如果认为顶部的新增倍速图标有些突兀,可以开启此选项隐藏.

### **新增倍速**
#### **新增倍速**

开启组件后,在默认情况下,播放器的倍速菜单就会新增 2.5x 和 3.0x 两个倍速选项.

Expand All @@ -1063,7 +1053,7 @@ by [@JLoeve](https://github.com/LonelySteve)

**不推荐设置超高倍速(>3.0x)**:原生播放器内部没有针对超高倍速进行优化,可能导致音画不同步、播放卡顿、声音嘈杂/消失等一系列问题.

### **删除倍速**
#### **删除倍速**

将鼠标指针移到**自定义**的倍速菜单项上,其右侧将会显示一个移除图标,单击即可删除相应的倍速.

Expand Down Expand Up @@ -1133,14 +1123,14 @@ by [@JLoeve](https://github.com/LonelySteve)

> 提高视频播放器的倍速记忆体验,可实现跨页共享倍速,也可以按视频分别记忆倍速.
### 🔧 **选项**
#### 🔧 **选项**

- `全局记忆倍速值`:默认情况下,这是跨页共享的倍速值,如果启用「各视频分别记忆」,则作为从未独立记忆倍速视频的初始倍速值.
- `固定全局倍速值`:默认情况下,全局倍速值将随着用户改变视频倍速而改变,打开此选项后,全局记忆倍速值不再受倍速调整的影响.
- `各视频分别记忆`:打开此选项后,将按不同视频分别记忆倍速,对于从未被记忆过倍速的视频,将采用全局记忆倍速值,选项「固定全局倍速值」在此情况下强制生效.
- `弹出还原倍速提示`:打开此选项后,每次成功还原倍速后都会弹出提示.

### 🌈 **温馨提示**
#### 🌈 **温馨提示**

「扩展倍速」和倍速相关的快捷键插件已分离为单独的组件或插件.

Expand Down
7 changes: 3 additions & 4 deletions registry/lib/components/utils/ip-show/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { defineComponentMetadata } from '@/components/define'
import { CommentItem, CommentReplyItem } from '@/components/utils/comment-apis'

// 新版评论区IP属地获取
const getIpLocation = (element: HTMLElement) => {
const props = (element as any).__vueParentComponent?.props
const reply = props?.reply ?? props?.subReply
const getIpLocation = (item: CommentReplyItem) => {
const reply = item.vueProps
return reply?.reply_control?.location ?? undefined
}

Expand Down Expand Up @@ -268,7 +267,7 @@ observer.observe(document.head, { childList: true })

const processItems = (items: CommentReplyItem[]) => {
items.forEach(item => {
const location = getIpLocation(item.element)
const location = getIpLocation(item)
if (location !== undefined) {
const replyTime =
item.element.querySelector('.reply-info>.reply-time') ??
Expand Down
10 changes: 0 additions & 10 deletions registry/lib/components/video/default-location/desc.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
打开视频/番剧时自动定位到指定位置

<div class="video-default-location-desc-detail">

位置:距离页面顶部的像素距离\
默认位置:打开视频时自动定位到此处\
位置测试:查看、调整当前页面所在位置

当前版本限制默认位置的最大值为 4000。\
若有其他希望支持的页面,请提交反馈。\
脚本不会等待评论完全加载,因此较大的默认位置将无法正确定位。

</div>

<style>
.video-default-location-desc-detail.video-default-location-desc-detail p {
margin-top: 1ex;
}
</style>
6 changes: 3 additions & 3 deletions registry/lib/components/video/player/extend-speed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export const component = ExtendSpeedComponent.create<Options>({
> 扩展视频播放器的倍速菜单项,可用于突破原有播放倍数的上限或下限.
### 🔧 **选项**
#### 🔧 **选项**
- \`隐藏滚动条\`:如果添加的倍速过多,倍速菜单将出现滚动条,在 Windows 下,若没有安装并启用「细滚动条」组件会显得比较挤,建议开启此选项隐藏滚动条.
- \`隐藏移除图标\`:如果认为倍速右侧的移除倍速图标有些突兀,可以开启此选项隐藏.
- \`隐藏新增图标\`:如果认为顶部的新增倍速图标有些突兀,可以开启此选项隐藏.
### **新增倍速**
#### **新增倍速**
开启组件后,在默认情况下,播放器的倍速菜单就会新增 2.5x 和 3.0x 两个倍速选项.
Expand All @@ -32,7 +32,7 @@ export const component = ExtendSpeedComponent.create<Options>({
**不推荐设置超高倍速(>3.0x)**:原生播放器内部没有针对超高倍速进行优化,可能导致音画不同步、播放卡顿、声音嘈杂/消失等一系列问题.
### **删除倍速**
#### **删除倍速**
将鼠标指针移到**自定义**的倍速菜单项上,其右侧将会显示一个移除图标,单击即可删除相应的倍速.
Expand Down
4 changes: 2 additions & 2 deletions registry/lib/components/video/player/remember-speed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export const component = RememberSpeedComponent.create<Options>({
> 提高视频播放器的倍速记忆体验,可实现跨页共享倍速,也可以按视频分别记忆倍速.
### 🔧 **选项**
#### 🔧 **选项**
- \`全局记忆倍速值\`:默认情况下,这是跨页共享的倍速值,如果启用「各视频分别记忆」,则作为从未独立记忆倍速视频的初始倍速值.
- \`固定全局倍速值\`:默认情况下,全局倍速值将随着用户改变视频倍速而改变,打开此选项后,全局记忆倍速值不再受倍速调整的影响.
- \`各视频分别记忆\`:打开此选项后,将按不同视频分别记忆倍速,对于从未被记忆过倍速的视频,将采用全局记忆倍速值,选项「固定全局倍速值」在此情况下强制生效.
- \`弹出还原倍速提示\`:打开此选项后,每次成功还原倍速后都会弹出提示.
### 🌈 **温馨提示**
#### 🌈 **温馨提示**
「扩展倍速」和倍速相关的快捷键插件已分离为单独的组件或插件.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<div class="video-screenshot-thumbnail">
<img v-if="objectUrl" :src="objectUrl" />
<div v-if="objectUrl" class="mask">
<a ref="link" class="link" style="display: none" :href="objectUrl" :download="filename"></a>
<a
ref="link"
target="_blank"
class="link"
style="display: none"
:href="objectUrl"
:download="filename"
></a>
<button class="save" title="保存" @click="save">
<VIcon :size="28" icon="mdi-content-save-outline"></VIcon>
</button>
Expand Down Expand Up @@ -40,7 +47,15 @@ export default Vue.extend({
this.$emit('discard')
},
save() {
this.$refs.link.click()
const link = this.$refs.link as HTMLAnchorElement
link.addEventListener(
'click',
e => {
e.stopPropagation()
},
{ capture: true, once: true },
)
link.click()
this.discard()
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/client/common.meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.8.10",
"version": "2.8.11",
"author": "Grant Howard, Coulomb-G",
"copyright": "[year], Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)",
"license": "MIT",
Expand Down

0 comments on commit 66ede2a

Please sign in to comment.