Skip to content

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

Merged
seanbudd merged 3 commits into
masterfrom
edgeDeadTreeInterceptors
Nov 3, 2023
Merged

Edge with UIA: catch COMError when checking if an object is contained in a dead document when loading a new page#15736
seanbudd merged 3 commits into
masterfrom
edgeDeadTreeInterceptors

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

None.

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).

Testing strategy:

  • Set NVDA to use UI Automation to access Chromium-based browsers.
    In Microsoft Edge, go to https://www.nvaccess.org/
  • Tab to the Download link and press etner.
  • Once the new page is loaded, confirm that the arrow keys can be used to move through NVDA's browse mode for the new document, and that a traceback is not logged.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

…MError when fetching runtimeID from a dea ddocument.
@michaelDCurran michaelDCurran requested a review from a team as a code owner November 2, 2023 23:29
@michaelDCurran michaelDCurran changed the title Edge with UIA: catch COMError when checking if an object is cotnained in a dead document when loading a new page Edge with UIA: catch COMError when checking if an object is contained in a dead document when loading a new page Nov 2, 2023
@seanbudd seanbudd merged commit f14d344 into master Nov 3, 2023
@seanbudd seanbudd deleted the edgeDeadTreeInterceptors branch November 3, 2023 02:45
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants