有什麼辦法可以在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 .. –
您以純文本形式發送的內容是什麼? –