Nuestros voluntarios aún no han traducido este artículo al Español. ¡Únete a nosotros y ayúdanos a traducirlo!
También puedes leer el artículo en English (US).

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.NotificationOptions
Defines the content of a notification.
notifications.TemplateType
The type of notification. For example, this defines whether the notification can contain an image.

Functions

notifications.clear()
Clear a specific notification, given its ID.
notifications.create()
Create and display a new notification.
notifications.getAll()
Get all notifications.
notifications.update()
Update a notification.

Events

notifications.onButtonClicked
Fired when the user clicked a button in the notification.
notifications.onClicked
Fired when the user clicked the notification, but not on a button.
notifications.onClosed
Fired when a notification closed, either by the system or because the user dismissed it.
notifications.onShown
Fired immediately after a notification has been shown.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
NotificationOptionsChrome Full support YesEdge Full support 17Firefox Full support 45Opera Full support YesFirefox Android Full support 48
TemplateTypeChrome Full support YesEdge Full support 17Firefox Full support 45
Notes
Full support 45
Notes
Notes Only the 'basic' type is supported.
Opera Full support Yes
Notes
Full support Yes
Notes
Notes Only the 'basic' type is supported.
Firefox Android Full support 48
Notes
Full support 48
Notes
Notes Only the 'basic' type is supported.
clearChrome Full support 28Edge Full support 17Firefox Full support 45Opera Full support 25Firefox Android Full support 48
createChrome Full support 28Edge Full support 17Firefox Full support 45Opera Full support 25Firefox Android Full support 48
getAllChrome Full support 29Edge Full support 17Firefox Full support 45Opera Full support 25Firefox Android Full support 48
onButtonClickedChrome Full support 28Edge Full support 17Firefox No support NoOpera Full support 25Firefox Android No support No
onClickedChrome Full support 28Edge Full support 17Firefox Full support 47Opera Full support 25Firefox Android Full support 48
onClosedChrome Full support 28Edge Full support 17Firefox Full support 45Opera Full support 25Firefox Android Full support 48
onShownChrome No support NoEdge No support NoFirefox Full support 56Opera No support NoFirefox Android Full support 56
updateChrome Full support 28Edge Full support 17Firefox No support NoOpera Full support 25
Notes
Full support 25
Notes
Notes Not supported on Macs.
Firefox Android No support No

Legend

Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.

Example extensions

Acknowledgements

This API is based on Chromium's chrome.notifications API.

Etiquetas y colaboradores del documento

Colaboradores en esta página: hellosct1, wbamberg, jyotsna17gupta
Última actualización por: hellosct1,