Notifications API
suggest changeSyntax
- Notification.requestPermission(callback)
- Notification.requestPermission().then(callback, rejectFunc)
- new Notification(title, options)
- notification.close()
Remarks
The Notifications API was designed to allow browser access to notifying the client.
Notification behavior depends on the browser, operating system, user permission, and document context. Request permission in response to a user action, handle denial, and provide an in-page alternative. Browsers generally require a secure context, and mobile platforms may require notifications to be shown through a service worker.
Requesting permission to send notifications
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents