Notification: maxActions statische Eigenschaft

Limited availability

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

Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

Hinweis: Diese Funktion ist in Web Workers verfügbar.

Die maxActions schreibgeschützte statische Eigenschaft des Notification-Interfaces gibt die maximale Anzahl von Aktionen zurück, die vom Gerät und dem User Agent unterstützt werden. Tatsächlich ist dies die maximale Anzahl von Elementen im Notification.actions-Array, die vom User Agent berücksichtigt werden.

Wert

Eine ganze Zahl, die die größte Anzahl von Benachrichtigungsaktionen angibt, die dem Benutzer durch den User Agent und das Gerät präsentiert werden können.

Beispiele

Das folgende Codebeispiel protokolliert die maximale Anzahl der unterstützten Aktionen.

js
const maxActions = Notification.maxActions;
console.log(
  `This device can display at most ${maxActions} actions on each notification.`,
);

Spezifikationen

Specification
Notifications API
# dom-notification-maxactions

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
maxActions static property
Experimental

Legend

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

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

Siehe auch