nvda
f14d344f - Edge with UIA: catch COMError when checking if an object is contained in a dead document when loading a new page (#15736)

Commit
2 years ago
Edge with UIA: catch COMError when checking if an object is contained in a dead document when loading a new page (#15736) Summary of the issue: When NVDA is set to use UI Automation for Chromium-based browsers, and loading a new page in Microsoft Edge, NVDA fails to detect the newly loaded page, and a traceback is logged: ERROR - api.setFocusObject (09:12:32.825) - MainThread (17268): Error updating tree interceptor Traceback (most recent call last): File "api.pyc", line 158, in setFocusObject File "treeInterceptorHandler.pyc", line 40, in update File "NVDAObjects\__init__.pyc", line 430, in _get_treeInterceptor File "treeInterceptorHandler.pyc", line 32, in getTreeInterceptor File "UIAHandler\browseMode.pyc", line 522, in __contains__ File "monkeyPatches\comtypesMonkeyPatches.pyc", line 32, in __call__ _ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None)) Specifically, fetching the runtime ID from the root element of the dead document fails. Description of user facing changes NVDA no longer fails to read a newly loaded page in Microsoft Edge when accessing it using UI Automation. Description of development approach Catch COMError and return False (conveying that the given object is not within the dead document).
Parents
Loading