我在我的WPF应用程序中使用geckofx-22。我想检查加载在geckofx控件中的页面的当前url。找不到任何相同的财产。
发布于 2014-01-23 14:07:17
使用下面的WPF代码,并将其放在Geckofx-WPF GeckoWebBrowser.cs中。
/// <summary>
/// Gets the <see cref="Url"/> currently displayed in the web browser.
/// Use the <see cref="Navigate(string)"/> method to change the URL.
/// </summary>
[BrowsableAttribute(false)]
public Uri Url
{
get
{
if (_webNav == null)
return null;
nsIURI locationComObject = _webNav.GetCurrentURIAttribute();
var uri = locationComObject.ToUri();
Xpcom.FreeComObject(ref locationComObject);
return uri ?? new Uri("about:blank");
}
}然后,您可以访问url作为
geckoWebbrowser.Url;发布于 2014-01-22 14:00:19
试试GeckoWebBrowser.Url
GeckoFx使用nsIWebNavigation接口来实现这一点。
https://stackoverflow.com/questions/21263271
复制相似问题