While I appreciate a good piece of code and the need to reinvent a wheel, I wouldn't call your implementation "aesthetically pleasing" either. IMO your fallback option is the solution, simply appending "(5)" to the page title when there are 5 pending alerts works the best.
There are certain situations in which only the favicon is displayed - for example, when tabs are "pinned". In these cases, appending text to the page title would not be visible, which is why it's beneficial to have a dynamic favicon.
And my pinned tabs are wider than regular tabs. So favicon it is. Gmail has this function and it is great. Although I do agree that having both is probably the way to go. Change favicon (don't blink!) and prepend a number/message to the title.
Also, in many cases the title of a page is longer than the area it's supposed to fit in - in which case, appending the alert to the page title results in it not being visible.
Appending to the end of the page title doesn't work, because the end of the title gets chopped off when it doesn't fit in the tab title or window title.
Prepending to the start of the page title does work though.
This is one of the reasons I use Twitter web client - it sits in a tab (on the @mentions screen) and I only pay attention to it when I see a "(1)" or whatever. It's unobtrusive notifications.
Hey, the number in title approach definitely has its place! (There's a reason why Facebook, Google use that approach right?)
But if you have an audience skewed towards modern browsers and want to do something a little different this works well and definitely draws the eyes attention.
Changing the title bar is ineffective; you either make the title blink between two states which is a blaring annoyance and terribly distracting (GChat), or you just add a modest little (1) that is hard to see (Facebook). I think the favicon is much better suited for this function; it conforms to what people are used to with mobile phone UI.
However, the problem with this library is it has to follow the limitations of favicons' dimensions. I think there should be an open standard for having alert badges like iPhone and Android phones put on top of home screen icons. The browser distributer could design theirs to match the UI so people could recognize them, and they could be allowed to extend just 2 or 3 pixels past the normal favicon boundaries to grab attention without being annoying or invisible.
You can tell when people want something when they're settling for several make-shift approaches at it within limitations.
Chrome has a desktop notification system similar to Growl. Not sure if Firefox and others implement it. I much prefer it over the titlebar modification which I just find plain irritating.
I used to have that activated for GChat but got tired of it. I think it's more annoying than the title bar, but at least you can turn it off.
Alerts should be there when I want to look for them - they shouldn't pull me out of what I'm doing. If they have to pop up on the screen for me to notice them it probably means I'm paying attention to something else.
What was arrogant about the comment? He merely stated that he doesn't find the solution to be aesthetically pleasing. Are opinions contrary to those of the majority now to be considered arrogant?
It wasn't supposed to. Reinventing a wheel is a good thing, that's what a majority of people on HN do on daily basis. This is what moves things forward.
[edit] And I am being downvoted because... ?