Re: Firefox 56+ : IAccessible.accNavigate(NAVRELATION_EMBEDS) fails with 0x80004005 (E_FAIL)

[email protected] Mon, 27 Nov 2017 22:47:41 -0800 (PST)
Newsgroups gmane.comp.mozilla.accessibility
Message-ID <[email protected]>
Hi Sylvain,

There were certainly bugs in Firefox 56 and 57 which would have caused this problem. However, these should be fixed in 58, with one caveat:

When accessibility is first enabled (by retrieving the client accessible for the Firefox window), accessibles for web documents may not immediately be available. (Because they're now in another process, they get created asynchronously.) Thus, once you retrieve the root accessible, you may need to delay slightly before trying to use NAVRELATION_EMBEDS (or retry the call a few times) in order to get a successful result.

Does doing this fix the problem?
Failing that, does focusing the Firefox window before doing this fix the problem?
Finally, what version of Windows are you testing this with?

Thanks!

Jamie

On Sunday, November 26, 2017 at 5:14:55 PM UTC+10, Sylvain wrote:
> Hi all,
> 
> This article (https://developer.mozilla.org/en-US/docs/Web/Accessibility/AT-APIs/Differences/MSAA) says:
> 
> "enum { NAVRELATION_EMBEDS = 0x1009 };
> This relation is used on the root accessible object for a top level Mozilla window, corresponding to what's returned for OBJID_CLIENT for that window. It points to the accessible object corresponding to the root of content in that window. This relation is very useful for finding the content quickly, and will be the proper method for finding content in Firefox 3 and beyond."
> 
> Since Firefox 3, I was using this method and it was working fine with this source code:
> hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
> if (SUCCEEDED(hr)) 
> {
>   hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
>   ...
> }
> 
> But with Firefox 56, 57 and 58, it returns E_FAIL :-(
> 
> How are we supposed to do now to find the content?
> 
> (I have developed alternative source code to parse all the objects, looking for a ROLE_SYSTEM_DOCUMENT that is STATE_SYSTEM_FOCUSED and not STATE_SYSTEM_INVISIBLE, but performance is poor and having focus on the Firefox window is prerequisite, and this is a problem for me)
> 
> Thanks!
> 
> Sylvain