PeriodicSyncEvent: tag プロパティ

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

メモ: この機能はサービスワーカー内でのみ利用可能です。

PeriodicSyncEvent インターフェイスの読み取り専用プロパティ tag は、PeriodicSyncEvent 用の開発者定義の識別子を返します。これは、PeriodicSyncManager インターフェイスの PeriodicSyncManager.register() メソッドを呼ぶ際に指定されます。ウェブアプリケーションは、異なる定期的なタスクを異なる頻度で実行するため、複数のタグを使用できます。

定義された識別子を表す String を返します。

以下の例は、サービスワーカーで定期的な同期イベントを受け取り、tag プロパティにアクセスするデモを行います。

js
self.addEventListener("periodicsync", (event) => {
  console.log(event.tag); // イベントのタグを記録する
});

仕様書

Specification
Web Periodic Background Synchronization
# dom-periodicsyncevent-tag

ブラウザーの互換性

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
tag
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.

関連情報