Show NP info in browser tab

Would be cool to see info on the current track in the browser tab, instead of just "Subsonic". The Slacker Radio web app does this, and it's nice to see whats going on without switching tabs.
document.title = nowPlaying[i].artist + " - " + nowPlaying[i].title;
parent.document.title = nowPlaying[i].artist + " - " + nowPlaying[i].title;
function getNowPlayingCallback(nowPlaying) {
var html = nowPlaying.length == 0 ? "" : "<h2><fmt:message key="main.nowplaying"/></h2><table>";
for (var i = 0; i < nowPlaying.length; i++) {
html += "<tr><td colspan='2' class='detail' style='padding-top:1em;white-space:nowrap'>";
if (nowPlaying[i].avatarUrl != null) {
html += "<img src='" + nowPlaying[i].avatarUrl + "' style='padding-right:5pt'>";
}
html += "<b>" + nowPlaying[i].username + "</b></td></tr>"
html += "<tr><td class='detail' style='padding-right:1em'>" +
"<a title='" + nowPlaying[i].tooltip + "' target='main' href='" + nowPlaying[i].albumUrl + "'><em>" +
nowPlaying[i].artist + "</em><br/>" + nowPlaying[i].title + "</a><br/>" +
"<span class='forward'><a href='" + nowPlaying[i].lyricsUrl + "' onclick=\"return popupSize(this, 'help', 430, 550)\">" +
"<fmt:message key="main.lyrics"/>" + "</a></span></td><td style='padding-top:1em'>";
if (nowPlaying[i].coverArtUrl != null) {
html += "<a title='" + nowPlaying[i].tooltip + "' rel='zoom' href='" + nowPlaying[i].coverArtZoomUrl + "'>" +
"<img src='" + nowPlaying[i].coverArtUrl + "' width='48' height='48'></a>";
}
html += "</td></tr>";
var minutesAgo = nowPlaying[i].minutesAgo;
if (minutesAgo > 4) {
html += "<tr><td class='detail' colspan='2'>" + minutesAgo + " <fmt:message key="main.minutesago"/></td></tr>";
}
parent.document.title = nowPlaying[i].artist + " - " + nowPlaying[i].title;
}
html += "</table>";
$('nowPlaying').innerHTML = html;
prepZooms();
}
jeffpetersen wrote:Thanks mg, I'll give it a try!
What do you mean by "load the "right.view" in it's own tab"? This is the right side panel with NP info? And if someone else plays music my tab will show the wrong info?
parent.document.title= 'Now Playing: ' + nowPlayingInfo.title + " by " + nowPlayingInfo.artist;
function nowPlayingCallback(nowPlayingInfo) {
parent.document.title= 'Now Playing: ' + nowPlayingInfo.title + " by " + nowPlayingInfo.artist;
if (nowPlayingInfo != null && nowPlayingInfo.streamUrl != currentStreamUrl) {
getPlaylist();
if (currentAlbumUrl != nowPlayingInfo.albumUrl && top.main.updateNowPlaying) {
top.main.location.replace("nowPlaying.view?");
currentAlbumUrl = nowPlayingInfo.albumUrl;
}
<c:if test="${not model.player.web}">
currentStreamUrl = nowPlayingInfo.streamUrl;
updateCurrentImage();
</c:if>
}
}
parent.document.title= 'Now Playing: ' + nowPlayingInfo.title + " by " + nowPlayingInfo.artist;
np = 'Now Playing: ' + nowPlayingInfo.title + ' by ' + nowPlayingInfo.artist;
np = np.replace(/&/g,"&");
np = np.replace(/'/g,"'");
parent.document.title=np;
np = np.replace(/ & # 3 9 ;'/g,"'");