如何检测浏览器已弃用XMLHTTPRequest?

发布于 2025-01-23 08:36:27 字数 322 浏览 3 评论 0原文

最近,我注意到我的Chr *** M相关浏览器的控制台中的此错误:

[rebecation]主线程上的同步XMLHTTPRequest因其对最终用户的经验的有害效果而被弃用。有关更多帮助,请检查h ****:// ** 。 /em>/。

我该如何期望浏览器会做到这一点,并为听起来不再使用的API创建解决方法?

我打算无限期地保持与较旧的浏览器的兼容性,因此删除这种行为不是我可以直接删除的,但是我也许可以围绕它进行检查吗?

Recently, I have noticed this error in my Chr***m-related browser's console:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check h****://..**./.

How can I anticipate that a browser will do this and create a workaround for what sounds like intended to become an API which can no longer be used?

I'm intending to maintain compatibility with older browsers indefinitely, so removing this behavior is not something I can remove outright, but I can perhaps feature-check around it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文