Notification: silent property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The silent read-only property of the Notification interface specifies whether the notification should be silent, i.e., no sounds or vibrations should be issued regardless of the device settings. This is controlled via the silent option of the Notification() constructor.

Value

A boolean value or null. If set to true, the notification is silent; if set to null (the default value), the device's default settings are respected.

Examples

The following snippet fires a silent notification. An options object is created, and the notification is fired in response to a button click using the Notification() constructor. The code also includes rudimentary permissions handling, requesting permission from the user to fire notifications if it has not already been granted.

js
const btn = document.querySelector("button");

const options = {
  body: "No annoying pings or vibrations?",
  silent: true,
};

function requestSilentNotification() {
  const n = new Notification("Silent notification", options);
  console.log(n.silent); // should return true
}

btn.addEventListener("click", () => {
  if (Notification.permission === "granted") {
    requestSilentNotification();
  } else {
    Notification.requestPermission().then((permission) => {
      if (permission === "granted") {
        requestSilentNotification();
      } else {
        console.log("Notification permission was not granted");
      }
    });
  }
});

Specifications

Specification
Notifications API
# dom-notification-silent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
silent
Chrome – Full support
Chrome 43 (Release date: 2015-05-19)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 132 (Release date: 2024-10-29)
footnote Full support
Opera – Full support
Opera 30 (Release date: 2015-06-09)
footnote Full support
Safari – Full support
Safari 16.6 (Release date: 2023-07-24)
footnote Full support
Chrome Android – Full support
Chrome Android 43 (Release date: 2015-05-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 132 (Release date: 2024-10-29)
footnote Full support
Opera Android – Full support
Opera Android 30 (Release date: 2015-06-10)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – No support
WebView Android
footnote
footnote See bug 40443309
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

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

See also