Our game crashes during the loading process, and throws out the error coming from the loader script: exception thrown: TypeError: canvas.getContextSafariWebGL2Fixed is not a function,TypeError: canvas.getContextSafariWebGL2Fixed is not a function
We have been trying to update our game from unity 2018 to unity 2021.3 lts release, so I would assume it is an issue related to updating. I haven’t been able to find any instances of this error showing up for anyone else though and am not sure where to go from here any help is valuable.
I think bugfinders thought is that if you use a custom / 3rd party webgl template you may need to update the JS side for 2021.3.
For WebGL I’d recommend to try the latest LTS, if not tech stream, since there have been many tech updates behind the scenes and in particular for mobile devices (even though mobile WebGL still remains unsupported).
If that Safari was due to OS X be sure to test with all common desktop browsers for each supported desktop platform. Safari is known to pose unique challenges for WebGL developers.
We have updated our template below is a copy with some naming information removed. Also I am on windows and testing in both Firefox and chrome. Which is why I’m especially puzzled that it is throwing an error about safari
You mean you are testing on Windows with FF/Chrome but you get the Safari error message? That’s odd.
At this point I would try building with the default template just to see that this works.
If it does, I would try and re-implement any custom scripting changes to the default template. Just the scripts, no layout/CSS stuff.
If that works too, you can move the JS code back to your custom template to see if that also works. Assuming that all JS code in your custom template now has been replaced with the working JS code from the default template, the custom template should work again. Hopefully.
I’m guessing there may be some JS code or parameter changes that aren’t in your custom template, and it may be something that’s not easy to spot.