I use a global shortcut to popup a dialog. But I would like to fill the dialog depending on the application having the focus at the moment the shortcut is triggered.
But I can not find a way to do it. I read the extension code here but it's hard to know how to modify the code, and how to recompile electron.
If someone have a pointer, that will be greatly appreciated :)
I found an answer myself, it looks that the frontmost app (at least on OSX) it still the app that had the focus before the invokation.
Here is my ClojureScript code to find the app info
I couldn't find a way to know which app had the focus before, but I was able to hide my app and return the focus to the previous one, simulating clicking the 'hide' option from the view menu:
I hope it helps.