Skip to content

Instantly share code, notes, and snippets.

@gt50
Created December 13, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gt50/20473c06322ee372a0dbc3348a153d4a to your computer and use it in GitHub Desktop.
Save gt50/20473c06322ee372a0dbc3348a153d4a to your computer and use it in GitHub Desktop.
Feedly unread tab for rambox
function checkUnread() {
var e = document.getElementsByClassName("feedUnreadCount")
var t = 0;
for( i = 0; i < e.length; i++ ) t += parseInt(e[i].innerHTML.trim() || 0);
updateBadge(t);
}
function updateBadge(e) {
e >= 1 ? document.title = "(" + e + ") " + originalTitle : document.title = originalTitle
}
var originalTitle = document.title;
setInterval(checkUnread, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment