Discussion:
Firefox 56+ : IAccessible.accNavigate(NAVRELATION_EMBEDS) fails with 0x80004005 (E_FAIL)
Sylvain
2017-11-26 07:14:54 UTC
Permalink
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
j***@mozilla.com
2017-11-28 06:47:41 UTC
Permalink
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
Post by Sylvain
Hi all,
"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."
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
s***@swsso.fr
2017-11-28 16:12:52 UTC
Permalink
Hi Jamie,

Thanks for your answer. Unfortunately, this does not fix the problem, including when focusing the Firefox window before calling accNavigate().

Here is my source code:
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }

for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_EMBEDS)=0x%08lx",hr));
if (hr==S_OK) break;
Sleep(1000);
}

And the result is:
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...

My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).

Thanks!

Sylvain
James Teh
2017-11-29 02:12:44 UTC
Permalink
Hi Sylvain,

I can't reproduce this in Windows 10 with Firefox 58b6 64 bit. I wrote my
own complete test case so we can test with exactly the same code. It'd be
great if you could compile the following C++ code. Then, start Firefox,
load example.com and run the test case. Here's the code:

---

// embeds.cpp: Test NAVRELATION_EMBEDS.
// Compile with:
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib oleaut32.lib

#include <windows.h>
#include <oleacc.h>
#include <iostream>

using namespace std;

// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";

const long NAVRELATION_EMBEDS = 0x1009;

int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}

---

When I do this, I get the following:

Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0

So, the first try fails, but the second succeeds.

Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the problem,
including when focusing the Firefox window before calling accNavigate().
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_
IAccessible,(void**)&pAccessible);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(
IID_IAccessible)=0x%08lx",hr)); goto end; }
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); //
NAVRELATION_EMBEDS = 0x1009
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_
EMBEDS)=0x%08lx",hr));
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
James Teh
2017-11-29 07:32:24 UTC
Permalink
Were you setting the pref to force enable remote accessibility or to disable it? Those prefs are no longer necessary. Multi-process accessibility is now enabled by default. It'd be good if you can re-run these tests with a clean profile and no prefs changed.


Sent from a mobile device
Post by s***@swsso.fr
Hi Jamie,
Thanks for the test case!
First of all: as my Firefox 58 was freshly reinstalled on my computer, the browser.tabs.remote.force-enable was not configured, that's why the test I ran yesterday failed... sorry for that.
Window 0003086A
accNavigate result -2147467259
accNavigate result 0
Test passed!
Window 0003086A
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 000E08BE
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00120890
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00110338
accNavigate result -2147467259
accNavigate result 0
Please note my Firefox version has been upgraded, I now run a 58.0b7.
Sylvain
Post by j***@mozilla.com
Hi Sylvain,
---
// embeds.cpp: Test NAVRELATION_EMBEDS.
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib oleaut32.lib
#include <windows.h>
#include <oleacc.h>
#include <iostream>
using namespace std;
// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
const long NAVRELATION_EMBEDS = 0x1009;
int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}
---
Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0
So, the first try fails, but the second succeeds.
Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the problem, including when focusing the Firefox window before calling accNavigate().
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_EMBEDS)=0x%08lx",hr));
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
James Teh
2017-11-29 08:08:19 UTC
Permalink
Deleting the pref should be fine if that's the only thing you did. That does lead me to wonder why your results were different yesterday, though. Perhaps there was some confusion regarding the difference with multiple tabs?

I'll investigate multiple tabs some time soon. I thought I'd already investigated this and wasn't able to reproduce, but I'll do some more isolated testing.

Sent from a mobile device
browser.tabs.remote.force-enable=true
After deleting this pref, result is the same.
How to be sure I'm using a clean profile? (I'll try later today after uninstalling Firefox & Firefox Developer Edition and reinstall only the last one)
Post by James Teh
Were you setting the pref to force enable remote accessibility or to disable it? Those prefs are no longer necessary. Multi-process accessibility is now enabled by default. It'd be good if you can re-run these tests with a clean profile and no prefs changed.
Sent from a mobile device
Post by s***@swsso.fr
Hi Jamie,
Thanks for the test case!
First of all: as my Firefox 58 was freshly reinstalled on my computer, the browser.tabs.remote.force-enable was not configured, that's why the test I ran yesterday failed... sorry for that.
Window 0003086A
accNavigate result -2147467259
accNavigate result 0
Test passed!
Window 0003086A
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 000E08BE
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00120890
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00110338
accNavigate result -2147467259
accNavigate result 0
Please note my Firefox version has been upgraded, I now run a 58.0b7.
Sylvain
Post by j***@mozilla.com
Hi Sylvain,
---
// embeds.cpp: Test NAVRELATION_EMBEDS.
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib oleaut32.lib
#include <windows.h>
#include <oleacc.h>
#include <iostream>
using namespace std;
// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
const long NAVRELATION_EMBEDS = 0x1009;
int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}
---
Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0
So, the first try fails, but the second succeeds.
Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the problem, including when focusing the Firefox window before calling accNavigate().
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_EMBEDS)=0x%08lx",hr));
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
s***@swsso.fr
2017-11-29 16:30:23 UTC
Permalink
Post by James Teh
Deleting the pref should be fine if that's the only thing you did. That does lead me to wonder why your results were different yesterday, though. Perhaps there was some confusion regarding the difference with multiple tabs?
I'll investigate multiple tabs some time soon. I thought I'd already investigated this and wasn't able to reproduce, but I'll do some more isolated testing.
Sent from a mobile device
browser.tabs.remote.force-enable=true
After deleting this pref, result is the same.
How to be sure I'm using a clean profile? (I'll try later today after uninstalling Firefox & Firefox Developer Edition and reinstall only the last one)
Post by James Teh
Were you setting the pref to force enable remote accessibility or to disable it? Those prefs are no longer necessary. Multi-process accessibility is now enabled by default. It'd be good if you can re-run these tests with a clean profile and no prefs changed.
Sent from a mobile device
Post by s***@swsso.fr
Hi Jamie,
Thanks for the test case!
First of all: as my Firefox 58 was freshly reinstalled on my computer, the browser.tabs.remote.force-enable was not configured, that's why the test I ran yesterday failed... sorry for that.
Window 0003086A
accNavigate result -2147467259
accNavigate result 0
Test passed!
Window 0003086A
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 000E08BE
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00120890
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00110338
accNavigate result -2147467259
accNavigate result 0
Please note my Firefox version has been upgraded, I now run a 58.0b7.
Sylvain
Post by j***@mozilla.com
Hi Sylvain,
---
// embeds.cpp: Test NAVRELATION_EMBEDS.
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib oleaut32.lib
#include <windows.h>
#include <oleacc.h>
#include <iostream>
using namespace std;
// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
const long NAVRELATION_EMBEDS = 0x1009;
int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}
---
Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0
So, the first try fails, but the second succeeds.
Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the problem, including when focusing the Firefox window before calling accNavigate().
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_EMBEDS)=0x%08lx",hr));
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
Yes, I guess there was confusion regarding multiple tabs (or the new test case below) with my tests yesterday.

Here is a new test case that fails:

First replace FindWindow("MozillaWindowClass", WINDOW_TITLE) by FindWindow("MozillaWindowClass", NULL) in the source code, so you can test with some url changes without compiling each time.

Open Firefox, open example.com, run test case:
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result 0
--> OK!

Run test case another time
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result 0
--> Still OK!

Open mozilla.org in the same tab (no multi tab), run test case:
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
--> Not OK... (and as you can see the window handle is unchanged, so this is not a FindWindow issue)

Thanks!

Sylvain
James Teh
2018-02-08 00:26:59 UTC
Permalink
Hi Sylvain,

Sorry for the delay in responding to this.

I was still unable to reproduce this myself. However, I've since had
confirmation from several parties previously experiencing this that this is
all working as expected in Firefox 59 beta. It'd be great if you could give
that a try and let me know if it fixes the problem for you.

Note that FindWindow("MozillaWindowClass", NULL) might find the wrong
window in some cases, as there can be top level windows for tool tips, etc.
Based on the output from the test case, I don't think this was the case for
you - it did succeed some of the time - but I thought it worth noting for
future tests.

