WebGL and Custom Messages

While I understand that WebGL should leave a lot of customization up to the user and their HTML, JS, and CSS skills, there is one major issue that I am currently dealing with.

Let’s say that I’m using a WebGL template…

For the most part, the template is perfect for customizing the look and feel of the WebGL page.

But there are a few things which a WebGL Template cannot handle which I would consider very important.

I understand that UnityLoader.js needs to be generated at compile time in order to work correctly, but there are a lot of assumed messages that simply should not be assumed.

For instance, the WebGL warning messages always suggest downloading Firefox. I totally get that Unity WebGL content runs best on Firefox, but I am doing work for a company that has Microsoft as a customer and that message is inappropriate for my project.

For a while now, I’ve been using my own tool which I run after the build takes place.

https://github.com/ahokinson/unity-webgl-message-editor

Initially, it was just supposed to edit the warning messages and, for that, it sufficed. But more recently, I wanted to change the loading status messages in a similar vein.

Trying to replace the content with my own strings has led to the UnityProgress.js placement/styles being ignored.

I would imagine that the primary motivation of the WebGL development team is performance improvements right now, but I feel like adding these options to the player settings is essential.

If there is any way to control aspects of the generated JavaScript or if it could be added, I would be very appreciative and I’ll buy you a beer at the next Unite.

Otherwise, if anyone having this issue would like to collaborate and make a better post-build tool, let me know!

As far as my issue goes though, if anyone is willing to take a look at my UnityLoaders.js and UnityProgress.js files to find a possible reason for the CSS issues, I have uploaded them here.

2949679–218660–UnityLoader.js (37.6 KB)
2949679–218661–UnityProgress.js (3.1 KB)

The issue is with string comparison of the message, so essentially, I’m going to have to create custom messages during Update() in the UnityProgress.js

I still think abstracting these messages out would be very useful.