Implement initial version of navigator.sendBeacon (#38301)

Gated behind the feature flag `dom_navigator_sendbeacon_enabled` as the
`keep-alive` fetch parameter is crucial for real-life use cases such as
analytics requests.

Part of #4577
Part of #38302

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-08-02 17:14:07 +02:00 committed by GitHub
parent 181f97879d
commit dbb886fad2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 237 additions and 29 deletions

View file

@ -0,0 +1,12 @@
[beacon-basic.https.window.html]
[Payload size restriction should be accumulated: type = string]
expected: FAIL
[Payload size restriction should be accumulated: type = arraybuffer]
expected: FAIL
[Payload size restriction should be accumulated: type = blob]
expected: FAIL
[sendBeacon() with a stream does not work due to the keepalive flag being set]
expected: FAIL

View file

@ -0,0 +1,6 @@
[beacon-cors.https.window.html]
[cross-origin, non-CORS-safelisted: failure case (without redirect)]
expected: FAIL
[cross-origin, non-CORS-safelisted[credentials=false\]]
expected: FAIL

View file

@ -0,0 +1,4 @@
[header-referrer-no-referrer-when-downgrade.https.html]
expected: TIMEOUT
[Test referer header http://web-platform.test:8000/beacon/resources/]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[header-referrer-strict-origin-when-cross-origin.https.html]
expected: TIMEOUT
[Test referer header http://www1.web-platform.test:8000/beacon/resources/]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[header-referrer-strict-origin.https.html]
expected: TIMEOUT
[Test referer header http://web-platform.test:8000/beacon/resources/]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[header-referrer-unsafe-url.https.html]
expected: TIMEOUT
[Test referer header http://web-platform.test:8000/beacon/resources/]
expected: TIMEOUT