mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-17 05:02:06 +00:00
feat(downloader): Add context menu button for playlists and albums (#3768)
Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
@ -22,6 +22,24 @@ export const isMusicOrVideoTrack = () => {
|
||||
return false;
|
||||
};
|
||||
|
||||
export const isAlbumOrPlaylist = () => {
|
||||
for (const menuSelector of document.querySelectorAll<
|
||||
HTMLAnchorElement & {
|
||||
data: {
|
||||
addToPlaylistEndpoint: {
|
||||
playlistId: string;
|
||||
};
|
||||
clickTrackingParams: string;
|
||||
};
|
||||
}
|
||||
>('tp-yt-paper-listbox #navigation-endpoint')) {
|
||||
if (menuSelector?.data?.addToPlaylistEndpoint?.playlistId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export const isPlayerMenu = (menu?: HTMLElement | null) => {
|
||||
return (
|
||||
menu?.parentElement as
|
||||
|
||||
Reference in New Issue
Block a user