aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/serviceworkerglobalscope/onnotificationclose
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/serviceworkerglobalscope/onnotificationclose
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/serviceworkerglobalscope/onnotificationclose')
-rw-r--r--files/ja/web/api/serviceworkerglobalscope/onnotificationclose/index.html60
1 files changed, 60 insertions, 0 deletions
diff --git a/files/ja/web/api/serviceworkerglobalscope/onnotificationclose/index.html b/files/ja/web/api/serviceworkerglobalscope/onnotificationclose/index.html
new file mode 100644
index 0000000000..24060add7a
--- /dev/null
+++ b/files/ja/web/api/serviceworkerglobalscope/onnotificationclose/index.html
@@ -0,0 +1,60 @@
+---
+title: onnotificationclose
+slug: Web/API/ServiceWorkerGlobalScope/onnotificationclose
+tags:
+ - API
+ - Experimental
+ - Interface
+ - Property
+ - Reference
+ - ServiceWorkerGlobalScope
+ - onnotificationclose
+translation_of: Web/API/ServiceWorkerGlobalScope/onnotificationclose
+---
+<p>{{APIRef("Service Workers API")}}</p>
+
+<p><code><strong>ServiceWorkerGlobalScope.onnotificationclose</strong></code> プロパティは、{{domxref("ServiceWorkerGlobalScope")}} オブジェクトで {{Event("notificationclose")}} イベントが発行されるとき、つまり、{{domxref("ServiceWorkerRegistration.showNotification()")}} によって生成された表示されている通知をユーザーが閉じるたびに呼び出されるイベントハンドラーです。</p>
+
+<p>メインスレッドや {{domxref("Notification.Notification","Notification()")}} コンストラクターを使用した service worker ではない worker で生成された通知は、<code>Notification</code> オブジェクト自身の {{Event("close")}} イベントを受け取ります。</p>
+
+<div class="note">
+<p><strong>注記</strong>: {{domxref("Notification.Notification","Notification()")}} コンストラクターを使用して {{domxref("ServiceWorkerGlobalScope")}} 内で通知を生成しようとすると、エラーがスローされます。</p>
+</div>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox" style="font-size: 14px;">ServiceWorkerGlobalScope.onnotificationclose = function(NotificationEvent) { ... };
+ServiceWorkerGlobalScope.addEventListener('notificationclose', function(NotificationEvent) { ... });</pre>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js">// service worker 内。
+self.onnotificationclose = function(event) {
+ console.log('On notification close: ', event.notification.tag);
+};
+</pre>
+
+<h2 id="Specifications" name="Specifications">仕様</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col"><font face="Open Sans, sans-serif"><span style="font-weight: normal;">仕様</span></font></th>
+ <th scope="col"><font face="Open Sans, sans-serif"><span style="font-weight: normal;">ステータス</span></font></th>
+ <th scope="col"><font face="Open Sans, sans-serif"><span style="font-weight: normal;">コメント</span></font></th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Web Notifications','#dom-serviceworkerglobalscope-onnotificationclose','onnotificationclick')}}</td>
+ <td>{{Spec2('Web Notifications')}}</td>
+ <td>初期定義。このプロパティは {{domxref('ServiceWorkerGlobalScope')}} の一部ですが、{{domxref('Notifications_API')}} イベントで定義されています。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザー実装状況</h2>
+
+<div>
+
+
+<p>{{Compat("api.ServiceWorkerGlobalScope.onnotificationclose")}}</p>
+</div>