fix: fixed an issue with the download button disappearing

- resolve #1551
This commit is contained in:
JellyBrick
2023-12-28 02:08:03 +09:00
parent 8aeae45965
commit e67699fed5

View File

@ -33,7 +33,7 @@ const menuObserver = new MutationObserver(() => {
} }
const menuUrl = document.querySelector<HTMLAnchorElement>( const menuUrl = document.querySelector<HTMLAnchorElement>(
'tp-yt-paper-listbox [tabindex="-1"] #navigation-endpoint', 'tp-yt-paper-listbox [tabindex="0"] #navigation-endpoint',
)?.href; )?.href;
if (!menuUrl?.includes('watch?') && doneFirstLoad) { if (!menuUrl?.includes('watch?') && doneFirstLoad) {
return; return;
@ -56,7 +56,7 @@ export const onRendererLoad = ({
let videoUrl = getSongMenu() let videoUrl = getSongMenu()
// Selector of first button which is always "Start Radio" // Selector of first button which is always "Start Radio"
?.querySelector( ?.querySelector(
'ytmusic-menu-navigation-item-renderer[tabindex="-1"] #navigation-endpoint', 'ytmusic-menu-navigation-item-renderer[tabindex="0"] #navigation-endpoint',
) )
?.getAttribute('href'); ?.getAttribute('href');
if (videoUrl) { if (videoUrl) {