Loading module from “https://myhost/es2015-myscript.js " was blocked because of a disallowed MIME type (“”).
Categories
(Core :: DOM: Security, defect)
Tracking
()
People
(Reporter: mahesh.wattamwar, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4466.0 Safari/537.36 Edg/91.0.855.0
Steps to reproduce:
Access a site that hasloads JavaSript with type = module. ASP.Net Core server returns the JavaScript file with Content-Type="application/javascript".
HTML contains <src> tags as below:
<script src="/dashboard/product/staticres/runtime-es2015.fb4cf017484ef7075fcf.js" type="module"></script><script src="/dashboard/product/staticres/runtime-es5.fb4cf017484ef7075fcf.js" nomodule="" defer=""></script><script src="/dashboard/product/staticres/polyfills-es5.973a06b532b45497610a.js" nomodule="" defer=""></script><script src="/dashboard/product/staticres/polyfills-es2015.402f35cdff303433dc47.js" type="module"></script><script src="/dashboard/product/staticres/scripts.71b8fb2c2937463f1f3d.js" defer=""></script><script src="/dashboard/product/staticres/main-es2015.dbf7a8b46b0692fcded2.js" type="module"></script><script src="/dashboard/product/staticres/main-es5.dbf7a8b46b0692fcded2.js" nomodule="" defer=""></script>
Actual results:
Firefox failed to load the file with following error
Loading module from “https://partner.microsoft.com/dashboard/product/staticres/runtime-es2015.fb4cf017484ef7075fcf.js” was blocked because of a disallowed MIME type (“”).
Expected results:
Firefox should have loaded the file.
Comment 1•4 years ago
|
||
Could you please offer an example of a website so we could easily reproduce the issue?
Thanks.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
This is expected behavior. Your sever needs to use a correct Content-Type header like text/javascript for JS files.
Updated•4 years ago
|
Description
•