テーブルのマウント位置の調整
This commit is contained in:
parent
668574341e
commit
4f401356cd
|
|
@ -7,10 +7,12 @@ const CONTAINER_ID = "ytpf-playlist-table";
|
||||||
let currentHandle: PlaylistTableHandle | null = null;
|
let currentHandle: PlaylistTableHandle | null = null;
|
||||||
|
|
||||||
function findAnchor(): { parent: Element; before: Element | null } | null {
|
function findAnchor(): { parent: Element; before: Element | null } | null {
|
||||||
// Primary: before ytd-playlist-video-list-renderer (sibling)
|
// Primary: top of ytd-item-section-renderer (before any header/content)
|
||||||
const videoList = document.querySelector("ytd-playlist-video-list-renderer");
|
const itemSection = document.querySelector(
|
||||||
if (videoList?.parentElement) {
|
"ytd-section-list-renderer ytd-item-section-renderer",
|
||||||
return { parent: videoList.parentElement, before: videoList };
|
);
|
||||||
|
if (itemSection) {
|
||||||
|
return { parent: itemSection, before: itemSection.firstElementChild };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback: end of ytd-section-list-renderer > #contents
|
// Fallback: end of ytd-section-list-renderer > #contents
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user