Xojo and html viewer communication question

I have a project idea that i want to implement with xojo but i don’t know if it is possible.
What i want to do is this: load an html with web viewer, run some javascript libraries (that are already implemented), and get the results.
So far i know that i can load the html and run javascript in htmlviewer and get those result in htmlviewer , i already written that code. What i don’t know if it’s possible (i did some reasearch and didn’t find anything) is if i can load some variables from xojo to javascript (running in the htmlviewer) directly in real time and get results from the javascript calculations. Essentially what i’m asking, is there any communication between the code in html viewer and xojo with inputs and outputs, or do i have to use xojo and javascript to read and write on a file somewere, maybe a json?

Thank you in advance for any guidence.

You can use the TitleChanged event in the HTMLViewer and thus pick up data on the Xojo side.

I was hoping for a more direct approach. Using htmlviewer as a method. Send multiple variables in get data out.
Thank you for taking the time to answer.

You can use JSON to create a string holding multiple values, and then pass this string to https://documentation.xojo.com/api/deprecated/htmlviewer.html#htmlviewer-executejavascript and then have your javascript pass the results back in the titleChanged event (also in JSON format).

Other options: