Just looking at your code.  Not sure why logging isn't working for you, but
this code which instantiates your socket, may be problematic:

internalBrowser.execute("const socket = io('"+server_url+"')");

There is no guarantee that the Javascript expression executed in
BrowserComponent.execute() is run in the global context.  It may be run
inside the context of an anonymous function, so your "socket" variable
won't be accessible from anywhere else.

I would change it to

internalBrowser.execute("window.socket = io('"+server_url+"')");

Steve


On Fri, Apr 6, 2018 at 9:29 PM, Shai Almog <shai.al...@gmail.com> wrote:

> Steve is better at these things so I'll leave it to him. I do agree that
> debugging JS <-> Java is a pain in the neck. We made several attempts at
> simplifying it but mostly focusing around debugging on the simulator.
>
> Is it possible that this is failing due to same origin?
> I doubt that's the case if you opened the connection already but maybe
> injected code impacts this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to codenameone-discussions+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/
> group/codenameone-discussions.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/codenameone-discussions/b06c16a5-342f-4ee8-8751-
> 1a97a66c56ff%40googlegroups.com
> <https://groups.google.com/d/msgid/codenameone-discussions/b06c16a5-342f-4ee8-8751-1a97a66c56ff%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKUeMRTpZYNyAic4crTTc%2BB1hpTMWweSPADTZMWqSRP1BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to