appendNotification( label , value , image , priority , buttons, eventCallback )
Return type: element
Create a new notification and display it. If another notification is already present with a higher priority, the new notification will be added behind it.
  • label - label to appear on the notification. This should be either a string, or, from Gecko 37 onwards, you can pass a DocumentFragment with rich content as well. Keep in mind that this is all XUL so using HTML elements for styling might still need additional CSS in order to work as you might expect.
  • value - value used to identify the notification
  • image - URL of image to appear on the notification
  • priority - notification priority, see Priority Levels.
  • buttons - array of button descriptions to appear on the notification.
  • eventCallback Optional - a JavaScript function to call to notify you of interesting things that happen with the notification box. See Notification box events. If you want the notification box to not disappear when user clicks the button, in the callback function just throw an error. (For example: throw new Error('prevent nb close');)
Priority Levels :
Buttons :
The buttons argument is an array of button descriptions. Each description is an object with the following properties:
  • accessKey - the accesskey to appear on the button
  • callback - function to be called when the button is activated. This function is passed two arguments:
    • the <notification> the button is associated with
    • the button description as passed to appendNotification.
  • label - the label to appear on the button
  • popup - the id of a popup for the button. If null, the button is a button popup.

Notification box events

(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)

If you specify the eventCallback parameter, it should be a JavaScript function that gets called when interesting things happen related to the notification box. This function receives as its only parameter a string indicating what event occurred. At this time, there's just one event type: "removed". This indicates that the notification box has been removed from its window.

This callback can be used to prevent the notification box from closing on button click. In the callback function just throw an error. (For example: throw new Error('prevent nb close');)


Document Tags and Contributors

Contributors to this page: Sheppy, Marsf, Bedi, GijsKruitbosch, Cfinke, 2bass, Noitidart
Last updated by: GijsKruitbosch,