From d6dfe43fe8ceeb9fc66f51cd60419b9b36b6ea35 Mon Sep 17 00:00:00 2001 From: Steven Xu Date: Wed, 11 Mar 2026 18:18:25 +1100 Subject: [PATCH] fix: `.openOrClosedShadowRoot` can give `Restricted { }` --- content/local_links.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/local_links.ts b/content/local_links.ts index 039a8dc8f..ad16c3942 100644 --- a/content/local_links.ts +++ b/content/local_links.ts @@ -474,7 +474,9 @@ const isOtherClickable = (hints: Hint[], element: NonHTMLButFormattedElement | S && (!(Build.BTypes & BrowserType.Chrome) || Build.MinCVer >= BrowserVer.MinEnsuredUnprefixedShadowDOMV0) && (!(Build.BTypes & BrowserType.Firefox) || Build.MinFFVer >= FirefoxBrowserVer.MinEnsuredShadowDOMV1) ? noClosedShadow === 1 ? (el as SafeHTMLElement).shadowRoot as ShadowRoot | null - : !(Build.BTypes & ~BrowserType.Firefox) ? (el as any).openOrClosedShadowRoot as ShadowRoot | null + : !(Build.BTypes & ~BrowserType.Firefox) ? + ((el as any).openOrClosedShadowRoot instanceof (window as any).ShadowRoot) ? + ((el as any).openOrClosedShadowRoot as ShadowRoot) : null : GetShadowRoot_(el as SafeHTMLElement, 0) : Build.BTypes & BrowserType.Chrome ? GetShadowRoot_(el as SafeHTMLElement, noClosedShadow) : GetShadowRoot_(el as SafeHTMLElement)