This is a feature that may come to a browser some day. I am interesting in your thoughts:
Desktop Notifications
Desktop notifications allow a web page to notify the user using system level services, such as Growl, in a clean, safe, and easy to use manner.
The code is very simple:
navigator.notification.notify("Another Desktop Notification",
"Check out my icon",
"http://dougt.org/me.jpg");
and the result is something you’d expect from a notification. On the Mac, the notification may look like:
You can get more sophisticated by adding a callback when the user clicks on the Desktop Notification:
navigator.notification.notify("Another Desktop Notification",
"Check out my icon",
"http://dougt.org/me.jpg");
function() { /*do something*/ });
A user must grant each site permission before they can use Desktop Notifications. We will use the familiar notification bar (the text isn’t final. Also, these will end up looking quite different in future releases of Firefox.):
That is there all there is to it!
Get involved:
If you like or dislike this feature, please just leave a comment.
If you like to follow the implementation details, you can follow bug 573588.
You can try out the engineering builds. There are bound to be a few bugz. If you see anything funky, please let me know.
If you are using the above engineering builds, you can try out Desktop Notifications.
More details:
I reviewed two draft specifications. The first is the WebNotification specification and the other is the Google Gears NotificationAPI. I found both of these APIs more complex than what was required. Clearly both of these other APIs have use cases that are not address by my proposal. But for basic notification from the browser, not much is required.
Looking at what Growl and other system level notification services provide, you basically only need a title, a description, and an icon. For fun, I added one callback if the user clicks on the notification while it is on screen.
Next Steps
You tell me. Is this something you’d like to see in the browser? Does the API work for your use cases?
Let me know what you think!



Geolocation – Setting your position manually
I thought that this was written down somwhere, but I couldn’t easily find it…. so
If you know how to muck with about:config, there is an easy way to set your location manually. First figure out your longitude and latitude. There area bunch of tools on the web that gets you this. Once you have this, you can do the following:
1) Open up about:config
2) search for geo.wifi.uri
3) change the value to:
http://snaptome.appspot.com/loc/json?latitude=your_lat&longitude=your_lon&accuracy=10
Thats it. I hope this helps.