webgl project only runs in firefox
Hey i was wondering if anyone could shed some light on what is going on. My project doesn't load in chrome and safari but runs fine in firefox. Here are the errors I am getting:
Refused to execute script from 'myurl/Release/UnityConfig.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. (index):1 Refused to execute script from 'myurl/Release/fileloader.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. (index):1 Refused to execute script from 'myurl/Release/mygame.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
Thanks
Basically I am getting: "Refused to execute script because its $$anonymous$$I$$anonymous$$E type ('text/plain') is not executable, and strict $$anonymous$$I$$anonymous$$E type checking is enabled" on a few different scripts.
Answer by RobertoLangarica · Mar 15, 2016 at 09:45 PM
Are you running the project in a server? (even a local server) could be a security check. Take a look on this link: WebGL-building-manual it is explained in much detail there.
Hey Roberto thanks for the reply, we are running it on a server, yes. How do you know it is a security check? We have the project up on our website so making every chrome user (which is most ) use the --disable-web-security command doesn't seem very practical. Has the webgl/web player always had issues with chrome? Just curious if it is normal, or are we an exception. Thanks
The flag --disable-web-security it is only for debug purpose on your machine. I don't know about the security i'm just guessing. Try it on a local server before to put a remote server a common issue is the compressed form of the files, the server should support this and the newest version of Unity only build compressed files in the release form. You could try with a development build (it came without compression) and enable exceptions so you could see more info about the error.
Let me know if theres is a progress. PD: If the development build works then your problem is the compression.
Your answer
Follow this Question
Related Questions
WebGL: RuntimeError: memory access out of bounds. 6 Answers
Asset Bundles misMatch 0 Answers
WebCamTexture on Mobile Browser 0 Answers
Delaying WebGL player loading until user input 0 Answers
How do i make a save persistent cross players with WebGL 0 Answers