-
Notifications
You must be signed in to change notification settings - Fork 22
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
Beacon is only exposed to Worker in Microsoft Edge #37
Comments
ad3cf91#diff-eacf331f0ffc35d4b482f1d15a887d3bR274 defined sendBeacon on WorkerNavigator. However, it does appear that neither Chrome nor FF implemented it... wish we caught that earlier!
I'm inclined to agree... One of the primary reasons for sendBeacon is/was to remove the need for synchronous requests blocking the UI thread. If you're running code within a worker, then you've already taken the necessary precautions against that. Also, now that we've landed keepalive flag for Fetch, worker code can leverage (once implemented :)) same semantics as sendBeacon but with added flexibility of customizing the request method, headers, etc. In other words, exposing sendBeacon on Worker at this point is, at best, a convenience wrapper on Fetch, and I'm inclined to say that it's not worth it; we're better off nudging developers to work with Fetch API moving forward... both within Worker and Window. |
Firefox's implementation of sendBeacon was written before the WorkerNavigator addition, and no one bothered to file bugs on implementations when the spec was changed, apparently. :( I don't know enough about the persistence flag on fetch to comment on the rest. Does it allow a worker to create a fetch that outlives the worker? |
@igrigorik sounds good. @bzbarsky yeah, the keepalive flag would allow for that. |
@toddreifsteck @annevk removed in 95e6a1f, closing. |
Our tests at web-platform-tests/wpt#4024 show that Worker is only exposed in Microsoft Edge. It seems like perhaps it should be limited to Window.
The text was updated successfully, but these errors were encountered: