Skip to content

Commit

Permalink
Don't close "Queue"-view #30
Browse files Browse the repository at this point in the history
  • Loading branch information
cvzi committed Apr 20, 2024
1 parent 48c91e5 commit 76c9c88
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SpotifyGeniusLyrics.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
// @copyright 2020, cuzi (https://github.com/cvzi)
// @supportURL https://github.com/cvzi/Spotify-Genius-Lyrics-userscript/issues
// @icon https://avatars.githubusercontent.com/u/251374?s=200&v=4
// @version 23.5.4
// @version 23.5.5
// @require https://greasyfork.org/scripts/406698-geniuslyrics/code/GeniusLyrics.js
// @grant GM.xmlHttpRequest
// @grant GM.setValue
// @grant GM.getValue
// @grant GM.registerMenuCommand
// @grant GM_openInTab
// @grant unsafeWindow
// @connect genius.com
// @match https://open.spotify.com/*
// @match https://genius.com/songs/new
Expand Down Expand Up @@ -738,7 +739,12 @@ if (document.location.hostname === 'genius.com') {
GM.getValue('hide_spotify_now_playing_view', true).then(function (hideNowPlaying) {
if (hideNowPlaying) {
// Close "Now Playing View"
document.querySelectorAll('#Desktop_PanelContainer_Id [data-testid="PanelHeader_CloseButton"] button[class*="Button-"]').forEach(b => b.click())
document.querySelectorAll('#Desktop_PanelContainer_Id [data-testid="PanelHeader_CloseButton"] button[class*="Button-"]').forEach(function (b) {
if (b.parentNode.previousElementSibling && b.parentNode.previousElementSibling.tagName === 'BUTTON') {
// Second button is the "Now Playing View" button but not in the "Queue view"
b.click()
}
})
}
})
}, 3000)
Expand Down

0 comments on commit 76c9c88

Please sign in to comment.