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

Check for isFinishedLaunching when initializing an Application from NSRunningApplication #17

Open
undsoft opened this issue Apr 2, 2019 · 1 comment

Comments

@undsoft
Copy link

undsoft commented Apr 2, 2019

In my app I'm listening to didActivateApplicationNotification notifications and then add AXObserver to the app that was activated.
I've noticed that in some scenarios I got UnknownUIElement errors when I was trying to add an observable right after launching Chrome.
I think this is due to the fact that chrome has isFinishedLaunching = false when activated.

The solution for me is to listen for another additional event (didLaunchApplicationNotification), but you may want to consider adding a check for isFinishedLaunching in Application initializers.

@tmandry tmandry changed the title UnknownUIElement when using Chrome immediately after launch Check for isFinishedLaunching when initializing an Application from NSRunningApplication Apr 13, 2019
@tmandry
Copy link
Owner

tmandry commented Apr 13, 2019

Thanks, I'll consider it. I don't know if that behavior is documented anywhere so I can verify I'm doing the right thing, but that's true for a lot of aspects of these APIs.

If initialized with only a process ID, we should document that we don't check this, either.

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

No branches or pull requests

2 participants