jchv / go-webview2

WebView2 bindings for pure Go, without CGo, based on the webview/webview bindings.
Other
264 stars 64 forks source link

Capture Navigation Events #50

Open bhaswanth88 opened 2 years ago

bhaswanth88 commented 2 years ago

Hi, I am trying to find a way to capture navigation events used in windows webview2 (link). I couldnt find any in the WebView interface, but found some events are implemented in edge package inside Chromium struct

    envCompleted          *iCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler
    controllerCompleted   *iCoreWebView2CreateCoreWebView2ControllerCompletedHandler
    webMessageReceived    *iCoreWebView2WebMessageReceivedEventHandler
    permissionRequested   *iCoreWebView2PermissionRequestedEventHandler
    webResourceRequested  *iCoreWebView2WebResourceRequestedEventHandler
    acceleratorKeyPressed *ICoreWebView2AcceleratorKeyPressedEventHandler
    navigationCompleted   *ICoreWebView2NavigationCompletedEventHandler

Is there any way to add a handler for SourceChanged event of webview2 ?

jchv commented 2 years ago

There currently is not. Some of this will be added in #53 it seems.

kityun commented 1 year ago

chromium.EnvironmentCompleted How to use?