Hi All,
I have a app that generates a web page locally.
I have Links inside this which I need too trigger events.
Can I find when a link has been pressed.
I have tested LocationChanged but no luck.
I just need to put in my own value in the href= area.
Then get this value
i.e.
LocationChanged should be raised. Though it is not so easy to work with this event as you cannot cancel it. You need to reload the original url each time.
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private wv As WebView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
wv.Initialize("wv")
MainForm.RootPane.AddNode(wv, 10, 10, 300, 300)
wv.LoadHtml($"<a href="http://www.example.com">link</a>"$)
End Sub
Sub wv_LocationChanged (Location As String)
Log(Location)
wv.LoadHtml($"<a href="http://www.example.com">link</a>"$)
End Sub
The only difference with mine in that I have created the string then pass
That string to the loadhtml
What is the $ top and tail of the string.
I am still a newbie.
It is not easy to work with this event as you need to reload the page. There is no simple way to get the current position. You will need to inject JavaScript for that.