Can javascript reach "out" of HTMLViewer?

I’m tinkering with some ideas for an interactive HMI/UI, and using HTMLViewer, HTML5, and javascript. HTML5 works fine, allowing me to create numerous graphical elements - in my particular example I’m using the HTML5 document to show actively flowing piping, valve positions, and other indicators in a factory control system.

So far I’m having good luck programmatically writing “into” the HTML5 running in HTMLViewer (sample code below, showing a simple request to start a timeline in the document), triggering associated actions w/in the HTML5 doc.

Now I want to find a way for the HTML5 elements to ‘send’ data back thru the HTMLViewer for taking action on. For instance, someone ‘presses’ a value graphic to actuate it, in turn the HTML5 element sends a javascript action (that I hope to intercept with HTMLViewer).

Suggestions are appreciated. Thanks!

Sample of working method of sending commands ‘into’ the HTML5 document:

Dim jsSrc As String jsSrc = "HYPE.documents['theControl'].startTimelineNamed('Main Timeline');" HTMLViewer1.ExecuteJavaScript(jsSrc)

Dim jsSrc As String jsSrc = "HYPE.documents['theControl'].pauseTimelineNamed('Main Timeline');" HTMLViewer1.ExecuteJavaScript(jsSrc)

You can send back data through title (works for Mac and Windows), or status (Mac).

Then use the TitleChanged and StatusChanged events.

Michel, you always have great advice! I’ll give that a go.

Mac? Win? Linux?
MBS Plugins offer a couple of extensions including javascript callbacks.

When using Title, there is a character limit, so you’ll want to use a loop in the JavaScript to change the title in chunks, with some way to tell the watcher that the data is done.

While it doesn’t help send more data, you can also use window.location with the CancelLoad event.

I could use CancelLoad on iOS and eventually Android.

Join the club. The original control in the iOS framework provides all sorts of events that Xojo neglected to implement. I hope they don’t do the same sloppy job for Android…