Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api.Navigator.sendBeacon - Browser support: should warn about payload size limits #20721

Open
ajhyndman opened this issue Sep 16, 2023 · 0 comments
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@ajhyndman
Copy link

What type of issue is this?

Missing compatibility data

What information was incorrect, unhelpful, or incomplete?

Both Chromium and Safari implement strict payload size limits on data sent via sendBeacon or fetch with keepalive: true.

This is really poorly documented across the web, and extremely difficult to diagnose.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Safari

What did you expect to see?

A note in this article that many browsers impose strict size limits on beacon requests could have saved me days of investigation.

Did you test this? If so, how?

I spent the last several days investigating an issue that turned out to be a symptom of this behaviour.

To reproduce is pretty simple though, simply attempt to call sendBeacon in chrome with a request body larger than 64 kB.

navigator.sendBeacon("http://google.com", new Array(100000).join("Z"));

image

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

I found this comment buried in a w3c pull request that references the limitation:

w3c/beacon#39 (comment)

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

MDN metadata

MDN page report details
  • Query: api.Navigator.sendBeacon
  • Report started: 2023-09-15T23:09:46.198Z
@queengooborg queengooborg added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

No branches or pull requests

2 participants