I have already been here:
- C# get URL from firefox but don't use DDE
- How can I get URLs of open pages from Chrome and Firefox?
- C# - Get all open browsing tabs in all instances of firefox
- https://social.msdn.microsoft.com/Forums/vstudio/en-US/93001bf5-440b-4a3a-ad6c-478a4f618e32/how-can-i-get-urls-of-open-pages-from-chrome-and-firefox?forum=csharpgeneral
- Get Firefox URL?
I know there are lots of questions already out there about this topic, BUT none of them answers it correctly. I am curious how to get the URL of all open pages in firefox, but i dont find a solution that provides working code.
This is the most rewarded solution on the internet, but it does not work for me. This code uses DDE (which used NDDE - a good DDE wrapper for .NET):
private string GetBrowserURL(string browser)
{
try
{
DdeClient dde = new DdeClient(browser, "WWW_GetWindowInfo");
dde.Connect();
string url = dde.Request("URL", int.MaxValue);
string[] text = url.Split(new string[] { "\",\"" }, StringSplitOptions.RemoveEmptyEntries);
dde.Disconnect();
return text[0].Substring(1);
}
catch
{
return null;
}
}
I dont care about if it shows the history, gets the URLs of open pages in a second Firefox window, i want to keep it simple by now. Please dont provide me code for another browser as it is always browser specific or any VB code.