I found @stevel05 has made a wrapper which makes it easier to handle webengine.
As for adding event, if we use code from this thread, I figured this out to add event:
B4X:
Sub addClickEvent
Dim we As JavaObject
we = asJO(WebView1).RunMethod("getEngine",Null)
Dim jsobject As JavaObject 'netscape.javascript.JSObject
jsobject=we.RunMethod("executeScript",Array As String($"document.getElementById("p1")"$))
Dim jscode As String=$"addEventListener("click", function()
{
b4j.link('test');
});"$
jsobject.RunMethod("eval",Array As String(jscode))
End Sub