This is the entire content of my CancelLoad event handler, if it helps:
// Called when the content of the HTMLViewer is about to be replaced. If this is due to loading
// an html string into the control, then it seems the URL will be "about:blank". If it happens
// due to the user clicking on a link in the HTMLViewer, we want to show that one. Any links in
// the control will either have no "target" attribute, or it will have been be changed to "_self".
// This will force all clicked links to trigger this event, which then uses GotoURL() to display
// the linked page in the user's browser, rather than here.
//
// Under Win7 the page loaded from code goes via a temporary file. When an external link is
// clicked, the URL has the normal form, but also another event occurs with the "about:blank" URL.
//
// For macOS, mailto: is handled by an AppleEvent triggered by the GotoURL. For Win/Lin, it is
// handled via the mailtoWSserver, so nothing should be done here.
if (URL="about:blank" or URL.BeginsWith("file://")=True or URL.BeginsWith("c:\Users\")=True) then Return False
#if (TargetMacOS=False) then
if (URL.BeginsWith("mailto:")=True) then Return True // The HTMLViewer should ignore this request
#EndIf
system.GotoURL (URL)
Return True
It works for me if you put the “System.” in front of it, but the documentation doesn’t indicate that the “system.” is required at all. (edit: darn, Alberto beat me to it)
65204 - System doesn’t have a method GoToURL in docs
Steps: The attached screenshot shows the docs for system. When using ShowURL I’m told that System.GoToURL is the replacement. But the method is missing from the docs.
Nothing , just saw it deprecated and I said that I should replace it with the new one to avoid the headache of adapting it later, but I guess it was to early . I’m still using ShowURL for now
I suppose nothing change except that we need to add System. before the instruction. For Beep → System.Beep , Xojo kept Beep because it is to much common (I guess).