blob: 0dbe3fbad3cf343c36977380653c73144c6659d8 [file] [log] [blame]
// Content was automatically extracted by Reffy into reffy-reports
// (
// Source: Background Fetch (
partial interface ServiceWorkerGlobalScope {
attribute EventHandler onbackgroundfetchsuccess;
attribute EventHandler onbackgroundfetchfail;
attribute EventHandler onbackgroundfetchabort;
attribute EventHandler onbackgroundfetchclick;
partial interface ServiceWorkerRegistration {
readonly attribute BackgroundFetchManager backgroundFetch;
interface BackgroundFetchManager {
Promise<BackgroundFetchRegistration> fetch(DOMString id, (RequestInfo or sequence<RequestInfo>) requests, optional BackgroundFetchOptions options);
Promise<BackgroundFetchRegistration?> get(DOMString id);
Promise<sequence<DOMString>> getIds();
dictionary BackgroundFetchUIOptions {
sequence<ImageResource> icons;
DOMString title;
dictionary BackgroundFetchOptions : BackgroundFetchUIOptions {
unsigned long long downloadTotal = 0;
interface BackgroundFetchRegistration : EventTarget {
readonly attribute DOMString id;
readonly attribute unsigned long long uploadTotal;
readonly attribute unsigned long long uploaded;
readonly attribute unsigned long long downloadTotal;
readonly attribute unsigned long long downloaded;
readonly attribute BackgroundFetchResult result;
readonly attribute BackgroundFetchFailureReason failureReason;
readonly attribute boolean recordsAvailable;
attribute EventHandler onprogress;
Promise<boolean> abort();
Promise<BackgroundFetchRecord> match(RequestInfo request, optional CacheQueryOptions options);
Promise<sequence<BackgroundFetchRecord>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
enum BackgroundFetchResult { "", "success", "failure" };
enum BackgroundFetchFailureReason {
// The background fetch has not completed yet, or was successful.
// The operation was aborted by the user, or abort() was called.
// A response had a not-ok-status.
// A fetch failed for other reasons, e.g. CORS, MIX, an invalid partial response,
// or a general network failure for a fetch that cannot be retried.
// Storage quota was reached during the operation.
// The provided downloadTotal was exceeded.
interface BackgroundFetchRecord {
readonly attribute Request request;
readonly attribute Promise<Response> responseReady;
[Constructor(DOMString type, BackgroundFetchEventInit init), Exposed=ServiceWorker]
interface BackgroundFetchEvent : ExtendableEvent {
readonly attribute BackgroundFetchRegistration registration;
dictionary BackgroundFetchEventInit : ExtendableEventInit {
required BackgroundFetchRegistration registration;
[Constructor(DOMString type, BackgroundFetchEventInit init), Exposed=ServiceWorker]
interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent {
Promise<void> updateUI(optional BackgroundFetchUIOptions options);