- Home /
Browser doesn't support Web GL
I have developed a game, wanted to export it into Web GL. The error below keeps appearing before the page displays.
"It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser."
What can I do to fix this issue?
ps: I'm new to Unity Build Settings.
It doesn't work on Github, but I tried on simmer.io. The game is working, but when I click on Play, the loading scene doesn't seem working.
I am using C# for scripting. Will the script be affected? Anything that I should change as I can't find any similar issues posted here?
ps: Please share me any link if you find a similar post.
$$anonymous$$aybe the problem in your game or in the scene , whyn't to try to upload it to paco games ? and take a look here it may help you: https://forum.unity.com/threads/webgl-player-loads-and-then-nothing-local.327348/ --- & here: https://www.youtube.com/watch?v=$$anonymous$$di-5I8fD$$anonymous$$0 - - Good luck:).
Answer by BRX99_GS · Aug 10, 2020 at 09:37 AM
How To Enable WebGL in Chrome 1-Open a Chrome browser window and go to chrome://settings. 2-Scroll down to Show Advanced settings at the bottom of the page. 3-Scroll to the System section. ... 4-In your Chrome URL bar, go to chrome://flags. Ensure that WebGL is enabled, and not disabled (You'll need to relaunch Chrome for any changes to take effect
https://get.webgl.org/ - open this url in your browser, if you will see a spinning cube your browser supports webgl .
(your browser should be google chrome
Thanks for your reply. I have tried on it, I see the spinning cube. Any other reasons that might cause this issue to happen?
This is a security restriction of the browser itself. While loading content from an actual http / https server is considered relatively "safe", loading content from the local file system implies all sorts of security concerns. First there's no domain name to restrict the access to. So a website loaded from the file system could essentially "scan" though your whole file system. Even when the browser restricts the access to the folder and subfolders of the first loaded html file, direct file access is a huge security concern. That's why you have to actively disable this feature in chrome with a command line parameter, see this article.
If you use FireFox (like I do), there's the option privacy.file_unique_origin
in about:config
which you can set to false which should do the trick. If not there'S also security.fileuri.strict_origin_policy
which can also be disabled. For more information see this and this
In both cases you should be aware of the security risk. Whenever you open an html file locally from your file system, the content in that file has access to other files in your filesystem. So be aware what files you open locally.
try to update your chrome,but if you use firefox look here maybe it will help you - https://www.reddit.com/r/Unity3D/comments/chrazu/solved_firefox_browser_does_not_support_running/
Answer by Getsumi3 · Aug 14, 2020 at 09:00 AM
"It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser."
As you can see the Unity no longer support running a WebGL app from a file (like opening the generated .html in your browser)
You'll need to start a local server that will host your app so you'll be able to access it from a local url (like localhost:port or 127.0.0.1:port)
As mentioned above this has nothing to do with Unity but with the security restrictions of the browser. There are usually ways to circumvent those restrictions but of course hosting it on a server is usually the easiest solution. All this is stated pretty clearly in the error message itself.
It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser
Apart from that if you have a github account you can use github pages to upload your build and directly run it from github. I have several examples on github such as my parallel mandelbrot renderer. a Utah teapot renderer or my expression parser
Thanks for the comments. I will try uploading on GitHub. Hopefully everything runs well.
@Bunny83 I'm wondering, if you change your code from C# to javascript before exporting the game into WebGL?
Your answer
Follow this Question
Related Questions
Unity 4 compatibility to Unity 5 WebGL 1 Answer
Unity 5.6 Webgl Photon Spawn Error 0 Answers
How to make elements added on runtime responsive in a vertical layout group in unity webgl? 0 Answers
Unity5 WebGL gyroscope access 2 Answers
What to use instead of movie texture in Unity 5 webGL? Is there any workaround? 1 Answer