BackgroundFetchRegistration: abort() method

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Background Fetch API")}}{{SeeCompatTable}}{{AvailableInWorkers}}

The **abort()** method of the {{domxref("BackgroundFetchRegistration")}} interface aborts an active background fetch.

Syntax

js-nolint
abort()

Parameters

None.

Return value

A {{jsxref("Promise")}} that resolves with true if the fetch is successfully aborted.

Examples

Use abort() to terminate a background fetch that is in progress.

js
bgFetch.abort();

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}