designcourse
designcourse copied to clipboard
sendBeacon calls blocked
We have a proxy and we configured datadogRum to use it with the proxyUrl
configuration.
uBlock intercepts the call before even reaching our proxy
Any suggestion?
Although I don't know how much effective, one suggestion is the one provided in #1344: when proxyUrl is provided, send the ddforward
value as part of the POST data, not as part of the URL
After some investigation, it looks like the request is blocked because uBlock blocks requests sent via sendBeacon
Hello @ffissore,
As you mentioned in your comments, the issue is indeed not related to proxy configuration.
We are aware of the blocking of sendBeacon
requests, it is related to the EasyPrivacy block list used by uBlock and other ad/tracker blockers, see https://github.com/uBlockOrigin/uAssets/issues/11272.
One way to circumvent the blocking could be to have your proxy on your web application domain, only third party calls are blocked.
We are also planning to rework our strategy to send requests in the short/mid term, it should less rely on sendBeacon which would then mitigate this behavior. We'll keep you posted here.
Thx, I'll wait for the rework then
~~This is out of scope for this issue, but please, pretty please, consider packing the proxied request in a different way, to avoid hitting Cloudflare WAF as reported in #1344: alternatively, allow devs to inject a custom mechanism for sending requests~~ (@bcaudan moved discussion to #1344)
One way to circumvent the blocking could be to have your proxy on your web application domain, only third party calls are blocked.
Ran into this issue today due to our application domains using a CNAME record to a third party DNS provider. So they're flagged as third party requests and due to the requests using sendBeacon
dd's request to our proxy for rum are being blocked (Firefox only due to CNAME inspection uBlock does there).
With 4.29.0 version, most of the requests are now using fetch
instead of sendBeacon
.
We now only use sendBeacon
to flush batched data when the page visibility becomes hidden or before unload.
It should then mitigate the impact of the blocking of sendBeacon
requests.