Created
March 26, 2013 06:03
-
-
Save arion/5243461 to your computer and use it in GitHub Desktop.
IMO.IM userscript for fluid
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
window.fluid.dockBadge = 0; | |
setTimeout(updateDockBadge, 500); | |
setInterval(updateDockBadge, 1000); | |
function updateDockBadge() { | |
var elements = document.querySelectorAll(".attention-bubble>span"); | |
var element; | |
var sumNotice = 0; | |
for (var i = 0; i < elements.length; i++) { | |
element = parseInt(elements[i].innerHTML); | |
if(!isNaN(element)) { | |
sumNotice = sumNotice + element; | |
} | |
} | |
if(sumNotice > window.fluid.dockBadge) { | |
window.fluid.playSound("Glass"); | |
} | |
window.fluid.dockBadge = sumNotice; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment