Why assets loading does not complete in Safari?

My html5 app loads all the assets fine in Chrome & the app gets started normally, however, it will stuck at Safari at the end of bar as seen here:

There is not errors in the console & all loaded files at Network have status 200.
I am on openFL 4.7, how would I know which file that does not load? and works in Chrome but not in Safari I see this problem?

Perhaps it is a problem with detecting that fonts were loaded?

How can I know? if so, how can I fix it?

Where is the code that decides all assets got loaded?

It’s in Lime.

Top-level asset library loader:

Loader inside asset library (most projects has only one asset library):

loadXXX() methods inside AssetLibrary used to load each individual asset.

Font loader:

About Safari: it looks like that Safari supports font loading events, but actually not. It reports that font is loaded when font isn’t actually loaded, so for Safari we use old-school font loader. I see that vizanto fixed it for system fonts (like Arial), so now it should work correctly for any font.

Maybe something wrong with font name (for example it contains "'" character)? Try to put trace(name) here: https://github.com/openfl/lime/blob/develop/lime/text/Font.hx#L493

1 Like

Thanks for detailed answer, I have found the font that failed to load ini Safari, it was StrVar.ttf I have removed it from project, and now its loading fine in Safari :slight_smile:

Sorry for the trouble, I should add a verbose mode for the asset loading so this is easier to debug

I just added it:

Using openfl test html5 -v will now print verbose console messages to help give better information about what has loaded, and what has not, so we won’t be so confused if this occurs in the future :smile:

1 Like

that’s very useful, great