Issue at Window.Status on Windows Platform

Hi good evening!

I’m getting back javascript variables on Windows, By the Mac side, I get resolved that with EvaluateJavascript’s MBS.

Well for window solution I’m using this that also works in mac:

  1. In a button I use HTMLViewer1.ExecuteJavascript(“Window.status = ‘HELLO WORLD’”)
  2. And bring it back using the “StatusChanged” event of HTMLViewer1, then I do this: SourceCFDi = newStatus
    where SourceCFDI is a global variable.
  3. Then I made a MessageBox: Msgbox SourceCFDI

And it Works flawlessly on Mac, overtime I press the button I get a Messagebox with “HELLO WORLD”

But when I run the program on Mac, doesn’t work. It shows a previous value on SourceCFDI, and when I pressed again for second time It shows “HELLO WORLD”

What Am I doing wrong?

I also tried with TitleChanged event, but I got the same. Works on mac, but I’m getting the same trouble in windows.

I got another value, and when I pressed again I got the right value

There’s issues with timing on Windows using the HTML Viewer / Status hack. Sign on to the feature request for an EvaluateJavaScript, use MBS, or bribe @shao shen to work out the kinks with CEFString on the Windows declare.

I worked out a solution for HTML Edit, but it’s not pretty. If you’re interested, grab a Source License for HTML Edit.

[quote=234506:@Tim Parnell]There’s issues with timing on Windows using the HTML Viewer / Status hack. Sign on to the feature request for an EvaluateJavaScript, use MBS, or bribe @shao shen to work out the kinks with CEFString on the Windows declare.

I worked out a solution for HTML Edit, but it’s not pretty. If you’re interested, grab a Source License for HTML Edit.[/quote]
And how much it cost this?

MBS Win plugin is currently $69
You would need ChromiumBrowserMBS from it for a native Windows solution. I believe Christian said one could get the return value from it, but I don’t see anything on the online documentation for how.

HTML Edit Source is currently $69
The workarounds contained within work well with each other, but mostly because one has access to the source HTML. Some of the solutions will not work if you do not have access to edit the source HTML of whatever you’re viewing.

I mention this because while I will support HTML Edit as a control, I do not offer support for the code with use outside of the control; and offer it merely as an anecdotal learning tool. If @Christian+Schmitz can confirm MBS capability of being able to evaluate the return value of javascript it’s a better solution for your needs than haxxies.

[quote=234515:@Tim Parnell]MBS Win plugin is currently $69
You would need ChromiumBrowserMBS from it for a native Windows solution. I believe Christian said one could get the return value from it, but I don’t see anything on the online documentation for how.

HTML Edit Source is currently $69
The workarounds contained within work well with each other, but mostly because one has access to the source HTML. Some of the solutions will not work if you do not have access to edit the source HTML of whatever you’re viewing.

I mention this because while I will support HTML Edit as a control, I do not offer support for the code with use outside of the control; and offer it merely as an anecdotal learning tool. If @Christian+Schmitz can confirm MBS capability of being able to evaluate the return value of javascript it’s a better solution for your needs than haxxies.[/quote]

If I use ChromiumBrowserMBS is it necessary to get installed Chrome on System first??

It may come bundled, I do not know for sure. It comes bundled if you switch the renderer to WebKit, but I don’t know the licensing restrictions or what Christian’s plugin offers by default. I would wait for him to respond before making the decision of which path to take.

The window.status not working on Windows has been discussed before in this forum. Use the title. It works just fine with the appropriate code.

Also Title don’t work for me, I also tested TitleChanged Event

Test again with a simpler code.

You can also have a look here :
https://forum.xojo.com/22633-get-javascript-variables-back-from-htmlviewer-without-changing-

It works, there’s just an issue with tight knit code and response times on Windows.

I have not tested again. But I would not count on any statuschanged or titlechanged for tight knit loops. In Xojo Web, I have long ago replaced all such code by returning arrays after the loop.

In the HTMLViewer, I would probably try returning a tab separated string. Or several to go around eventual length limitation.

I’m pretty sure I tested lengthy input and output for HTML Edit, but I will double check when I get home to see if I can find a limit.