Class BackgroundFetchRegistration
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalBackgroundFetchRegistration interface of the 'Background Fetch API' represents an individual background fetch.
[Value("BackgroundFetchRegistration")]
public class BackgroundFetchRegistration : EventTarget
- Inheritance
-
BackgroundFetchRegistration
- Inherited Members
Remarks
A BackgroundFetchRegistration instance is returned by the Fetch(string, Union0, BackgroundFetchOptions) or Get(string) methods, and therefore there has no constructor.
Constructors
BackgroundFetchRegistration()
public BackgroundFetchRegistration()
Properties
DownloadTotal
NOTE
ExperimentaldownloadTotal read-only property of the BackgroundFetchRegistration interface returns the total size in bytes of this download. This is set when the background fetch was registered, or 0 if not set.
[Value("downloadTotal")]
public ulong DownloadTotal { get; }
Property Value
Remarks
Downloaded
NOTE
Experimentaldownloaded read-only property of the BackgroundFetchRegistration interface returns the size in bytes that has been downloaded, initially 0.
[Value("downloaded")]
public ulong Downloaded { get; }
Property Value
Remarks
If the value of this property changes, the progress event is fired at the associated BackgroundFetchRegistration object.
FailureReason
NOTE
ExperimentalfailureReason read-only property of the BackgroundFetchRegistration interface returns a string with a value that indicates a reason for a background fetch failure.
[Value("failureReason")]
public BackgroundFetchFailureReason FailureReason { get; }
Property Value
- BackgroundFetchFailureReason
One of the following strings:
Remarks
If the value of this property changes, the progress event is fired at the associated BackgroundFetchRegistration object.
Id
NOTE
Experimentalid read-only property of the BackgroundFetchRegistration interface returns a copy of the background fetch's ID.
[Value("id")]
public string Id { get; }
Property Value
- string
A string.
Remarks
Onprogress
[Value("onprogress")]
public EventHandlerNonNull Onprogress { get; set; }
Property Value
RecordsAvailable
NOTE
ExperimentalrecordsAvailable read-only property of the BackgroundFetchRegistration interface returns true if there are requests and responses to be accessed. If this returns false, then Match(Union42, CacheQueryOptions) and MatchAll(Union42, CacheQueryOptions) can't be used.
[Value("recordsAvailable")]
public bool RecordsAvailable { get; }
Property Value
Remarks
Result
NOTE
Experimentalresult read-only property of the BackgroundFetchRegistration interface returns a string indicating whether the background fetch was successful or failed.
[Value("result")]
public BackgroundFetchResult Result { get; }
Property Value
- BackgroundFetchResult
One of the following strings:
Remarks
If the value of this property changes, the progress event is fired at the associated BackgroundFetchRegistration object.
UploadTotal
NOTE
ExperimentaluploadTotal read-only property of the BackgroundFetchRegistration interface returns the total number of bytes to be sent to the server.
[Value("uploadTotal")]
public ulong UploadTotal { get; }
Property Value
Remarks
Uploaded
NOTE
Experimentaluploaded read-only property of the BackgroundFetchRegistration interface returns the size in bytes successfully sent, initially 0.
[Value("uploaded")]
public ulong Uploaded { get; }
Property Value
Remarks
If the value of this property changes, the progress event is fired at the associated BackgroundFetchRegistration object.
Methods
Abort()
NOTE
Experimentalabort() method of the BackgroundFetchRegistration interface aborts an active background fetch.
[Value("abort")]
public Task<bool> Abort()
Returns
Remarks
Match(Union42, CacheQueryOptions)
NOTE
Experimentalmatch() method of the BackgroundFetchRegistration interface returns the first matching BackgroundFetchRecord.
[Value("match")]
public Task<BackgroundFetchRecord> Match(Union42 request, CacheQueryOptions options = null)
Parameters
requestUnion42optionsCacheQueryOptions
Returns
- Task<BackgroundFetchRecord>
A {{jsxref("Promise")}} that resolves with the first BackgroundFetchRecord that matches
the request or GlobalObject.Undefined if no match is found.NOTE
BackgroundFetchRegistration.match()is basically identical to
MatchAll(Union42, CacheQueryOptions), except that rather than resolving with an array of
all matching records, it resolves with the first matching record only.
Remarks
MatchAll(Union42, CacheQueryOptions)
NOTE
ExperimentalmatchAll() method of the BackgroundFetchRegistration interface returns an array of matching BackgroundFetchRecord objects.
[Value("matchAll")]
public Task<List<BackgroundFetchRecord>> MatchAll(Union42 request = default, CacheQueryOptions options = null)
Parameters
requestUnion42optionsCacheQueryOptions
Returns
- Task<List<BackgroundFetchRecord>>
A {{jsxref("Promise")}} that resolves with an array of all matching BackgroundFetchRecord objects.