Desktop notifications support options for persistence and timeout, defined as: * persistence: (integer, defaults to 0) The number of "pageloads" that this doorhanger ignores before closing automatically. If -1, the doorhanger never closes automatically, but must be closed by the user. * timeout: (integer, defaults to 0) The number of milliseconds will stay visible at a minimum, regardless of "pageloads". A user can manually close the doorhanger. Any pageloads that occur after the timeout is exceeded will close the doorhanger. The doorhanger does not close exactly on the timeout.
Created attachment 573720 [details] [diff] [review] patch I tested this by adding persistence and timeout options to the content permission prompt here: http://mxr.mozilla.org/projects-central/source/birch/mobile/components/ContentPermissionPrompt.js#163. It worked!
Yeah, I copied the way PopupNotificaions.jsm does it, which I assume was just copied from the notification bars. I just messed up copy/pasting the comment - will fix! :)
https://hg.mozilla.org/projects/birch/rev/2fbc10092549 I just looked back at comment 0 and realized that my patch doesn't handle the case described for setting persistence to -1. Desktop doesn't do that, so I didn't realize we wanted it. Want me to file a follow-up about that?
I saw it used in a few places: http://mxr.mozilla.org/mozilla-central/search?string=persistence+=+-1 The BrowserGlue code uses it for the telemetry notification, for example.
(In reply to Mark Finkle (:mfinkle) from comment #6) > I saw it used in a few places: > > http://mxr.mozilla.org/mozilla-central/search?string=persistence+=+-1 > > The BrowserGlue code uses it for the telemetry notification, for example. I filed bug 702386 and I'll fix it there!