CefSharp.wpf网络浏览器导航事件(C#.Net)

时间:2021-03-04 19:44:42

Is it possible to hook up an event like Navigated with the Webbrowser control (built-in)? I need to perform oAuth in a desktop application and there i need to know if the authentication code has been added to the redirect_uri.

是否可以通过Webbrowser控件(内置)连接导航等事件?我需要在桌面应用程序中执行oAuth,我需要知道验证码是否已添加到redirect_uri。

I was using WebBrowser control that is built in and has the events like Navigating and Navigated but i was facing an issue regarding ieframe.dll/navcancl.htm so i decided to go with CefSharp.wpf ChromiumWebBrowser but I'm not being able to locate any events that can be called when the browser has finished navigating to the URL.

我正在使用内置的WebBrowser控件并且具有导航和导航等事件,但我遇到了关于ieframe.dll / navcancl.htm的问题所以我决定使用CefSharp.wpf ChromiumWebBrowser,但我无法找到浏览器导航到URL后可以调用的任何事件。

This is what i have done in the xaml

这就是我在xaml中所做的

 <wpf:ChromiumWebBrowser Grid.Row="0" Grid.Column="0"
        x:Name="ChromiumBrowser"
        WebBrowser="{Binding WebBrowser, Mode=OneWayToSource}" FrameLoadStart="ChromiumBrowser_OnFrameLoadStart"
        Title="{Binding Title, Mode=TwoWay}" />

and when the user requests to authenticate, I'm setting the address like

当用户请求进行身份验证时,我将地址设置为

ChromiumBrowser.Address = NavigateUrl

1 个解决方案

#1


6  

The ChromiumWebBrowser has a LoadingStateChanged event with LoadingStateChangedArgs, which has an IsLoading property. It also has a FrameLoadEnd event, which is raised when a frame in the page finishes loading.

ChromiumWebBrowser具有带有LoadingStateChangedArgs的LoadingStateChanged事件,该事件具有IsLoading属性。它还有一个FrameLoadEnd事件,当页面中的帧完成加载时会引发该事件。

#1


6  

The ChromiumWebBrowser has a LoadingStateChanged event with LoadingStateChangedArgs, which has an IsLoading property. It also has a FrameLoadEnd event, which is raised when a frame in the page finishes loading.

ChromiumWebBrowser具有带有LoadingStateChangedArgs的LoadingStateChanged事件,该事件具有IsLoading属性。它还有一个FrameLoadEnd事件,当页面中的帧完成加载时会引发该事件。