Display notifications to the user, using the underlying operating system's notification mechanism. Because this API uses the operating system's notification mechanism, the details of how notifications appear and behave may differ according to the operating system and the user's settings.
To use this API you need to have the "notifications" permission.
Types
notifications.TemplateType- The type of notification. For example, this defines whether the notification can contain an image.
notifications.NotificationOptions- Defines the content of a notification.
Functions
notifications.create()- Create and display a new notification.
notifications.update()- Update a notification.
notifications.clear()- Clear a specific notification, given its ID.
notifications.getAll()- Get all notifications.
Events
notifications.onClosed- Fired when a notification closed, either by the system or because the user dismissed it.
notifications.onClicked- Fired when the user clicked the notification, but not on a button.
notifications.onButtonClicked- Fired when the user clicked a button in the notification.
Browser compatibility
1. Firefox only supports: type, iconUrl, title, message.
2. Firefox only supports: type, iconUrl, title, message.
3. Firefox only supports the "basic" type.
4. Opera only supports the "basic" type.
5. Firefox only supports the "basic" type.
6. byUser is not supported.
7. byUser is not supported.
8. In Opera update() does not work on Macs.
The "Chrome incompatibilities" section is included from https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities using the WebExtChromeCompat macro.
If you need to update this content, edit https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities, then shift-refresh this page to see your changes.
Chrome incompatibilities
- Firefox does not support:
update()
- Firefox doesn't provide
byUserdata.
Example add-ons
This API is based on Chromium's chrome.notifications API.