Unique ID for each Tabs in Chrome Browser

1,229 views
Skip to first unread message

Rajesh v.r

unread,
Jul 16, 2013, 1:24:52 AM7/16/13
to chromium-ac...@chromium.org
I wish to differentiate each Tabs present in Chrome Browser using MSAA (Microsoft Active Accessibility), how can I do this?
Is there any "Unique ID" for each Tabs present in Chrome Browser?

Thanks,
Rajesh

Dominic Mazzoni

unread,
Jul 16, 2013, 1:42:43 AM7/16/13
to Rajesh v.r, Chromium Accessibility
Hi Rajesh,

First, note that Chromium doesn't expose a full MSAA tree by default, because unfortunately it slows things down a bit. Add the --force-renderer-accessibility command-line flag, or open chrome://accessibility to enable it first, then it will work.

The MSAA tree for a window only contains the contents of the visible tab. Tabs that aren't currently visible won't be in the MSAA tree either.

When the user switches tabs, you can tell by the name of the document - isn't that good enough?

If you want an unique ID, it is available, but you'll have to use the IAccessible2 interface.

- Dominic

Rajesh v.r

unread,
Jul 16, 2013, 3:29:27 AM7/16/13
to chromium-ac...@chromium.org, Rajesh v.r
Thanks Dominic for your valuable response.

How can I use the "IAccessible2" for getting the unique ID for chrome browser tabs?
Is there any sample c++ code available?

Regards,
Rajesh

Dominic Mazzoni

unread,
Jul 16, 2013, 12:41:27 PM7/16/13
to Rajesh v.r, Chromium Accessibility
I'm assuming you already have code that accesses IAccessible. IAccessible2 is an extension to IAccessible. You can download the idl files here: http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/

Call queryService on any IAccessible COM object to get the IAccessible2 object, then you can call methods like uniqueID on it.

- Dominic

Rajesh v.r

unread,
Jul 17, 2013, 8:45:52 AM7/17/13
to chromium-ac...@chromium.org, Rajesh v.r
Thanks Dominic, this worked !!

But I have one more query. How can I identify the "Active tab" in a chrome browser window using "IAccessible or IAccessible2".
I have tried with IAccessible2 "get_states()" function, but it always returns "IA2_STATE_OPAQUE " state for active tab and also other tabs.

please help .

Thanks,
Rajesh.

Dominic Mazzoni

unread,
Jul 17, 2013, 9:51:24 AM7/17/13
to Rajesh v.r, Chromium Accessibility
Are you talking about the *tab* control itself, or the *tab contents*, i.e. the webpage?

The tab control itself may not indicate what's selected. I'll look into that if that's what you meant.

If you want the tab contents - only one appears in the MSAA tree at a time, whichever one is active. The inactive ones aren't renderered, visibly or in MSAA.

Rajesh v.r

unread,
Jul 18, 2013, 2:59:45 AM7/18/13
to chromium-ac...@chromium.org, Rajesh v.r
Query 1:
By using "AccExplorer32.exe" (Active Accessibility 2.0 SDK Tool), I have a tree view like below:

In this tree view, we can see that Chrome browser have three tabs (Google, Bing and Vivek.com). And "Google" is the current tab.Like this method I wish to find the current chrome browser tab by using "IAccessible or IAccessible2 or any other API's. You may also please try this and help me.

Query 2:
Is there any way to implement "ISimpleDOM" method for chrome browser with MSAA?
How can I implement "IAccessible accNavigate()" method into chrome browser?

Thanks,
Rajesh

Dominic Mazzoni

unread,
Jul 19, 2013, 1:52:16 PM7/19/13
to Rajesh v.r, Chromium Accessibility
On Wed, Jul 17, 2013 at 11:59 PM, Rajesh v.r <rajes...@gmail.com> wrote:
Query 1:
By using "AccExplorer32.exe" (Active Accessibility 2.0 SDK Tool), I have a tree view like below:

In this tree view, we can see that Chrome browser have three tabs (Google, Bing and Vivek.com). And "Google" is the current tab.Like this method I wish to find the current chrome browser tab by using "IAccessible or IAccessible2 or any other API's. You may also please try this and help me.

Here's one way you can do it now. Find the item in the tree with a role of "document". Look for the tab with the same title, that's the one that's selected.
 
Query 2:
Is there any way to implement "ISimpleDOM" method for chrome browser with MSAA?
How can I implement "IAccessible accNavigate()" method into chrome browser?

Chrome supports ISimpleDOM, give it a try.

Chrome supports a subset of accNavigate: firstchild, lastchild, next, and previous. Are there others you need?

- Dominic

Rajesh v.r

unread,
Jul 22, 2013, 3:49:53 AM7/22/13
to chromium-ac...@chromium.org, Rajesh v.r
Query 1:

Thanks Dominic for your response.
I have tried with the method you mentioned (item with role document). But I can't get the Tab title. Please send me some vc++ sample code for implementing this functionality.

Query 2:

I have tried with "IAccessible accNavigate()" functionality for firstchild, lastchild, next and previous. But it didn'twork properly.
Please tell me that which is the first parameter for accNaviget() you used for implementing this?
Could you please send me some vc++ sample code for doing this.

Thanks,
Rajesh
Reply all
Reply to author
Forward
0 new messages