mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
26 lines
669 B
TypeScript
26 lines
669 B
TypeScript
import { defineComponentMetadata } from '@/components/define'
|
|
import { preventEvent } from '@/core/utils'
|
|
|
|
let cancel: () => void
|
|
const prevent = () => {
|
|
cancel?.()
|
|
cancel = preventEvent(unsafeWindow, 'mousewheel', () => {
|
|
const isFullscreen = [
|
|
'player-mode-webfullscreen',
|
|
'player-fullscreen-fix',
|
|
'player-full-win',
|
|
].some(token => document.body.classList.contains(token))
|
|
return isFullscreen
|
|
})
|
|
}
|
|
export const component = defineComponentMetadata({
|
|
name: 'disableScrollVolume',
|
|
displayName: '禁止滚轮调音量',
|
|
tags: [componentsTags.video],
|
|
entry: prevent,
|
|
reload: prevent,
|
|
unload: () => {
|
|
cancel?.()
|
|
},
|
|
})
|