I need it for a 3rd party lib write in JS because their unity C# SDK use Thread.
I have try with Application.ExternalCall that call their function but no return possible. And what if I add SendMessage in their 3rd party lib which return js functions ?
If you want to embed pure JavaScript into your WebGL application, use the .jspre file extension for it (and not the .js which is already reserved for UnityScript). All the .jspre code is added to the JavaScript build and can be called from a .jslib plugin.
Alternatively you can load the 3rd party JavaScript directly from the index.html (i.e. create your own WebGL template with a added before the %UNITY_WEBGL_LOADER_GLUE%)