Support for Notification has landed in Firefox nightly, it looks like Chrome (at least dev) supports the same interface. Chat should probably consider updating to use window.Notification in the near future.
I'm not sure if it's fully conformant, but it's spec-like enough to be consistent for general use across Firefox/Chrome once the changes land in stable.
the thing I'm confused about is Notification.permission. The spec calls that static, which to me means that you should have access without creating a notification object. If you can't -- and that's what the chrome version suggests -- it means that you can't check whether you have notification permissions without actually showing one (because the constructor immediately shows it).
Which would be horribly stupid, and unusable for us.
Yeah, if you deny permission in Chrome, Notification.requestPermission() doesn't prompt the user again and just returns "denied" to the callback, but it's kind of stupid you can't determine the permission without risking that they might be prompted.
You can query the permission using the existing WebKit-specific implementation though, so something like Notification.permission === 'granted' || (window.webkitNotifications && webkitNotifications.checkPermissions() === 0) would suffice as a workaround.
Or you could always get real fancy and just stub out the property. :P
if (!Notification.permission && window.webkitNotifications) {
Object.defineProperty(window.Notification, "permission", {
get: function () {
return ["granted", "denied", "default"][webkitNotifications.checkPermission()];
}
});
}