Hi All,

I'm experimenting with a relatively tricky scenario:

https://stackoverflow.com/questions/41753104/how-do-you-use-webmessageport-as-an-alternative-to-addjavascriptinterface

or its github source:

https://github.com/commonsguy/cw-omnibus/tree/master/WebKit/SensorPort

It works fine with normal html+js pages but I decided to do the same with a 
qt/qml app compiled as webassembly. Seems to work till the point when the 
EM_ASM block gets called where the global (window) onmessage function gets 
registered:

EM_ASM(
  var port;
  onmessage=function(e){
    port=e.port[0]
  }
);

That onmessage gets called from java via webview postWebMessage(...) fine 
but it seems that the parameter that is passed into postWebMessage(...) 
goes through a JSON.parse and what I get in the incoming 'e' event is just 
an:

{isTrusted: true} 

So the function fails with not being able to access property 0 of undefined.

Does anyone know why the event object does not arrive as expected?

Thanks&regards,
r0ller

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/18da617f-7334-4aa4-87a6-01c359f5781cn%40googlegroups.com.

Reply via email to