iOS Question Webview ignores links with target="_blank"

Martin Larsen

Active Member
Licensed User
In B4A, a link which in a normal browser opens in a new tab, just opens in the same webview. In other words, it ignores the target="_blank" attribute.

In B4i, the webview instead ignores the link completely. It doesn't open.

Right now my fix is:
Private Sub wv_PageFinished (Success As Boolean, Url As String)
  Dim js as String = $"document.querySelectorAll("a[target='_blank']").forEach(a =>"_self")"$
End Sub
But that is really not elegant.

The problem is addressed here but I don't know how to convert it to B4i.

Any ideas?