Android Question WebViewExtras1 Wait for executeJavascript call to complete

potman100

Active Member
Licensed User
Longtime User
Hi

Is it possible to make a call to WebViewExtras1.executeJavascript and wait for it to complete ?

Thanks

Potman100
 

warwound

Expert
Licensed User
Longtime User
Your javascript could call a JavascriptInterface method once it has completed.
In effect notifying your b4a code it has executed.

Martin.
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Hi warwound

Thanks for you response, but I'm not to sure how I would do that, this is what I have in the PageFiinished sub :

B4X:
Sub WebView1_PageFinished (Url As String)
    Log("Finished")   

    WebViewExtras1.executeJavascript(WebView1,"itemlookup()")
   
End Sub

itemlookup() is a javascript function avaliable on the page, it does an async lookup and updates the page.

Thanks for any help

Regards

Potman
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Hi warwound

I've added and it now seems to work ok.

B4X:
Sub WebView1_PageFinished (Url As String)
    Log("Finished")
Dim Javascript As String
  Javascript="B4A.CallSub('Process_HTML', true, itemlookup())"
  WebViewExtras1.executeJavascript(WebView1, Javascript)
End Sub

Thanks

Potman100
 
Upvote 0
Top