Closed mingyc closed 11 months ago
Request payload limit is addressed in https://github.com/WICG/pending-beacon/issues/76#issuecomment-1807713924 and https://github.com/WICG/pending-beacon/issues/66
setData(data)
now longer exists in fetchLater()
, which supports request body via its RequestInfo
or DeferredRequestInit
args, e.g.
fetchLater(url, {
body: ...
});
After calling the API, the request is not updatable. Developers will have to abort previous pending fetchLater requests first. See also Update a pending request.
It's not mentioned in current explainer, but I assume browser should impose a limit for request payload similar to
navigator.sendBeacon()
's one?navigator.sendBeacon() returns
false
if the amount of data to be queued exceeds the user agent limit. It's partly because the underlying implementation is usingFetch
API, where there is a discussion about payload limits in https://github.com/w3c/beacon/pull/39. But for PendingBeacon, it's not specified to to use Fetch.Should
setData(data)
throw exception or returnfalse
? (Whether to throw exception from PendingBeacon API is also not specified yet)