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

hs.application.launchOrFocus not working for Chrome and Firefox #1689

Open
rjgibson opened this issue Feb 17, 2018 · 2 comments
Open

hs.application.launchOrFocus not working for Chrome and Firefox #1689

rjgibson opened this issue Feb 17, 2018 · 2 comments

Comments

@rjgibson
Copy link

I recently encountered the same issue as #1602 for both Chrome and Firefox. Using launchOrFocus with other applications appears to be working fine.

I'm running:

macOS 10.13.1 (High Sierra)
Hammerspoon: 0.9.60
Google Chrome: 64.0.3282.167 (Official Build) (64-bit)
Firefox: 58.0.2 (64-bit)

Executing:

hs.fnutils.each(hs.application.runningApplications(), function(app) print(app:name()) end)

in the Hammerspoon console shows "Google Chrome" for Chrome, and "Firefox" for Firefox. These are the identifiers I'm using as the "name" parameter to hs.application.launchOrFocus(name).

A workaround is to switch from hs.application.launchOrFocus(name) to hs.application.launchOrFocusByBundleID(bundleID), and specify bundleID as "com.google.chrome" or "org.mozilla.firefox".

@cmsj
Copy link
Member

cmsj commented Apr 3, 2018

hmm, I can't reproduce this, I can launchOrFocus() both Firefox and Google Chrome. Does anything change if you add hs.application.enableSpotlightForNameSearches(true) to your config?

@rjgibson
Copy link
Author

rjgibson commented Apr 3, 2018

It seems to be related to the browser automatically updating itself. I've found that it's a problem even after switching to hs.application.launchOrFocusByBundleID(bundleID) whenever Chrome auto-updates. In that case, restarting Chrome solves the problem until the next auto-update. I can't reproduce it on demand, but I'll try switching back to hs.application.launchOrFocus(name) and including hs.application.enableSpotlightForNameSearches(true) in my config.

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