-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Advise needed: Firefox does not send xhr because of syncXHRFix.js and XHRInterceptor.js #4049
Comments
We're also affected, I am looking forward to the solution. Cheers! Elmar |
In addition, we are using version 1.96 but in latest stable 1.120 seems to be the same |
Could you elaborate more on that?
The referenced Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=697151 is still not resolved. Could you please share:
|
Hello and thanks for taking care on this! Please find a demo of the issue at: https://vserver.wollner.cloud/ it contains the "ui5 demo todo app" with dynatrace ruxitagent.js integrated and it shows the firefox issue directly. If you hit the page with chrome or edge everything works as expected, measurement beacons are sent out to the dynatrace saas instance at https://bf17584hvk.bf.dynatrace.com, but firefox cannot send out because of syncXHRFix.js. In other web application frameworks out, we did not experience such a firefox behaviour, only ui5 behaves different here. Thanks for all your thoughts, |
For your additional questions:
If you need more information please let me know. |
Thanks for sharing the minimal demo app. It looks like the expected Dynatrace requests are working now even in Firefox. Last time I checked, the reports were still not being sent in FF, and I could see in the unminified Dynatrace script a function named
I'd suggest reaching out to the Dynatrace support to learn more about the sending strategies and whether the Beacon API based strategy can be used for FF users. Regarding
Here is a summarized version of what is actually happening: // OpenUI5: syncXHRFix
globalThis.XMLHttpRequest = new Proxy(globalThis.XMLHttpRequest, {
construct(TargetClass, args) {
const xhr = new TargetClass(...args);
return new Proxy(xhr, {
get(target, propertyName) {
const vProp = target[propertyName];
return propertyName === "open" ? function() {
vProp.apply(target, arguments); // fails due to Dynatrace making vProp a bound function
} : vProp;
}
});
}
});
const myXHR = new XMLHttpRequest()
// Dynatrace:
myXHR.open = Function.prototype.bind.call.apply(Function.prototype.bind, [XMLHttpRequest.prototype.open, myXHR]); // from functionBind <-- works without
myXHR.open("POST", "https://example.com"); // In Firefox only, since no fetch API w/ keepalive In my view, what Dynatrace does in You can try the above code snippet anywhere. We can see that
The I was able to confirm that bypassing the |
Hello, thank you very much for your effort and your detailed explanation on this topic. We got some reply from the DT devs, which we want to let you know:
The fact that the demo app now works is more or less a coincidence and depends on whether dynatrace or sap-ui loads faster. If sap-ui is used with local node_modules and caching, dynatrace is too late via cdn and is overloaded by syncXHRFix. thanks again, |
Hello openui5 Team,
we currently have the situation that we want to measure the end user performance in a UI5 project with the help of dynatrace. For this purpose, a javascript (ruxitagent) is loaded into the browser and corresponding measurements of the response time behavior of the UI5 application are created based on the W3C performance timings. The measurement results are sent via xhr to a SaaS instance for further analysis and reporting.
At this point, the JS files syncXHRFix.js and XHRInterceptor.js available in UI5 prevent the transmission of the measurement results, but only in the Firefox browser. According to the comment in the source code of the files, these were installed about 5 years ago as a workaround to stabilize the handling of synchronous requests in Firefox. In Edge and Chrome, however, the XHRs are sent successfully.
My question is: Are these old patches still needed today? Is it possible to disable the interception of XHR requests in Firefox by bypassing the syncXHRFix / XHRInterceptor? Is there a config option for this?
Any further idea on how to work around the Firefox xhr issue is highly welcome.
Thank you in advance,
best regards,
Tom
The text was updated successfully, but these errors were encountered: