Sub Process_Globals
End Sub
Sub Globals
Dim webView1 As WebView
webView1.Initialize("webView1")
Dim webViewExtras1 As WebViewExtras
webViewExtras1.addJavascriptInterface(webView1,"b4a")
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddView(webView1,0,0,100%x,100%y)
webView1.LoadUrl("http://alumnihighschool.net/scriptures/hymns/1.htm")
webViewExtras1.addJavascriptInterface(webView1,"B4A")
End Sub
Sub Activity_Resume
End Sub
Sub webView1_OverrideUrl (Url As String) As Boolean
ProgressDialogShow("Loading...")
End Sub
Sub webView1_PageFinished (Url As String)
ProgressDialogShow("Loading...")
webViewExtras1.executeJavascript(webView1,"B4A.CallSub('processHTML',true, document.documentElement.outerHTML)")
End Sub
Sub processHTML(html As String)
If html.IndexOf("iframe")>-1 Then
Dim a As Int
Dim b As Int
Do While html.IndexOf("iframe") <> -1
a = html.IndexOf("<iframe")
b = html.IndexOf2("</iframe>",a)
html = html.Replace(html.SubString2(a,b+9),"")
Loop
If html.IndexOf("<br><br><br><br>") > -1 Then
a = html.IndexOf("<br><br><br><br>")
b = html.IndexOf2("</body>",a)
html = html.Replace(html.SubString2(a,b),"")
End If
webView1.LoadHtml(html)
End If
ProgressDialogHide
End Sub