Created
December 13, 2017 22:39
-
-
Save gt50/20473c06322ee372a0dbc3348a153d4a to your computer and use it in GitHub Desktop.
Feedly unread tab for rambox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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