资源的 status=canceled 在 Chrome 开发者工具中是什么意思? [英] What does status=canceled for a resource mean in Chrome Developer Tools?

查看:136
本文介绍了资源的 status=canceled 在 Chrome 开发者工具中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么会导致页面被取消?我有 Chrome 开发者工具的屏幕截图.

What would cause a page to be canceled? I have a screenshot of the Chrome Developer Tools.

这种情况经常发生,但并非每次都发生.似乎一旦缓存了其他一些资源,页面刷新就会加载 LeftPane.aspx.真正奇怪的是,这只发生在谷歌浏览器中,而不是 Internet Explorer 8.有什么想法为什么 Chrome 会取消请求吗?

This happens often but not every time. It seems like once some other resources are cached, a page refresh will load the LeftPane.aspx. And what's really odd is this only happens in Google Chrome, not Internet Explorer 8. Any ideas why Chrome would cancel a request?

推荐答案

我们解决了一个类似的问题,即 Chrome 取消了在帧或 iframe 中加载内容的请求,但只是间歇性的,而且似乎取决于计算机和/或速度互联网连接.

We fought a similar problem where Chrome was canceling requests to load things within frames or iframes, but only intermittently and it seemed dependent on the computer and/or the speed of the internet connection.

这些信息已经过时了几个月,但我从头开始构建 Chromium,挖掘源代码以找到所有请求可能被取消的地方,并在所有这些地方设置断点以进行调试.根据记忆,Chrome 将取消请求的唯一地方:

This information is a few months out of date, but I built Chromium from scratch, dug through the source to find all the places where requests could get cancelled, and slapped breakpoints on all of them to debug. From memory, the only places where Chrome will cancel a request:

  • 导致发出请求的 DOM 元素被删除(即正在加载 IMG,但在加载发生之前,您删除了 IMG 节点)
  • 您做了一些使加载数据变得不必要的事情.(即您开始加载 iframe,然后更改 src 或覆盖内容)
  • 有很多请求发送到同一台服务器,早期请求的网络问题表明后续请求无法正常工作(DNS 查找错误,导致早期(相同)请求,例如 HTTP 400 错误代码等)

在我们的例子中,我们最终将其追溯到一个试图将 HTML 附加到另一个框架的框架,这有时发生在目标框架甚至加载之前.一旦您触摸 iframe 的内容,它就无法再将资源加载到其中(它怎么知道将其放在哪里?),因此它会取消请求.

In our case we finally traced it down to one frame trying to append HTML to another frame, that sometimes happened before the destination frame even loaded. Once you touch the contents of an iframe, it can no longer load the resource into it (how would it know where to put it?) so it cancels the request.

这篇关于资源的 status=canceled 在 Chrome 开发者工具中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