テーブルのマウント位置の調整
This commit is contained in:
parent
668574341e
commit
4f401356cd
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user