gpt4 book ai didi

c# - DotNetBrowser 的 Browser.GetRemoteDebuggingURL() 返回 string.Empty

转载 作者:行者123 更新时间:2023-11-30 14:48:27 24 4
gpt4 key购买 nike

我使用 DotNetBrowserControl

设置了一个 Winform 应用程序(将来会是 WPF)
BrowserView browserView = new 
WinFormsBrowserView(BrowserFactory.Create(BrowserType.HEAVYWEIGHT));
Controls.Add((Control)m_BrowserView);
string remoteDebuggingUrl = m_BrowserView.Browser.GetRemoteDebuggingURL();

注意 remoteDebuggingUrlstring.Empty

DotNetBrowserVersion/DotNetBrowserChromium - 版本:1.8.3.0.NetFramework: 4.5.2

最佳答案

来自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();

关于c# - DotNetBrowser 的 Browser.GetRemoteDebuggingURL() 返回 string.Empty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41681062/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com