diff --git a/javascript/contentscript.js b/javascript/contentscript.js index b0b6948..e3c9b32 100644 --- a/javascript/contentscript.js +++ b/javascript/contentscript.js @@ -227,7 +227,8 @@ var GCInjector = new function () { this.isSmile(), this.isFrown(), queue.activeSong.index, - queue.songs.length + queue.songs.length, + this.GS.player.isPlaying ); } diff --git a/javascript/groovesharkControl.js b/javascript/groovesharkControl.js index 9ab522d..41f9669 100644 --- a/javascript/groovesharkControl.js +++ b/javascript/groovesharkControl.js @@ -16,7 +16,7 @@ function controlInit(autoCallback) { // Control the now playing data userAction('getNowPlaying', null, function(songName, artistName, albumName, albumImage, playbackPosition, playbackDuration, inLibrary, inFavorite, isSmile, isFrown, - queueIndex, queueLength){ + queueIndex, queueLength, isPlaying){ // Configure song data $('.nowPlaying .song') .text(songName) @@ -50,6 +50,9 @@ function controlInit(autoCallback) { var percentage = Math.round(100 / playbackDuration * playbackPosition); $('.progressbar .elapsed').css('width', percentage + '%'); $('.progressbar').slider('value', percentage); + + // Configure player button + $('#playpause').attr('class', isPlaying ? 'pause' : 'play'); }); // Collect radio data diff --git a/javascript/notification.js b/javascript/notification.js index 34c0d41..8b0444d 100644 --- a/javascript/notification.js +++ b/javascript/notification.js @@ -60,9 +60,3 @@ function setUpNotification () { setTimeout(window.close, 200); }); } - -chrome.extension.onRequest.addListener( - function (request, sender, sendResponse) { - $('#playpause').attr('class', request.isPlaying ? 'pause' : 'play'); - } -); diff --git a/javascript/popup.js b/javascript/popup.js index 8d5a25c..4777c77 100644 --- a/javascript/popup.js +++ b/javascript/popup.js @@ -69,8 +69,6 @@ chrome.extension.onRequest.addListener( showPopup(); scrollPlaylistToActiveSong(); - - $('#playpause').attr('class', request.isPlaying ? 'pause' : 'play'); } );