Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[bug] WebGL loader is broken on macOS 11 Big Sur

Discussion in 'WebGL' started by aromana, Nov 23, 2020.

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

    aromana

    Joined:
    Nov 11, 2018
    Posts:
    137
    The issue is that the WebGL loader does some device user agent checks, and those checks don't break now that macOS has had a major version bump from 10 to 11.

    Specifically, line 174 of WebGL.loader.js breaks:
    Code (JavaScript):
    1. switch (os) {
    2.     case "Mac OS X":
    3.       osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
    4.       break;
    5. <snip>
    This causes an Uncaught TypeError when attempting to load any game on macOS, since this regex will not return any matches. This completely breaks the loader and prevents any game from loading. A workaround is of course to spoof the user agent.

    Here is what a typical macOS Big Sur user agent looks like:

    Code (JavaScript):
    1. "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36"
    As you can see, the solution here is to have the regex match capture the full version string (e.g. 11_0_1, 10_12_3), not only the part after 10_.

    I am building using the latest version of 2020 (2020.1.14f1).
     
    jbertra and elhongo like this.
  2. jbertra

    jbertra

    Joined:
    Nov 5, 2014
    Posts:
    6
    I'm having the same issue, did you file a bug report?
     
  3. qmangel

    qmangel

    Joined:
    Jan 29, 2020
    Posts:
    1
    Same issue here.
     
  4. adam_mehman

    adam_mehman

    Joined:
    Dec 11, 2014
    Posts:
    104
    Same problem here, my game is not loading in BigSur Chrome browser. Everything is fine in Safari.
     
  5. xslima

    xslima

    Joined:
    Nov 25, 2020
    Posts:
    1
    Does anyone have solved this problem already?
     
    ina likes this.
  6. lightmapper

    lightmapper

    Joined:
    Jan 14, 2015
    Posts:
    27
  7. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    944
    It looks like what was a pre-release Safari issue (that then wasn't a Safari issue when macOS Big Sur actually released), now raised its head on Chrome. See this stickied thread https://forum.unity.com/threads/bug...ort-for-chrome-edge-on-macos-big-sur.1048310/ for more information and ways to remedy.

    Since we have a few threads opened about this, let's consolidate conversation to that "official" sticky thread, and I'll go ahead and close this one. Thanks for reporting, and sorry for the trouble!
     
Thread Status:
Not open for further replies.