Search Unity

Unity WebGL not supported on Google Chrome?

Discussion in 'General Discussion' started by MidgardDev, Mar 3, 2015.

Thread Status:
Not open for further replies.
  1. MidgardDev

    MidgardDev

    Joined:
    Dec 11, 2012
    Posts:
    47
    Hi there, after watching the special event stream, I wanted to give it a try and build a simple project to the WebGL experimental platform.

    My surprise is that a message pops up on Google Chrome saying that it does not support Unity's WebGL opening files with file:// or something like that.

    Is it definitely not supported right now?
     
  2. Neoku

    Neoku

    Joined:
    Oct 27, 2014
    Posts:
    261
    possibly is not Unity, Chrome for security reasons dont allow to load local files.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    WebGL is supported on Chrome. Opening local files is not supported in the webplayer due to security reasons; I expect the same for WebGL.

    --Eric
     
  4. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Chrome does not support WebGL content from file:// urls - Use Build & Run, or upload it to a server - or use Firefox.
     
    evanwr9, Kjaka and SweatyChair like this.
  5. Thjellesen

    Thjellesen

    Joined:
    Oct 7, 2014
    Posts:
    23
    Try the google flag, add --allow-file-access-from-files after the chrome.exe like "chrome.exe --allow-file-access-from-files"
     
  6. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
  7. MidgardDev

    MidgardDev

    Joined:
    Dec 11, 2012
    Posts:
    47
    But that's not a nice solution in user-experience..
     
  8. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Users are supposed use the project from a website and not from local disk
     
    angrypenguin likes this.
  9. Deleted User

    Deleted User

    Guest

    I recommend installing a webserver like wamp. After the setup is done you just have to place all files in the 'www' directory and put your server online. Also, make sure WebGL is enabled by default in Chrome. This can be done in chrome://flags.
     
  10. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Really, the easiest solution is to use Build & Run. It will start a little local web server for you transparently, and load the page through that.
     
    jphollanti and AndrewGrayGames like this.
  11. MidgardDev

    MidgardDev

    Joined:
    Dec 11, 2012
    Posts:
    47
    Oh that's actually pretty nice, why didn't you say that before! Haha!

    Then it's just brilliant, thanks for the info sir!
     
  12. Woodlauncher

    Woodlauncher

    Joined:
    Nov 23, 2012
    Posts:
    173
    :)
     
    angrypenguin likes this.
  13. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    I'm having this problem in Safari, not on my machine, but on another that doesn't have Unity installed. Since the last WebGL update, running from our server no longer works. While I'm trying to figure that out, I sent out a WebGL folder to someone to run locally so they could review it. They have JS and WebGL enabled in Safari So why does it run locally on my machine? Works fine whether I do a build and run or just open the index file in Safari.
     
  14. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Different version of Safari?
     
  15. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    If your user is to be loading from a local drive give them a stand alone ;)
     
    AndrewGrayGames and Ryiah like this.
  16. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    OS 10.10.5 on my machine where it runs in Safari 9.0, OS 10.11.x on the machine it doesn't run on with, I believe, Safari 9.0.1.

    Are you saying some versions of Safari don't support running locally?
     
  17. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Don't know, but that may be the case.
     
  18. raskar

    raskar

    Joined:
    Jul 12, 2017
    Posts:
    2
    Hello
    I got the same prob. while using WebGL,
    so I am using the same build & run, but this time I didn't get error but its still showing in gray color plz help me
     
  19. Deleted User

    Deleted User

    Guest

    No, Unity WebGL isn't supported on Chrome. You may use internet explorer (the nice old browser supports it)
     
  20. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It was supported two years ago when the post you're replying to was written, and it's certainly supported now.

    Internet Explorer does not support WebGL. Edge does, though. https://docs.unity3d.com/Manual/webgl-browsercompatibility.html

    --Eric
     
  21. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    That would be webplayer, which Unity no longer supports.
     
    PNUMIA-Rob and angrypenguin like this.
Thread Status:
Not open for further replies.