From acdbbd547ef32760fbc5a0101cfe50d0356e3927 Mon Sep 17 00:00:00 2001 From: VeeloxShadow Date: Mon, 10 Mar 2025 08:41:46 +0000 Subject: [PATCH] Fix downstream extension context menu does not load (#728) - Adds optional chaining for event target --- src/ContextMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ContextMenu.ts b/src/ContextMenu.ts index 7ba8e675e..d1889fb34 100644 --- a/src/ContextMenu.ts +++ b/src/ContextMenu.ts @@ -139,7 +139,7 @@ export class ContextMenu { }) // insert before checking position - const ownerDocument = (options.event?.target as Node).ownerDocument + const ownerDocument = (options.event?.target as Node)?.ownerDocument const root_document = ownerDocument || document if (root_document.fullscreenElement)