Note: This feature is available in Web Workers.
Secure contextThis 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
Specification | Status | Comment |
---|---|---|
Notifications API | Living Standard | Living standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
maxActions
|
Chrome
Full support Yes |
Edge
Full support 18 |
Firefox
No support No |
IE
No support No |
Opera
Full support Yes |
Safari
? |
WebView Android
No support No |
Chrome Android
Full support Yes |
Firefox Android
No support No |
Opera Android
Full support Yes |
Safari iOS
No support No |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
See also
Notification.maxActions by Mozilla Contributors is licensed under CC-BY-SA 2.5.