From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../ja/web/api/notificationevent/action/index.html | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 files/ja/web/api/notificationevent/action/index.html (limited to 'files/ja/web/api/notificationevent/action') diff --git a/files/ja/web/api/notificationevent/action/index.html b/files/ja/web/api/notificationevent/action/index.html new file mode 100644 index 0000000000..0f1f7bf62f --- /dev/null +++ b/files/ja/web/api/notificationevent/action/index.html @@ -0,0 +1,64 @@ +--- +title: NotificationEvent.action +slug: Web/API/NotificationEvent/action +tags: + - API + - Experimental + - NotificationEvent + - Notifications + - Property + - Reference + - Service Workers + - ServiceWorker + - action + - プロパティ + - 通知 +translation_of: Web/API/NotificationEvent/action +--- +

{{APIRef("Web Notifications")}}

+ +

ユーザーがクリックした通知ボタンの文字列 ID を返します。ユーザーがアクションボタン以外の場所で通知をクリックした場合、または通知にボタンがない場合、この値は空の文字列を返します。通知 ID は、アクション配列属性を介した通知の作成中に設定され、通知が置き換えられない限り変更することはできません。

+ +

返値

+ +

{{domxref("DOMString")}} オブジェクト。

+ +

+ +
self.registration.showNotification("New articles available", {
+  actions: [{action: "get", title: "Get now."}]
+});
+
+self.addEventListener('notificationclick', function(event) {
+  event.notification.close();
+  if (event.action === 'get') {
+    synchronizeReader();
+  } else {
+    clients.openWindow("/reader");
+  }
+}, false);
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Web Notifications','#dom-notification-actions','action')}}{{Spec2('Web Notifications')}}Living standard
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.NotificationEvent.action")}}

-- cgit v1.2.3-54-g00ecf