HTMLViewer StatusChanged not being called

I’m not sure what is going on, it works fine on my Mac tests and it worked fine on Windows with the older 2016 R builds, but my HTMLViewer will not call StatusChanged on Windows 10 using Webkit

I can load URLs , refresh URLS etc, but the StatusChanged even never fires on my Windows 10 environment, I need to use WebKit for what I am trying to do. Native doesn’t execute the JavaScript like i need.

Any idea why this may be?

For security reasons, WebKit doesn’t call it any more from Javascript.
See older threads about this topic.

See several thread already about that issue in Webkit under Windows.

The common solution is to use TitleChanged instead.

Thanks, I searched before I posted must not have typed in the magic combination of words for the “forum” search.

So if I use title changed how do I get the contents of the htmlviewer now, I use to get the newStatus as a string to display it in a textbox, but if I use titlechanged or documentcomplete what is the preferred way of reading the html contents.

I have feeling doumentcomplete is the way I have to go, I am downloading a text file with no html markup, ie no header for title.

Why are you doing that with a HTML Viewer? Use a HTTPSocket if you’re trying to download a file and get its contents, HTML Viewer is for displaying HTML markup.

Anyway, to answer your question, DocumentComplete does not give you the contents of the loaded page. TitleChanged is how we can pass data out of the HTML Viewer, but remember - it’s a hack and there are aspects you need to account for (new lines, 4kb limit)

Thanks Tim, yeah the 4kb will make me hit a wall for larger files, originally it was to display contents in an html viewer and the regex out the needed strings for a text box, but I agree changing it to using HTTPSocket in this case make more sense. Too bad we lost this feature with the new webkit.

TitleChanged :
https://forum.xojo.com/22173-getting-correct-url-for-htmlviewer/0

There is also a way to use CancelLoad described here :
https://forum.xojo.com/22633-get-javascript-variables-back-from-htmlviewer-without-changing-/0

HTTPSocket is a technique to consider, if you want to download a file. You can also combine both, and use CancelLoad to know when to pass work to the HTTPSocket.

I second using httpsocket for file download. I would recommend that you use the one from the new framework if you’ve not used it before.

[quote=325419:@Christian Schmitz]For security reasons, WebKit doesn’t call it any more from Javascript.
See older threads about this topic.[/quote]
Can anyone give me one good reason why the documentation doesn’t reflect this? I just spent half a day re-discovering all this for myself.

I need to get the HTML back from the HTMLViewer so I guess I’ll have to change to use .title for the time being (on Windows, at least).