JavaScript files blocked because of MIME type mismatch

Having trouble installing Oxygen XML WebHelp? Got a bug to report? Post it all here.
Frank Ralf
Posts: 474
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

JavaScript files blocked because of MIME type mismatch

Post by Frank Ralf »

Hi,

One of our customers delivers the Oxygen WebHelp output via a WordPress site. However, all the JavaScript from the WebHelp is blocked by the browser with the following error message:

The resource from “https://docs.mydomain.de/pub/setclip/ah ... 2024041900” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

According to Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff) this is because the server sets the content type of the JavaScript files to text/plain instead of text/javascript. Is this something that can be fixed on WebHelp level? Or is this a server configuration?

Best regards,
Frank

EDIT
Looks as if the script tags that include the JavaScript files are missing the type-attribute compared to the CSS files:

Code: Select all

<script src="./oxygen-webhelp/app/options/properties.js"></script>

<link rel="stylesheet" type="text/css" href="./oxygen-webhelp/app/main.css" />
Frank Ralf
parson AG
www.parson-europe.com
beniamin_savu
Posts: 36
Joined: Fri Jan 22, 2021 11:05 am

Re: JavaScript files blocked because of MIME type mismatch

Post by beniamin_savu »

Hi,

Thank you for your feedback!

Please note that omitting the type attribute indicates that the script is considered a classic script, interpreted as JavaScript. For more details on the type attribute, refer to the following sources: :
* https://html.spec.whatwg.org/multipage/ ... cript-type
* https://developer.mozilla.org/en-US/doc ... _mime_type

Setting the MIME type for a file is most likely associated with the server configuration settings. Unfortunately we don't think it can be adjusted directly from WebHelp.

Best regards,
Beniamin Savu
Oxygen WebHelp Team
http://www.oxygenxml.com
Frank Ralf
Posts: 474
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: JavaScript files blocked because of MIME type mismatch

Post by Frank Ralf »

Thanks for your quick reply!

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 474
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: JavaScript files blocked because of MIME type mismatch

Post by Frank Ralf »

The customer changed the server settings to recognize JS files in addition to HTML and CSS and now it works.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply