mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 23:17:05 +03:00
Improve content editable check
This commit is contained in:
@@ -2524,7 +2524,7 @@ function addHotkeyListener(): void {
|
|||||||
|
|
||||||
function hotkeyListener(e: KeyboardEvent): void {
|
function hotkeyListener(e: KeyboardEvent): void {
|
||||||
if ((["textarea", "input"].includes(document.activeElement?.tagName?.toLowerCase())
|
if ((["textarea", "input"].includes(document.activeElement?.tagName?.toLowerCase())
|
||||||
|| document.activeElement?.["contentEditable"] === "true"
|
|| (document.activeElement as HTMLElement)?.isContentEditable
|
||||||
|| document.activeElement?.id?.toLowerCase()?.match(/editable|input/))
|
|| document.activeElement?.id?.toLowerCase()?.match(/editable|input/))
|
||||||
&& document.hasFocus()) return;
|
&& document.hasFocus()) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user