Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tracking Canva #250

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Support tracking Canva #250

merged 1 commit into from
Mar 27, 2024

Conversation

starbugs
Copy link
Contributor

See my comment in the source.

Closes #236

@alanhamlett
Copy link
Member

Nice workaround. We need to get element at position instead of walking the tree from the passed in element because they're different trees?

@alanhamlett alanhamlett merged commit 3ec4aa2 into main Mar 27, 2024
6 checks passed
@alanhamlett alanhamlett deleted the feature/canva branch March 27, 2024 11:38
@alanhamlett alanhamlett mentioned this pull request Mar 27, 2024
@starbugs
Copy link
Contributor Author

starbugs commented Mar 27, 2024

Nice workaround. We need to get element at position instead of walking the tree from the passed in element because they're different trees?

Yes. As with many Electron apps, there's no WebArea node in the active window element's tree. But you can get access to element hierarchies by querying an element at a position. The same behavior can be reproduced in A11y Inspector.

One additional oddity of Canva is that the tab bar at the top of the window is not part of either tree. I don't know what they did there. I tried sampling the tabs by walking through x positions with a fixed y, but that only yields tab group elements that again don't expose any children.

On the flipside, this behavior is what makes the fix that I created quite workable. The active tab's web area root is properly titled and that seems to be consistent. So you always get the title of the current tab. Exactly what we need.

PS: I tried setting manual a11y on Canva and it fails with an error. So that solution for getting the whole tree exposed did not work here either.

I also checked all error conditions with this approach that I could think of. Window too small, window not visible at the time the check is made, etc. There may be edge cases in which a wrong title may be reported, but those should be extremely rare. You'd have to hide Canva and have another WebArea of a different app which is titled exactly at the same point on screen at exactly the right point in time. Maybe that's something we could guard against somehow, but that's the only condition that I could imagine where this reports something wrong. Otherwise, if anything fails, it should just report nil which should lead to no reporting at that point in time being sent to the API.

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.

Fix Canva tracking
2 participants