mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Merge branch 'preview-fixes' into preview-features
This commit is contained in:
commit
5371e1df08
@ -46,9 +46,16 @@ export const loadKeyBindings = lodash.once((bindings: KeyBinding[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 忽略其他可聚焦元素
|
// 忽略其他可聚焦元素
|
||||||
const hasElementFocus = !([document.body, null] as (Element | null)[]).includes(
|
const hasElementFocus = (() => {
|
||||||
getActiveElement(),
|
const activeElement = getActiveElement()
|
||||||
)
|
if (([document.body, null] as (Element | null)[]).includes(activeElement)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (activeElement instanceof HTMLMediaElement) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})()
|
||||||
if (
|
if (
|
||||||
(binding.action.ignoreFocus !== false || binding.action.ignoreTyping !== false) &&
|
(binding.action.ignoreFocus !== false || binding.action.ignoreTyping !== false) &&
|
||||||
hasElementFocus
|
hasElementFocus
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user