Jamie
Post by James Teh
Post by James Teh
Deleting the pref should be fine if that's the only thing you did. That
does lead me to wonder why your results were different yesterday, though.
Perhaps there was some confusion regarding the difference with multiple
tabs?
Post by James Teh
I'll investigate multiple tabs some time soon. I thought I'd already
investigated this and wasn't able to reproduce, but I'll do some more
isolated testing.
Post by James Teh
Sent from a mobile device
browser.tabs.remote.force-enable=true
After deleting this pref, result is the same.
How to be sure I'm using a clean profile? (I'll try later today after
uninstalling Firefox & Firefox Developer Edition and reinstall only the
last one)
Post by James Teh
Post by James Teh
Were you setting the pref to force enable remote accessibility or to
disable it? Those prefs are no longer necessary. Multi-process
accessibility is now enabled by default. It'd be good if you can re-run
these tests with a clean profile and no prefs changed.
Post by James Teh
Post by James Teh
Sent from a mobile device
Post by s***@swsso.fr
Hi Jamie,
Thanks for the test case!
First of all: as my Firefox 58 was freshly reinstalled on my
computer, the browser.tabs.remote.force-enable was not configured, that's
why the test I ran yesterday failed... sorry for that.
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Window 0003086A
accNavigate result -2147467259
accNavigate result 0
Test passed!
But now try to open a 2nd tab, load example.com in this tab, close
Window 0003086A
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
It seems to be a problem with multiple tabs... for example this test
Open Firefox, open a 2nd tab, example.com in this tab, close the
Window 000E08BE
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Open Firefox, open a 2nd tab, example.com in this tab, run the test
Window 00120890
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00110338
accNavigate result -2147467259
accNavigate result 0
Please note my Firefox version has been upgraded, I now run a 58.0b7.
Sylvain
Post by j***@mozilla.com
Hi Sylvain,
I can't reproduce this in Windows 10 with Firefox 58b6 64 bit. I
wrote my own complete test case so we can test with exactly the same code.
It'd be great if you could compile the following C++ code. Then, start
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
---
// embeds.cpp: Test NAVRELATION_EMBEDS.
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib
oleaut32.lib
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
#include <windows.h>
#include <oleacc.h>
#include <iostream>
using namespace std;
// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
const long NAVRELATION_EMBEDS = 0x1009;
int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}
---
Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0
So, the first try fails, but the second succeeds.
Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the
problem, including when focusing the Firefox window before calling
accNavigate().
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_
IAccessible,(void**)&pAccessible);
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"
AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); //
NAVRELATION_EMBEDS = 0x1009
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_
EMBEDS)=0x%08lx",hr));
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox
58.0b6 (64 bits).
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
Yes, I guess there was confusion regarding multiple tabs (or the new test
case below) with my tests yesterday.
First replace FindWindow("MozillaWindowClass", WINDOW_TITLE) by
FindWindow("MozillaWindowClass", NULL) in the source code, so you can
test with some url changes without compiling each time.
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result 0
--> OK!
Run test case another time
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result 0
--> Still OK!
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
--> Not OK... (and as you can see the window handle is unchanged, so this
is not a FindWindow issue)
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
s***@swsso.fr
2018-02-08 20:26:52 UTC
Permalink
Post by j***@mozilla.com
Hi Sylvain,
Sorry for the delay in responding to this.
I was still unable to reproduce this myself. However, I've since had
confirmation from several parties previously experiencing this that this is
all working as expected in Firefox 59 beta. It'd be great if you could give
that a try and let me know if it fixes the problem for you.
Note that FindWindow("MozillaWindowClass", NULL) might find the wrong
window in some cases, as there can be top level windows for tool tips, etc.
Based on the output from the test case, I don't think this was the case for
you - it did succeed some of the time - but I thought it worth noting for
future tests.
Jamie
Post by James Teh
Post by James Teh
Deleting the pref should be fine if that's the only thing you did. That
does lead me to wonder why your results were different yesterday, though.
Perhaps there was some confusion regarding the difference with multiple
tabs?
Post by James Teh
I'll investigate multiple tabs some time soon. I thought I'd already
investigated this and wasn't able to reproduce, but I'll do some more
isolated testing.
Post by James Teh
Sent from a mobile device
browser.tabs.remote.force-enable=true
After deleting this pref, result is the same.
How to be sure I'm using a clean profile? (I'll try later today after
uninstalling Firefox & Firefox Developer Edition and reinstall only the
last one)
Post by James Teh
Post by James Teh
Were you setting the pref to force enable remote accessibility or to
disable it? Those prefs are no longer necessary. Multi-process
accessibility is now enabled by default. It'd be good if you can re-run
these tests with a clean profile and no prefs changed.
Post by James Teh
Post by James Teh
Sent from a mobile device
Post by s***@swsso.fr
Hi Jamie,
Thanks for the test case!
First of all: as my Firefox 58 was freshly reinstalled on my
computer, the browser.tabs.remote.force-enable was not configured, that's
why the test I ran yesterday failed... sorry for that.
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Window 0003086A
accNavigate result -2147467259
accNavigate result 0
Test passed!
But now try to open a 2nd tab, load example.com in this tab, close
Window 0003086A
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
It seems to be a problem with multiple tabs... for example this test
Open Firefox, open a 2nd tab, example.com in this tab, close the
Window 000E08BE
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Open Firefox, open a 2nd tab, example.com in this tab, run the test
Window 00120890
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
Window 00110338
accNavigate result -2147467259
accNavigate result 0
Please note my Firefox version has been upgraded, I now run a 58.0b7.
Sylvain
Post by j***@mozilla.com
Hi Sylvain,
I can't reproduce this in Windows 10 with Firefox 58b6 64 bit. I
wrote my own complete test case so we can test with exactly the same code.
It'd be great if you could compile the following C++ code. Then, start
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
---
// embeds.cpp: Test NAVRELATION_EMBEDS.
// cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib
oleaut32.lib
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
#include <windows.h>
#include <oleacc.h>
#include <iostream>
using namespace std;
// Tweak as needed to find the Firefox window.
// This title works if using a Firefox release
// with example.com loaded in the active tab.
const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
const long NAVRELATION_EMBEDS = 0x1009;
int main()
{
CoInitialize(NULL);
HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
cout << "Window " << window << endl;
if (!window) {
cout << "Failed to get window" << endl;
return 1;
}
IAccessible* rootAcc;
HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
IID_IAccessible, (void**)&rootAcc);
if (FAILED(hr)) {
cout << "AccessibleObjectFromWindow failed with " << hr << endl;
return 1;
}
VARIANT child;
child.vt = VT_I4;
child.lVal = CHILDID_SELF;
VARIANT target;
for (int i = 0; i < 5; ++i) {
hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
cout << "accNavigate result " << hr << endl;
if (hr == S_OK) {
target.pdispVal->Release();
break;
}
Sleep(1000);
}
rootAcc->Release();
}
---
Window 006F0AFE
accNavigate result -2147467259
accNavigate result 0
So, the first try fails, but the second succeeds.
Jamie
Post by s***@swsso.fr
Hi Jamie,
Thanks for your answer. Unfortunately, this does not fix the
problem, including when focusing the Firefox window before calling
accNavigate().
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
// w is the main Firefox window handle ("MozillaWindowClass")
hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_
IAccessible,(void**)&pAccessible);
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"
AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
for (int i=0;i<50;i++) // test every second
{
hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); //
NAVRELATION_EMBEDS = 0x1009
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_
EMBEDS)=0x%08lx",hr));
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
if (hr==S_OK) break;
Sleep(1000);
}
28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
...
My testing environment is Windows 10 (10.0.15063) and Firefox
58.0b6 (64 bits).
Post by James Teh
Post by James Teh
Post by s***@swsso.fr
Post by j***@mozilla.com
Post by s***@swsso.fr
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
Yes, I guess there was confusion regarding multiple tabs (or the new test
case below) with my tests yesterday.
First replace FindWindow("MozillaWindowClass", WINDOW_TITLE) by
FindWindow("MozillaWindowClass", NULL) in the source code, so you can
test with some url changes without compiling each time.
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result 0
--> OK!
Run test case another time
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result 0
--> Still OK!
C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 002412A0
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
accNavigate result -2147467259
--> Not OK... (and as you can see the window handle is unchanged, so this
is not a FindWindow issue)
Thanks!
Sylvain
_______________________________________________
dev-accessibility mailing list
https://lists.mozilla.org/listinfo/dev-accessibility
Hi Jamie,

You're right, it's working as expected with Firefox 59 (tested with 59.0b7) :-)

First call still fails, but retry is OK :

C:\swSSO\Firefox58\Debug>Firefox58.exe
Window 00040872
accNavigate result -2147467259
accNavigate result 0

Sylvain

Loading...