HTMLViewer link to open system browser

Anyone have an idea how to do this?
I want to display information pages to users of a Windows, Linux or OSX program using HTMLViewer.
But when they click a link in it I need it to open the system browser to go to that link.

Thanks.

http://documentation.xojo.com/index.php/HTMLViewer.CancelLoad
http://documentation.xojo.com/index.php/Showurl

Awesome. Thanks.
I am assuming when they click the link CancelLoad fires and I will get an opportunity to ShowURL in the system browser. Great!

Just tried it. CancelLoad fires when the HTMLViewer is loading. I need the page to display in HTMLViewer but when the user clicks a link within it an event fires so that I can redirect to the system browser for that URL.

CancelLoad fires loading any page (and other stuff apparently). So you’ll need to filter out the ones that are loading your page and ShowURL for others.

For example, say you want to show the yahoo homepage…

Sub Action() HTMLViewer1.LoadURL("http://www.yahoo.com/") End Sub

Then in CancelLoad you want to skip over that url and any urls that show up as part of loading that page (which for me includes a few ‘yimg’ urls).

[code]Function CancelLoad(URL as String) As Boolean

dim yimg As String = “https://s.yimg.com/

if url = “http://www.yahoo.com/” or url.Left(yimg.Len) = yimg then
return false
else
ShowURL(url)
return true
end

End Function[/code]

Personally, links that I want to show in external web browser, I use a ext:// header instead of http://.

if nthfield( url, ":", 1 ) = "ext" then ShowURL( replace( url, "ext://", "http://") ) return true