Chrome开发人员工具中的资源意味着什么状态=取消? [英] What does status=canceled for a resource mean in Chrome Developer Tools?

查看:163
本文介绍了Chrome开发人员工具中的资源意味着什么状态=取消?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这经常发生,但不是每次都发生。看起来像一旦其他资源被缓存,页面刷新将加载LeftPane.aspx。而真正奇怪的是,这只是在Google Chrome而不是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.

这篇关于Chrome开发人员工具中的资源意味着什么状态=取消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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