From 82a8104238660ecaf44ae10d93002b5279b584b0 Mon Sep 17 00:00:00 2001 From: VampireChicken12 Date: Sun, 29 Sep 2024 13:02:56 -0400 Subject: [PATCH] fix(hide translate comment): comment replies showed translate button #471 --- src/features/hideTranslateComment/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/features/hideTranslateComment/utils.ts b/src/features/hideTranslateComment/utils.ts index c8b93640..40cb5745 100644 --- a/src/features/hideTranslateComment/utils.ts +++ b/src/features/hideTranslateComment/utils.ts @@ -11,10 +11,11 @@ export type EngagementPanelVisibility = (typeof engagementPanelVisibility)[numbe export function observeTranslateComment(): MutationObserver { const observer = new MutationObserver((mutationList) => { mutationList + .filter((mutation) => mutation.type === "childList") .filter( (mutation) => - mutation.type !== "childList" || - !mutation.addedNodes.length || + (mutation.target instanceof Element && + mutation.target.matches("ytd-comment-thread-renderer #replies ytd-comment-replies-renderer #expander #contents")) || Array.from(mutation.addedNodes).some( (addedNode) => addedNode instanceof Element &&