【问题标题】:How view mime type in Chrome? It's showing "document" under "Network" tab如何在 Chrome 中查看 mime 类型?它在“网络”选项卡下显示“文档”
【发布时间】:2020-03-30 15:33:17
【问题描述】:

我正在尝试确定文件的 MIME 类型。在 Firefox 中,它显示text/cache-manifest。在 Chrome 中,F-12 -> Network Tabtype 下显示为document。当我查看响应标头时,它从不显示Content-Type,所以也许我的服务器没有发送它?还是我把document 解释错了?

在 .htaccess 中,我有:AddType text/cache-manifest .manifest

编辑:我也试过下面的代码,它仍然在 Chrome 中显示类型为document

ma​​nifest.php

<?php header("content-type: text/cache-manifest");?>

【问题讨论】:

  • 您是说即使您将Content-Type 标头设置为header(),您仍然看不到从您的服务器返回的HTTP 响应标头中?
  • @w3d 不,当我设置它时,我确实在响应标头中看到了它(不是 .manifest 文件,但我是 PHP 文件)但它仍然显示“类型”为document 在网络标签上。

标签: html .htaccess google-chrome


【解决方案1】:

网络选项卡根据请求类型过滤查询,而不是 MIME 类型。当您将其作为文档请求时(浏览器中的简单 http get 请求,例如来自图像或样式标签),然后将其显示为 type=document。 请参阅https://developers.google.com/web/tools/chrome-devtools/network/reference 了解更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-28
    • 2019-12-16
    • 2016-04-26
    • 2021-10-07
    • 2013-02-15
    • 1970-01-01
    • 2013-12-31
    • 2012-08-26
    相关资源
    最近更新 更多