Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

great script!

About: Spotify Title
thank you for this script, it is simple and works. it is hardcoded to only show the first artist, though. I patched it like this:

setInterval(function () {
var oldTitle = "";
var myobj = document.getElementsByClassName("now-playing-bar")[0];
var atags = myobj.getElementsByTagName("a");
// first A tag is cover, last A tag is Spotify Connect (ignore img instead?)
var newTitle = atags[1].innerHTML + " – " + atags[2].innerHTML
var i;
for (i = 3; i < atags.length-1; i++) {
newTitle += ", " + atags[i].innerHTML;
}
if (newTitle!=oldTitle){
oldTitle=newTitle;
document.title=newTitle;
}
}, 500);

Comments

  • That's great, I had not thought about multiple artists yet, I changed the script accordingly.
Sign In or Register to comment.