DotNetBrowser provides functionality that allows you to use the Chrome Developer Tools remote debugging feature. To enable this feature you must define the remote-debugging-port Chromium switch by calling theBrowserPreferences.SetChromiumSwitches(String...) method before creating anyBrowser instance.


Once you configured DotNetBrowser to use a specified remote debugging port, you can get a remote DevTools URL by calling the Browser.GetRemoteDebuggingURL()method:


BrowserPreferences.SetChromiumSwitches("--remote-debugging-port=9222");
InitializeComponent();
browserView.Browser.LoadURL("http://www.google.com");
string remoteDebuggingURL = browserView.Browser.GetRemoteDebuggingURL();


The obtained remoteDebuggingURLcan be loaded in Google Chrome 31 and higher, or in any other DotNetBrowser Browser instance to open Chrome Developer Tools page that allows inspecting HTML, debugging JavaScript etc. 


Process.Start("chrome.exe", browserView.Browser.GetRemoteDebuggingURL());


For example, in the source code above if you navigate to theremoteDebuggingURL in Google Chrome, you will see Chrome Developer Tools Inspector that you could use to debug the loaded http://www.google.com web page.


Do not open the remote debugging URL in other web browser applications such as Mozilla FireFox, MS IE, etc.  This will lead to a native crash in Chromium DevTools web server. The remote debugging feature is compatible with Chromium 31 and higher.


Example

MainWindow.xaml

<Window x:Class="WPFRemoteDebugging.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpf="clr-namespace:DotNetBrowser.WPF;assembly=DotNetBrowser"
        Title="MainWindow" Height="350" Width="525">
    <Grid Name="mainLayout">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <wpf:WPFBrowserView Grid.Column ="0" Name="browserView1" URL="http://www.google.com" FinishLoadingFrameEvent="browserView_FinishLoadingFrameEvent"/>
        <wpf:WPFBrowserView Grid.Column ="1" Name="browserView2" />
    </Grid>
</Window>

MainWindow.xaml.cs

using System;
using System.Windows;
using System.Windows.Controls;
using DotNetBrowser;
using DotNetBrowser.WPF;

namespace WPFRemoteDebugging
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            BrowserPreferences.SetChromiumSwitches("--remote-debugging-port=9222");
            InitializeComponent();
        }

        private void browserView_FinishLoadingFrameEvent(object sender, DotNetBrowser.Events.FinishLoadingEventArgs e)
        {
            if (e.IsMainFrame) {
                browserView2.Browser.LoadURL(browserView1.Browser.GetRemoteDebuggingURL());
            }
        }
    }
}