P Pendrush Well-Known Member Licensed User Longtime User Jan 22, 2018 #1 How can I get current URL from WKWebView with NativeObject as isn't possible to get current URL from PageFinished (described here)?
How can I get current URL from WKWebView with NativeObject as isn't possible to get current URL from PageFinished (described here)?
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2018 #2 Finished is only called once in that example. Upvote 0
P Pendrush Well-Known Member Licensed User Longtime User Jan 22, 2018 #3 I have some situation where PageFinished is called multiple times, also I need current URL for share button. Upvote 0
I have some situation where PageFinished is called multiple times, also I need current URL for share button.
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2018 #4 Pendrush said: I have some situation where PageFinished is called multiple times Click to expand... It probably happens due to redirections. Code to get current url: B4X: Sub Page1_Click WKWebView1.EvaluateJavaScript("", $" window.location.href "$) Wait For WKWebView1_JSComplete (Success As Boolean, Tag As Object, Result As String) If Success Then Log("Current page: " & Result) End If End Sub Upvote 0
Pendrush said: I have some situation where PageFinished is called multiple times Click to expand... It probably happens due to redirections. Code to get current url: B4X: Sub Page1_Click WKWebView1.EvaluateJavaScript("", $" window.location.href "$) Wait For WKWebView1_JSComplete (Success As Boolean, Tag As Object, Result As String) If Success Then Log("Current page: " & Result) End If End Sub