Sub Class_Globals
Private webView1 As WebView
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(wView As WebView)
webView1 = wView
End Sub
Private Sub runJS (JS As String) As ResumableSub
Return webView1.As(JavaObject).RunMethodJO("getEngine", Null).RunMethod("executeScript", Array(JS))
End Sub
Public Sub getHtml(v As B4XView, ElementId As String)
Wait For (runJS($"document.getElementById('${ElementId}').innerHTML;"$)) Complete(Html As String)
v.Text = Html.SubString2(0,Html.IndexOf("<a href="))
End Sub
Public Sub putHtml(v As B4XView, ElementId As String)
runJS($"document.getElementById('${ElementId}').innerHTML = '${v.Text}';"$)
End Sub