-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
app.dock.hide() crash on OS X Catalina when running as root #19896
Comments
Issue still present after upgrading to the new beta (beta 7) of Catalina. The instance in the error message changed: |
Reproduced in MacOS build 19A558d. 2019-09-17 10:50:09.630 Electron[1498:12005] -[__NSCFConstantString objectAtIndex:]: unrecognized selector sent to instance 0x7fff91c2f340 |
Reproduced with beta 9 (build 19A573a) 2019-09-25 09:49:15.316 Electron[1812:21458] -[__NSCFConstantString objectAtIndex:]: unrecognized selector sent to instance 0x7fff90409c60 |
Reproduced in the launch release of Catalina |
Unfortunately this is a
but we in Electron want to provide you more granular access, so we hook into slightly lower level components. Unfortunately, the above is a side effect of us allowing you to have more control at all. As such, i'm going to label this a |
@codebytere
The app I'm working on does not have a menu and it should not show it the Dock, it is very basic and must be called from root. How could apply the this bit in the app code, please? Sorry for the newbie question, just learning about this great way to create macOS apps. Thank you for any input. |
@MauricioFauth that's a great question - it's definitely possible and i'm open to considering it! Could you please open a new issue as a feature request? Specifically, a request for the ability to control app activation policy on macOS? |
@codebytere Thank you very much for considering this. Let me know if you need further information and, as a newbie, if I did something wrong. |
Thank you for the update. With the info you provided, I was able to workaround the issue by adding I second the request to be able to do this using the electron API instead of enforcing it via the app's plist. |
Preflight Checklist
Issue Details
6.0.3. Also observed on 4.2.9
OSX Catalina 10.15 Beta (19A536g)
Can't reproduce on non-Catalina variants of OSX - at least Yosemite and High Sierra
Expected Behavior
App icon not shown in Dock
Actual Behavior
Error message followed by Electron app crash
2019-08-22 13:18:37.765 Electron[73668:2759878] -[__NSCFConstantString objectAtIndex:]:
unrecognized selector sent to instance 0x7fff9812d5c0
To Reproduce
App crashes when calling app.dock.hide() but only when running as root, e.g. started as a service by launchd.
package.json:
{
"name": "electron-dock",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "^6.0.3"
}
}
main.js:
const {app, BrowserWindow} = require('electron')
app.dock.hide()
console.log('reached')
process.exit(0)
As non-privileged user:
$ npm start
As root, via sudo
$ sudo npm start
As root, via su - (or via launchd)
$ sudo su -
root# npm start
2019-08-22 13:23:11.096 Electron[73780:2762770] -[__NSCFConstantString objectAtIndex:]: unrecognized selector sent to instance 0x7fff9812d5c0
Additional Information
My app crashes with "Illegal instruction: 4" after printing the error message but the example above doesn't; not sure what the difference is.
Unsure why it runs ok via "sudo npm start", but not after "sudo su -" . It doesn't appear to be related to differenced in environment variables.
Reproduced on two OS X laptops, but on Catalina only (latest beta as of submission).
The text was updated successfully, but these errors were encountered: