WebGL 5.6: sendMessage is not defined

I have update an game to Unity 5.6 for build to WebGL, i noticed that the default WebGL template has been modify, now I have an problem, the ‘sendMessage’ function that I use to communicate from the javascript web embed to the game is not defined this work correctly in previous version, I was searching for any change about it on Unity 5.6 but the documentation not have changes, anyone has the same problem?
is this an change of API or an error in this version?

EDIT: just right after the next search try I found the solution, the problem was with the
new unity WebGL embedding API now use instantation:

 var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGL.json", {onProgress: UnityProgress});

so now for communicate use:

gameInstance.SendMessage("myObject", "myFunction", "foobar");

Hope this help someone with this problem.

Ohh, that’s brilliant! I run into the same problem. Thanks for posting the solution!

@Briner
Hello there,

I’ve recently purchased your WebGL package from you and it does not work for my build. After making a build with it, it still uses the default Unity settings.
I put my build on the Wordpress site. Not sure if it did not work because of Wordpress. Can you please help me with it?
Sorry to post here because for some reasons, the system does not allow me to start a conversation with you.

Thank you.