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 userVisibleOnly read-only property of the PushSubscriptionOptions interface indicates if the returned push subscription will only be used for messages whose effect is made visible to the user.
A boolean value that indicates whether the returned push subscription will only be used for messages whose effect is made visible to the user.
In the example below the value of userVisibleOnly is printed to the console.
navigator.serviceWorker.ready.then((reg) => {
reg.pushManager.getSubscription().then((subscription) => {
const options = subscription.options;
console.log(options.userVisibleOnly); // true if this is a user visible subscription
});
});
| Specification |
|---|
| Push API> # dom-pushsubscriptionoptions-uservisibleonly> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
userVisibleOnly |
54 | 17 | No | 41 | 16Notifications are supported on macOS Ventura and later. |
54 | No | 41 | 16.4Notifications are supported in web apps saved to the home screen. |
6.0 | No | NoNotifications are supported in web apps saved to the home screen. |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PushSubscriptionOptions/userVisibleOnly