HTMLViewer: Xojo + JavaScript Communication

If you happen to have the MBS plugins:

in the open event of the htmlviewer you could do:

Me.WKWebViewMBS.developerExtrasEnabled = True

It will add the option “Inspect” to the context menu and you can debug your html (and asset) loading.

OK, back from lunch now.

  1. Checking my code, f is in fact a folderitem for the first of the images contained in the html, or Nil if there are none. Sorry for this mis-information.

  2. The html in question is not a website but the body of an email, so there is no URL. The images are sent separately from the html content, but are still in the same email. The Content-Id: header makes the link between the image and where it is referred to in the html, so I have to replace this on the fly with a URL, which for a local file takes the form I gave upthread.

In the example I posted, it is a static HTML page I use for my apps manual. So I control which protocol is used. It can be https:// in iOS since Apple now requires it, but the principle remains the same.

Reading Tim’s last post, it is apparent he has to do some dynamic code replacement which indeed would not be possible (or simple) with loadURL.

Far as I can tell from testing, CancelLoad doesn’t happen at all with Webkit as a .LoadPage takes place. I do have a handler for that event, which returns if “about:blank” and one or two others, show up.

It looks like I’m using URLPath and it works.

1 Like