Unity: Unity 2019.4.5f1
Device A: Macbook Pro; Mac OS Big Sur Preview
Device B: iPhoneX; iOS 14 beta
Browser: Safari
Forgive the snippet here, but this is from the generated UnityLoader.js that the webgl build produces in Unity. This is approximately line 3, col 31,796. The line in question is:
case"Mac OS X":p=/Mac OS X (10[\.\_\d]+)/.exec(i)[1];
The navigator.appVersion (which seems to be the string this is parsing out) yields something along the lines of
5.0 (Macintosh; Intel Mac OS X 11_0)
As such, the assumption that it starts with a ‘10’ is wrong, and there is no index 1 in the result of the regex, it throws an exception, and unity fails to load.
I have hacked around this, without fully understanding the context or intent of this code snippet, by ignoring the generated UnityLoader.js, using my own fork, and just replacing it with this obviously wrong but non exception throwing code:
case"Mac OS X":p=function(){let x = /Mac OS X (10[\.\_\d]+)/.exec(i); return x ? x[1] : "10_15_6"}();
I think this is a bug. But also, if this is somehow my fault and I should tune some build paramter somewhere, please tell me as such