Firefox Desktop Notifications for Gmail

At work, I use Google Chrome mostly. When I access Gmail, it asks if I wish to enable desktop notifications, but oddly at home I don’t see it. That’s because I use Firefox.

With so many tabs open, it’s definitely a good thing to have desktop notifications (something like Growl for Mac), especially since I use Google Chat on the Gmail page sometimes. I was hoping that Gmail detects a capable browser based on the availability of Javascript objects, instead of some stupid sites that detect the User Agent string, so that the functionality could at least be injected into the page using a Greasemonkey script or a Firefox plugin.

It turns out that someone has already written a Firefox plugin to implement desktop notifications, and that Gmail does in fact detect the presence of Javascript objects instead of blindly relying on the UA string. It’s called ff-html5notifications. With this plugin installed, Gmail will now ask if you want to enable desktop notifications, just as if you were using Chrome.

Chrome implements the Web Notifications API (draft specifications at this point) via the window.webkitNotifications object. It is unclear whether Firefox would support this API in the future, but the ff-html5notifications plugin provides a good solution for now.