coderef

NotificationsLimited availability

The Notification() constructor shows a message to the user, typically using the notification system of the host operating system.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–19Not supported
20+Supportedsince Jun 26, 2012
Current: 155
Edge
12–13Not supported
14+Supportedsince Aug 2, 2016
Current: 154
Firefox
1–21Not supported
22+Supportedsince Jun 25, 2013
Current: 157
Safari
1–6Not supported
7+Supportedsince Oct 22, 2013
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
4–21Not supported
22+Supportedsince Jun 25, 2013
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Chrome Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: Notification.

Feature detection

JS · check before using
if ("Notification" in globalThis) {
  // Notification is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (44). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Notification2014227✕22✕
Notification.Notification2014227✕22✕
Notification.actions5318152✕✕152✕
Notification.badge5318✕✕✕✕✕
Notification.body33142611✕26✕
Notification.click_event2014227✕22✕
Notification.close2014227✕22✕
Notification.close_event2014227✕22✕
Notification.data44163416✕34✕
Notification.dir2014267✕26✕
Notification.error_event2014227✕22✕
Notification.icon331426✕✕26✕
Notification.image5618✕✕✕✕✕
Notification.lang33142611✕26✕
Notification.maxActions_static4818152✕✕152✕
Notification.permission_static3214227✕22✕
Notification.renotify5079✕✕✕✕✕
Notification.requestPermission_static20142215✕22✕
Notification.requestPermission_static.returns_promise47794615✕46✕
Notification.requireInteraction4717✕✕✕✕✕
Show 24 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Notification.secure_context_required627967✕✕67✕
Notification.show_event2014227✕22✕
Notification.silent431713216.6✕132✕
Notification.tag201426✕✕26✕
Notification.timestamp5017✕✕✕✕✕
Notification.title33142611✕26✕
Notification.vibrate5379✕✕✕✕✕
Notification.worker_support421541✕✕41✕
NotificationEvent42174416424416.4
NotificationEvent.NotificationEvent42174416424416.4
NotificationEvent.action4817152✕48152✕
NotificationEvent.notification421744✕4244✕
Permissions.permission_notifications43794616.4434616.4
ServiceWorkerGlobalScope.notificationclick_event401744164044✕
ServiceWorkerGlobalScope.notificationclose_event501744165044✕
ServiceWorkerRegistration.getNotifications40174416404416.4
ServiceWorkerRegistration.showNotification42174416424416.4
ServiceWorkerRegistration.showNotification.options_actions_parameter4818152✕48152✕
ServiceWorkerRegistration.showNotification.options_badge_parameter5379✕✕53✕✕
ServiceWorkerRegistration.showNotification.options_data_parameter4479✕✕44✕✕
ServiceWorkerRegistration.showNotification.options_image_parameter5679✕✕56✕✕
ServiceWorkerRegistration.showNotification.options_renotify_parameter5079✕✕50✕✕
ServiceWorkerRegistration.showNotification.options_requireInteraction_parameter4779✕✕47✕✕
ServiceWorkerRegistration.showNotification.options_vibrate_parameter4579✕✕✕✕✕