Notification.maxActions

Note: This feature is available in Web Workers

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

The maxActions attribute of the Notification interface returns the maximum number of actions supported by the device and the User Agent. Effectively, this is the maximum number of elements in Notification.actions array which will be respected by the User Agent.

Syntax

Notification.maxActions

Value

An integer Number which indicates the largest number of notification actions that can be presented to the user by the User Agent and the device.

Examples

The following snippet logs the maximum number of supported actions.

const maxActions = Notification.maxActions;
console.log('This device can display at most ' + maxActions + ' actions on each notification.');

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
maxActions
48
18
No
No
35
No
No
48
No
35
No
5.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Notification/maxActions