From 4f401356cdfb71a0b0653d0e9e82b77ef88c0e09 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 9 Apr 2026 03:12:59 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E3=83=9E=E3=82=A6=E3=83=B3=E3=83=88=E4=BD=8D=E7=BD=AE=E3=81=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/ui/lifecycle.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/content/ui/lifecycle.ts b/src/content/ui/lifecycle.ts index c5b7b57..f34b49d 100644 --- a/src/content/ui/lifecycle.ts +++ b/src/content/ui/lifecycle.ts @@ -7,10 +7,12 @@ const CONTAINER_ID = "ytpf-playlist-table"; let currentHandle: PlaylistTableHandle | null = null; function findAnchor(): { parent: Element; before: Element | null } | null { - // Primary: before ytd-playlist-video-list-renderer (sibling) - const videoList = document.querySelector("ytd-playlist-video-list-renderer"); - if (videoList?.parentElement) { - return { parent: videoList.parentElement, before: videoList }; + // Primary: top of ytd-item-section-renderer (before any header/content) + const itemSection = document.querySelector( + "ytd-section-list-renderer ytd-item-section-renderer", + ); + if (itemSection) { + return { parent: itemSection, before: itemSection.firstElementChild }; } // Fallback: end of ytd-section-list-renderer > #contents