有什么办法可以在Chrome中禁用strict MIME type checking
。禁用Chrome严格的MIME类型检查
其实我正在一个跨域的JSONP请求。它在Firefox上工作的很好,但是在使用chrome时它在控制台中给出了一些错误。
拒绝执行'https://example.com'的脚本,因为它的MIME类型('text/plain')不可执行,并且启用严格的MIME类型检查。
它在Mozilla工作完美..问题是出现在Chrome只
这里是请求的响应头..
Cache-Control:no-cache, no-store
Connection:Keep-Alive
Content-Length:29303
Content-Type:text/plain;charset=ISO-8859-1
Date: xxxx
Expires:-1
Keep-Alive:timeout=5
max-age:Thu, 01 Jan 1970 00:00:00 GMT
pragma:no-cache
Set-Cookie:xxxx
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options:nosniff
X-Frame-Options:SAMEORIGIN
解决方法是什么,我认为: 外部设定内容类型为application/javascript
你见过这个类似的问题吗? http://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github –
@Rory McCrossan是的...那个问题是指从github中获取文件..而他们是替代解决方法将文件导出为zip .. –
您以纯文本形式发送的内容是什么? –