# HTMLViewer StatusChanged not being called

**URL:** <https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113>\
**Category:** General\
**Created:** [April 10, 2017, 8:21am UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113 "2017-04-10T08:21:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Chamberlain](https://forum.xojo.com/user_avatar/forum.xojo.com/tony_chamberlain/32/1242_2.png) [@Tony\_Chamberlain](https://forum.xojo.com/u/Tony_Chamberlain)\
**Post date:** [April 10, 2017, 8:21am UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/1 "2017-04-10T08:21:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [April 10, 2017, 8:28am UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/2 "2017-04-10T08:28:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [April 10, 2017, 8:31am UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/3 "2017-04-10T08:31:47Z")

</div>

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

The common solution is to use TitleChanged instead.

---

<div class="post-metadata">

**Author:** ![Tony\_Chamberlain](https://forum.xojo.com/user_avatar/forum.xojo.com/tony_chamberlain/32/1242_2.png) [@Tony\_Chamberlain](https://forum.xojo.com/u/Tony_Chamberlain)\
**Post date:** [April 10, 2017, 3:32pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/4 "2017-04-10T15:32:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [April 10, 2017, 3:35pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/5 "2017-04-10T15:35:45Z")

</div>

> [@325479:@Tony Chamberlain](#):
>
> I have feeling doumentcomplete is the way I have to go, I am dowinloading 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)

---

<div class="post-metadata">

**Author:** ![Tony\_Chamberlain](https://forum.xojo.com/user_avatar/forum.xojo.com/tony_chamberlain/32/1242_2.png) [@Tony\_Chamberlain](https://forum.xojo.com/u/Tony_Chamberlain)\
**Post date:** [April 10, 2017, 3:50pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/6 "2017-04-10T15:50:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [April 10, 2017, 5:10pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/7 "2017-04-10T17:10:15Z")

</div>

TitleChanged :  
[https://forum.xojo.com/22173-getting-correct-url-for-htmlviewer/0](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](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.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [April 11, 2017, 1:13am UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/8 "2017-04-11T01:13:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TimStreater](https://forum.xojo.com/user_avatar/forum.xojo.com/timstreater/32/586_2.png) [@TimStreater](https://forum.xojo.com/u/TimStreater)\
**Post date:** [April 9, 2018, 3:27pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/9 "2018-04-09T15:27:30Z")

</div>

[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).

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:43pm UTC](https://forum.xojo.com/t/htmlviewer-statuschanged-not-being-called/37113/10 "2020-10-29T18:43:29Z")

</div>


