From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../onpushsubscriptionchange/index.html | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 files/ja/web/api/serviceworkerglobalscope/onpushsubscriptionchange/index.html (limited to 'files/ja/web/api/serviceworkerglobalscope/onpushsubscriptionchange') diff --git a/files/ja/web/api/serviceworkerglobalscope/onpushsubscriptionchange/index.html b/files/ja/web/api/serviceworkerglobalscope/onpushsubscriptionchange/index.html new file mode 100644 index 0000000000..f1dd4e3bd7 --- /dev/null +++ b/files/ja/web/api/serviceworkerglobalscope/onpushsubscriptionchange/index.html @@ -0,0 +1,64 @@ +--- +title: ServiceWorkerGlobalScope.onpushsubscriptionchange +slug: Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange +tags: + - API + - NeedsExample + - Property + - Push + - Reference + - Service Worker + - ServiceWorkerGlobalScope + - onpushsubscriptionchange +translation_of: Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange +--- +
{{APIRef("Service Workers API")}}
+ +

{{domxref("ServiceWorkerGlobalScope")}} インターフェースの ServiceWorkerGlobalScope.onpushsubscriptionchange イベントは、アプリケーションのコントロールの外側で発生したプッシュサブスクリプションの変更を示すために発火されます。例えば、ブラウザーがプッシュサブスクリプションをリフレッシュしたときなどです。

+ +

以前は、プッシュサブスクリプションが無効化された時(または無効になろうとしている時)に発火されるイベントインターフェースとして定義されていました。もし望むなら、これはプッシュメッセージの取得を継続するために、再講読する機会を提供します。たとえば、これはプッシュサービスがサブスクリプションに有効期限を設定した場合に発生します。

+ +

構文

+ +
ServiceWorkerGlobalScope.onpushsubscriptionchange = function() { ... }
+self.addEventListener('pushsubscriptionchange', function() { ... })
+
+ +

+ +
self.addEventListener('pushsubscriptionchange', function() {
+  // 何かを実行する。一般的には、XHR や Fetch を通して
+  // サーバーに新しいサブスクリプションの詳細を送ることで
+  // 再サブスクライブする。
+});
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Push API', '#widl-ServiceWorkerGlobalScope-onpushsubscriptionchange', 'onpushsubscriptionchange')}}{{Spec2('Push API')}}初期定義(ノート: このイベントは Push API で仕様化されていますが、{{domxref("ServiceWorkerGlobalScope")}} を介してアクセスします)。
+ +

ブラウザー実装状況

+ +
+ + +

{{Compat("api.ServiceWorkerGlobalScope.onpushsubscriptionchange")}}

+
+ +

関連項目

+ + -- cgit v1.2.3-54-g00ecf