1313// @copyright 2020, cuzi (https://github.com/cvzi)
1414// @supportURL https://github.com/cvzi/Spotify-Genius-Lyrics-userscript/issues
1515// @icon https://avatars.githubusercontent.com/u/251374?s=200&v=4
16- // @version 23.6.14
16+ // @version 23.6.15
1717// @require https://greasyfork.org/scripts/406698-geniuslyrics/code/GeniusLyrics.js
1818// @require https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.5.0/lz-string.min.js
1919// @grant GM.xmlHttpRequest
@@ -368,12 +368,11 @@ function listSongs (hits, container, query) {
368368 }
369369}
370370
371- const songTitleQuery = 'a [data-testid="nowplaying-track-link"],.Root footer .ellipsis-one-line a[href*="/track/"],.Root footer .ellipsis-one-line a[href*="/album/"],.Root footer .standalone-ellipsis-one-line a[href*="/album/"],[data-testid="context-item-info-title"] a[href*="/album/"],[data-testid="context-item-info-title"] a[href*="/track/"]'
372- const songArtistsQuery = '.Root footer .ellipsis-one-line a[href*="/artist/"],.Root footer .standalone-ellipsis-one-line a[href*="/artist/"],a[data-testid="context-item-info-artist"][href*="/artist/"],[data-testid="context-item-info-artist"] a[href*="/artist/"]'
371+ const songTitleQuery = '.Root [data-testid="now-playing-bar"] .standalone-ellipsis-one-line a[href*="/album/"],[data-testid="context-item-info-title"] a[href*="/album/"],[data-testid="context-item-info-title"] a[href*="/track/"]'
372+ const songArtistsQuery = '.Root [data-testid="now-playing-bar"] .standalone-ellipsis-one-line a[href*="/artist/"],a[data-testid="context-item-info-artist"][href*="/artist/"],[data-testid="context-item-info-artist"] a[href*="/artist/"]'
373373
374374function getSongTitleAndArtist ( ) {
375- const nowPlayingFooter = document . querySelector ( '[data-testid="now-playing-widget"]' )
376- const songTitleDOM = nowPlayingFooter ? HTMLElement . prototype . querySelector . call ( nowPlayingFooter , songTitleQuery ) : document . querySelector ( songTitleQuery ) // eslint-disable-line no-undef
375+ const songTitleDOM = document . querySelector ( songTitleQuery )
377376 if ( ! songTitleDOM ) {
378377 console . warn ( 'The song title element is not found.' )
379378 return [ - 1 ]
@@ -384,16 +383,17 @@ function getSongTitleAndArtist () {
384383 return [ - 2 ]
385384 }
386385 const songArtistsArr = [ ]
387- const ArtistLinks = nowPlayingFooter ? HTMLElement . prototype . querySelectorAll . call ( nowPlayingFooter , songArtistsQuery ) : document . querySelectorAll ( songArtistsQuery ) // eslint-disable-line no-undef
386+ const ArtistLinks = document . querySelectorAll ( songArtistsQuery )
388387 for ( const e of ArtistLinks ) {
389388 songArtistsArr . push ( e . textContent )
390389 }
390+
391391 return [ 0 , songTitle , songArtistsArr ]
392392}
393393
394394function addLyrics ( force , beLessSpecific ) {
395395 let musicIsPlaying = false
396- const buttons = document . querySelectorAll ( '.Root footer button[data-testid="control-button-playpause"]' )
396+ const buttons = document . querySelectorAll ( '.Root button[data-testid="control-button-playpause"]' )
397397 if ( buttons . length ) {
398398 buttons . forEach ( function ( button ) {
399399 if ( button . getAttribute ( 'aria-label' ) === 'Pause' ||
0 commit comments