Use fetch with keepalive: true instead of navigator.sendBeacon

This allows customizing the headers of the request. It has the same
semantics as `navigator.sendBeacon` and it's the recommended alternative
to `sendBeacon` for customizing the request:

https://www.w3.org/TR/beacon/#introduction

This commit also fixes `settings.requestHandler` not being called when
using `settings.sendBeaconCommit`.
This commit is contained in:
Rubén Herrero
2022-02-16 11:37:26 +01:00
parent 3aec87829a
commit b5c21ea86f
13 changed files with 77 additions and 109 deletions

File diff suppressed because one or more lines are too long