Click here to Skip to main content
15,887,895 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

How to get urls from all tabs of all opened browsers(IE, Chrome, Firefox, Safari, etc.) using c#.

Thanks
Sanjeev
Posted
Updated 4-Dec-12 19:12pm
v3
Comments
TRK3 28-Nov-12 19:29pm    
Are you trying to do this from within the browser?

I sure hope that's impossible.

I wouldn't want some random web-site to have access to the other web-sites I happen to be browsing in other tabs (and other browsers) at the same time.

Why do you want to do this?
Pro Idiot 28-Nov-12 23:05pm    
You can do this by some browser plugin, else as TRK said.. no 1 wants you to do that ;)
Sanjeev Alamuri 28-Nov-12 23:33pm    
It possible by reading processes from task-manager. form the task-manager i was able to read all the processes. but what i want is the browser Title or Browsers Tab URL. IF U know please let me know how to do this.
bbirajdar 5-Dec-12 0:34am    
It is not possible....
Sanjeev Alamuri 5-Dec-12 1:09am    
not possible!!!!. Please let me know y it is not possible.

 
Share this answer
 
Get the URl From Firefox and Opera :

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);

Download NDde dll and add reference, and use as name space

//===========Get URL of All Tabs From IE ======================

    SHDocVw.InternetExplorer browser;
        string myLocalLink;
        mshtml.IHTMLDocument2 myDoc;
        SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
        string filename;
        foreach (SHDocVw.InternetExplorer ie in shellWindows)
        {
            filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
            if ((filename == "iexplore"))
            {
                browser = ie;
                myDoc = browser.Document;
                myLocalLink = myDoc.url;
                MessageBox.Show(myLocalLink);
            }
 
Share this answer
 
v4
Comments
Ankit Priyarup 15-Feb-14 10:12am    
Any way for google chrome ? & how to get url of all tabs
NealBr 20-Nov-23 0:03am    
Does anyone have an update for Microsoft Edge and the latest Chrome? I need to read the tab captions for an Operating Room monitoring app. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900