BackgroundFetchEvent()

Limited availability

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

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

コンストラクター BackgroundFetchEvent() は新しい BackgroundFetchEvent オブジェクトを生成します。このコンストラクタは通常、使用されることはありません。なぜなら、これらのオブジェクトはブラウザによって自動で生成され、バックグラウンドのフェッチイベントのコールバックに渡されるからです。

構文

js
new BackgroundFetchEvent(type, options)

引数

type

イベント名の文字列。 大文字と小文字は区別されます。ブラウザーはこれを backgroundfetchabort またはbackgroundfetchclick に設定します。

options

ExtendableEvent() で定義されたプロパティに加えて、下記のプロパティを持つオブジェクト。

registration

BackgroundFetchRegistration オブジェクト。

返値

新しく生成された BackgroundFetchEvent オブジェクト。

仕様書

Specification
Background Fetch
# dom-backgroundfetchevent-backgroundfetchevent

ブラウザーの互換性

BCD tables only load in the browser