Skip to content

Instantly share code, notes, and snippets.

@pheraph
Created October 6, 2012 17:35
Show Gist options
  • Save pheraph/3845551 to your computer and use it in GitHub Desktop.
Save pheraph/3845551 to your computer and use it in GitHub Desktop.
Userscript to show the count of unread posts for tent.io as icon badge (Fluid.app)
//Use *tent.is* as selector
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var newBadge = '';
var newps = document.querySelector(".num_new_posts");
//console.log(newps.textContent);
if (newps.textContent > 0) {
window.fluid.dockBadge = newps.textContent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment