Restore double click fullscreen (#5095)

This commit is contained in:
the1812 2025-02-19 08:31:35 +08:00
parent 24714b77a7
commit a5283105b0
3 changed files with 2 additions and 13 deletions

View File

@ -32,7 +32,7 @@
**注意事项** **注意事项**
- **⚠ 使用正式版 (GitHub 源) 和预览版须翻墙.** - **⚠ 使用正式版 (GitHub 源) 和预览版须翻墙.**
- 默认不预装任何组件, 需要在按[设置](#设置)中的说明添加感兴趣的功能; 默认会屏蔽双击全屏, 如有需要可以安装 `双击全屏` 组件来恢复. - 默认不预装任何组件, 需要在按[设置](#设置)中的说明添加感兴趣的功能.
- 这个是一个综合性的脚本, 如果只是想下载视频建议去 [GreasyFork](https://greasyfork.org/zh-CN/scripts/by-site/bilibili.com) 找个更专业的. - 这个是一个综合性的脚本, 如果只是想下载视频建议去 [GreasyFork](https://greasyfork.org/zh-CN/scripts/by-site/bilibili.com) 找个更专业的.
- 对性能有较大影响, 详见[配置要求](#配置). - 对性能有较大影响, 详见[配置要求](#配置).
- 默认不对未登录的状态做适配. - 默认不对未登录的状态做适配.

View File

@ -1,6 +1,6 @@
import { attributes } from '@/core/observer' import { attributes } from '@/core/observer'
import { select } from '@/core/spin-query' import { select } from '@/core/spin-query'
import { playerReady, preventEvent } from '@/core/utils' import { playerReady } from '@/core/utils'
import { createPlayerModeChangeEvent, PlayerMode } from './events' import { createPlayerModeChangeEvent, PlayerMode } from './events'
/** 播放器模式标记同步 */ /** 播放器模式标记同步 */
@ -36,19 +36,8 @@ const playerModePolyfill = async () => {
} }
}) })
} }
/** 3.x .
* , , 使.
*/
const doubleClickPolyfill = async () => {
const layer = (await select('.bpx-player-video-perch')) as HTMLElement
if (!layer) {
return
}
preventEvent(layer, 'dblclick')
}
/** 番剧 & 视频播放器 (BPX) 通用 polyfill */ /** 番剧 & 视频播放器 (BPX) 通用 polyfill */
export const bpxPlayerPolyfill = lodash.once(async () => { export const bpxPlayerPolyfill = lodash.once(async () => {
playerModePolyfill() playerModePolyfill()
doubleClickPolyfill()
}) })