Up to Chrome V27 you could enumerate Chrome child window controls to get to the edit field and read the string value from there to get the current opened URL.
Unfortunately Chrome 28 has switched to the new rendering Engine (Blink) and does not use Windows controls anymore besides the main window (Chrome_WidgetWin_1) and the web page tab (Chrome_RenderWidgetHostHWND).
I would be grateful if someone could point to an alternative method of getting the currently opened Chrome URL from another (Win32) application.
code.google.com/chrome/extensions/tabs.html#method-getSelected The docs state the first parameter is the windowId, if you want to use that in options, or background page, you would need to put in the window id or you will get the current tab your viewing which is undefined, options respectively.
The Chrome Management API is a suite of services that allows administrators to programmatically view, manage, and get insights about policies and usage of ChromeOS devices and Chrome browsers in their organization.
Chrome supports the Windows accessibility APIs, so you can use those to extract information both from the chrome - including the broswer bar - and also from web pages. Think of this API as a more abstract version of enumerating window controls.
Check out the Inspect Objects tool to explore what information you can get access to - it does look as though the address bar and contents are available.
You can get the same information in C# using the AutomationElement set of classes:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With