3

I set up an Winform-Application (in future it will be WPF) with the DotNetBrowserControl

BrowserView browserView = new 
    WinFormsBrowserView(BrowserFactory.Create(BrowserType.HEAVYWEIGHT));
Controls.Add((Control)m_BrowserView);
string remoteDebuggingUrl = m_BrowserView.Browser.GetRemoteDebuggingURL();

notice that remoteDebuggingUrl is string.Empty

DotNetBrowserVersion/DotNetBrowserChromium - Version:1.8.3.0 .NetFramework: 4.5.2

Bassie
  • 9,529
  • 8
  • 68
  • 159
DotNetDev
  • 205
  • 1
  • 10

2 Answers2

5

From the documentation:

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 the BrowserPreferences.SetChromiumSwitches(String...) method before creating any Browser 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:

Sample:

BrowserPreferences.SetChromiumSwitches("--remote-debugging-port=9222");
InitializeComponent();
browserView.Browser.LoadURL("http://www.google.com");
string remoteDebuggingURL = browserView.Browser.GetRemoteDebuggingURL();
Community
  • 1
  • 1
stuartd
  • 70,509
  • 14
  • 132
  • 163
0

thanks stuartd,

this is exactly what needs to be done.

But in fact I gathered out my fault.

BrowserPreferences.SetChromiumSwitches("--remote-debugging-port=9222")

see http://dotnetbrowser-support.teamdev.com/documentation/chromium-switches

here you see, that SetChromiumSwitches takes whether a string, or a string params array

my switch string has been like this "--switchOne --switchTwo", so it's only a string and not an array.

The problem in general is, that it worked like this in earlier days. As I now switched to a string[] it works fine

DotNetDev
  • 205
  • 1
  • 10