Unityloader.js reference?

The whole loading script part of webgl seems a bit hidden away and not easily modified, though maybe I am just missing some documentation - is it documented in detail somewhere?

UnityLoader.js is a large script with the unity logo embedded as a base64 image so if you understand js and base64 you can change the loading icon (& progress bar) but it could be made easier to do so - could it not be some editor-side option?
Also while mobile support is clearly still sketchy, the fact it draws such a poor and tiny OK dialogue is not great so you then need to find and edit that part of the js to make a better impression!
Then the exception message might wanna be changed too…

Will this part become more easily configurable in future?

Edit: You can save around 90kb just by removing the brotli compression code in the js file so the editor could at least check your export compression format and save space

1 Like

Wish also it would be an Editor option, and if only for Plus/Pro members, so be it.

loading screen and progress bug is customized - see doc https://docs.unity3d.com/560/Documentation/Manual/webgl-templates.html
you don’t ever need to change unityloader.js to change this
also you can add hooks to Module (use search) like preInit and runtimeInitialized for more-custom-logic

1 Like

ok, it isn’t ideal as the js keeps unity’s default progress and bar and logo embedded with base64 but at least you can replace the images with js I see. Changing the messages it shows does mean editing the loader

which message?
you can replace some functions compatibilitycheck() and onProgress - the same way - by override

gameInstance = UnityLoader.instantiate(
                            document.getElementById("gameContainer"),
                            "%UNITY_WEBGL_BUILD_URL%",
                            { // override
                                onProgress: onProgressCoeffForUnity,
compatibilityCheck: myCompatibilityCheck,
                                Module: {
                                    preInit: [onUnityStartInitializing],
                                    onRuntimeInitialized: onUnityInitialized,
                                }
                            }
                            );
1 Like