FastMail + Fluid: unread messages badge userscript

Couldn't be easier:

window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);


function updateDockBadge() {
  var count = document.getElementsByClassName('inbox')[0].childNodes[1].innerText;
  if(count == "0") {
    window.fluid.dockBadge = '';
  } else {
    window.fluid.dockBadge = count;
  }
}

Props to FastMail for having sensible class names.


🌟 Was this page helpful? Please let me know with this quick, 3 question survey.