From c14c2474711bd5ffabf7e19081da227cc2e0fb1d Mon Sep 17 00:00:00 2001 From: wangyantong2000 <18745996292@163.com> Date: Mon, 18 Nov 2024 23:57:33 +0800 Subject: [PATCH] fix: fix openrank display --- .../features/developer-hovercard-info/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/ContentScripts/features/developer-hovercard-info/index.tsx b/src/pages/ContentScripts/features/developer-hovercard-info/index.tsx index 128d452d..bb97ddb3 100644 --- a/src/pages/ContentScripts/features/developer-hovercard-info/index.tsx +++ b/src/pages/ContentScripts/features/developer-hovercard-info/index.tsx @@ -37,6 +37,11 @@ const getDeveloperName = (target: HTMLElement): string | null => { }; const renderTo = (container: HTMLElement, developerName: string, openrank: string) => { + const parentElement = container.parentNode?.parentElement?.parentElement; + const hovercardUrl = parentElement?.getAttribute('data-hovercard-target-url'); + if (!hovercardUrl || !hovercardUrl.startsWith('/users')) { + return; + } const openRankContainer = document.createElement('div'); container.appendChild(openRankContainer); createRoot(openRankContainer).render();