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.
The notification looks the same on all desktop operating systems. Something like:
notifications.NotificationOptions
notifications.TemplateType
notifications.clear()
notifications.create()
notifications.getAll()
notifications.update()
notifications.onButtonClicked
notifications.onClicked
notifications.onClosed
notifications.onShown
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
NotificationOptions |
Yes |
17 |
45 |
? |
Yes |
14 |
? |
? |
48 |
? |
? |
? |
TemplateType |
Yes |
17 |
45
Only the 'basic' type is supported.
|
? |
Yes
Only the 'basic' type is supported.
|
14 |
? |
? |
48
Only the 'basic' type is supported.
|
? |
? |
? |
clear |
28 |
17 |
45 |
? |
25 |
No |
? |
? |
48 |
? |
? |
? |
create |
28 |
17 |
45 |
? |
25 |
No |
? |
? |
48 |
? |
? |
? |
getAll |
29 |
17 |
45 |
? |
25 |
No |
? |
? |
48 |
? |
? |
? |
onButtonClicked |
28 |
17 |
No |
? |
25 |
No |
? |
? |
No |
? |
? |
? |
onClicked |
28 |
17 |
47 |
? |
25 |
No |
? |
? |
48 |
? |
? |
? |
onClosed |
28 |
17 |
45 |
? |
25 |
No |
? |
? |
48 |
? |
? |
? |
onShown |
No |
No |
56 |
? |
No |
No |
? |
? |
56 |
? |
? |
? |
update |
28 |
17 |
No |
? |
25
Not supported on Macs.
|
No |
? |
? |
No |
? |
? |
? |
Note: This API is based on Chromium's chrome.notifications
API.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications