Skip to content

Commit

Permalink
fix(hide translate comment): comment replies showed translate button #…
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireChicken12 committed Sep 29, 2024
1 parent cbf8857 commit 82a8104
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/hideTranslateComment/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 82a8104

Please sign in to comment.