Search code examples
htmlwpfwindowswebbrowser-controlawesomium

Awesomium browser new window not working


I am using Awesomium browser control in my wpf application. It loads website from url but I have a problem. My website have some anchor links with target blank. but when I click on that anchor tag nothing happening and its preventing the action. So my question is Is there any way to detect if anchor tag with target="_blank" clicked. Please give me any advice I have searched on Google but no luck. Thanks in advance.


Solution

  • You have to handle ShowCreatedWebView event:

        webControl.ShowCreatedWebView += OnShowNewView;
    
        internal static void OnShowNewView( object sender, ShowCreatedWebViewEventArgs e )
        {
            // Do sth with your link
        }
    

    It's all described in awesomium docs here

    Btw. If you want to open link in external browser you can use

    System.Diagnostics.Process.Start(your_link);