I’ve made some progress since my last post:
Still rather ugly, but at least it’s functional!
Some things I’ll be looking into next:
- the dismissal behavior – currently dismissing the notification (i.e. clicking elsewhere on the screen) denies the geolocation request. I think we want to instead keep the request pending and allow you to access it later from the site-identity menu, but that requires some extra work (tracking shown/unshown notifications, etc.)
- make notifications triggered from background tabs/windows behave correctly (right now they’re just ignored)
- multiple-notification stacking
- support for different priorities (not sure this will be needed)
- styling! – Stephen is working on mockups for menu-buttons, which is probably the most obvious issue
The current working API is very similar to the existing notificationbox API. It’s definitely not set in stone. Right now it looks like this:
var mainAction = { label: "Share Location", accessKey: "S", callback: function() { request.allow(); }, }; var secondaryActions = [ { label: "Always Share", accessKey: "A", callback: function () { Services.perms.add(requestingURI, "geo", ALLOW_ACTION); request.allow(); } }, { label: "Never Share", accessKey: "N", callback: function () { Services.perms.add(requestingURI, "geo", DENY_ACTION); request.cancel(); } } ]; var dismissalAction = { callback: function() { request.cancel(); } }; Notification.show("geolocation", "title", message, "chrome://browser/skin/Geo.png", mainAction, secondaryActions, dismissalAction, browser);
The mockups look really amazing. This is going to look great when it’s landed!
Looks great…Just a small note…these notification bubbles are mapping to OS specific themes or they are themeable ?
They’ll be styled the same way the other similar panels (Larry, Add Bookmark) are.
Pingback: Theme Status (Timelines, Panels and Progress) « Chromatic Pixel
Pingback: BattleIT » Artiklid » Piilume kardinate taha – Mozilla Firefox 4
Pingback: Gavin’s blog » mise a jour