I want to show a warning if I have something in my Facebook inbox. I think this can be easily done with custom scripts ... this is what I have so far (thanks to the guys on the userscripts forums):
document.addEventListener("DOMNodeInserted", function() {
var count;
if ((count=parseInt(document.getElementById("fb_menu_inbox_unread_count").textContent)) > 0)
alert("You have "+count+" new message"+(count==1 ? "" : "s")+".");
}, true);
This works fine, except that the message gets stuck in the loop after clicking OK and continues to appear. Is there a way to stop the message after clicking the "Warning" button?
alen
source
share