什么会导致页面被取消?我有一个Chrome开发者工具的截图。
这种情况经常发生,但不是每次都发生。似乎一旦缓存了一些其他资源,页面刷新就会加载LeftPane.aspx。真正奇怪的是,这只发生在谷歌Chrome浏览器中,而不是ie8。知道为什么Chrome会取消一个请求吗?
什么会导致页面被取消?我有一个Chrome开发者工具的截图。
这种情况经常发生,但不是每次都发生。似乎一旦缓存了一些其他资源,页面刷新就会加载LeftPane.aspx。真正奇怪的是,这只发生在谷歌Chrome浏览器中,而不是ie8。知道为什么Chrome会取消一个请求吗?
当前回答
我有两个CSS文件,它们存储在我的主CSS文件夹之外的另一个文件夹中。我正在使用表达式引擎,发现问题是在我的htaccess文件中的规则。我只是将文件夹添加到我的条件之一,它修复了它。这里有一个例子:
RewriteCond %{REQUEST_URI} !(images|css|js|new_folder|favicon.ico)
因此,检查htaccess文件是否存在潜在冲突是值得的
其他回答
你可能想要检查“X-Frame-Options”标题标签。如果它设置为SAMEORIGIN或DENY,那么iFrame插入将被Chrome(和其他浏览器)根据规范取消。
另外,注意一些浏览器支持ALLOW-FROM设置,但Chrome不支持。
为了解决这个问题,你需要删除“X-Frame-Options”标题标签。这可能会让你容易受到点击劫持攻击,所以你需要决定风险是什么以及如何减轻它们。
对我来说,“取消”状态是因为文件不存在。奇怪为什么chrome浏览器不显示404。
我也遇到过同样的问题,在我们的代码深处,我们有这样的伪代码:
创建iframe 加载iframe提交一个表单 2秒后,移除iframe
thus, when the server takes more than 2 seconds to respond the iframe to which the server was writing the response to, was removed, but the response was still to be written , but there was no iframe to write , thus chrome cancelled the request, thus to avoid this I made sure that the iframe is removed only after the response is over, or you can change the target to "_blank". Thus one of the reason is: when the resource(iframe in my case) that you are writing something in, is removed or deleted before you stop writing to it, the request will be cancelled
当我在样式表中嵌入web字体时,我已经嵌入了所有类型的字体以及woff, woff2, ttf。最近我注意到Chrome取消请求ttf和woff时,woff2是存在的。我现在使用Chrome版本66.0.3359.181,但我不确定Chrome什么时候开始取消额外的字体类型。
这是发生在我身上的事情:服务器为302重定向返回了一个格式错误的“Location”头。 当然,Chrome没有告诉我这一点。我在firefox中打开了这个页面,并立即发现了问题。 有多种工具真好:)