web api static property
Notification: maxActions static property
Secure context Available in workers
The maxActions read-only static property of the Notification interface returns the maximum number of actions that can be displayed in a notification.
Value
An integer.
Description
Notification actions are buttons or controls that appear within persistent notifications.
Actions are set using the actions option of the second argument of the showNotification() method.
Browsers typically limit the maximum number of actions they will display for a particular notification.
The maxActions property returns that limit, which is the maximum number of elements in the actions array that will be respected by the user agent.
Examples
Log the maximum possible number of actions
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
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.