我正在尝试使用DDE在Firefox浏览器中获取当前选项卡的URL,引发以下异常。
消息="客户端未能请求\" Firefox | WWW_GetWindowInfo!URL \"。"
以下是代码。
DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo");
try
{
dde.Connect();
string url = dde.Request("URL", int.MaxValue);
ProcessManagementModel p = new ProcessManagementModel();
p.WindowTitle = WindowTitle;
p.ProcessName = "firefox.exe";
p.BrowserURL = url;
UpdateProcessInfo(p, string.Empty);
}
*仅在Firefox更新到版本52.5.2
后代码才会失败*代码在之前的firefox版本(52.5.0)中运行良好
*我避免使用" AutomationElement "因为它表现得很慢。
如果有人解释为什么会发生异常并让我知道从Firefox获取URL的替代解决方案,那将会很棒。
感谢。