问题
I currently working on an electron tray application. For Mac, the electron framework has a function for hiding the app in the dock.
app.dock.hide();
I try to run this on a Windows machine and get an error.
TypeError: Cannot read property 'hide' of undefined
Now I am looking for an equivalent functionality for Windows to hide the app in the taskbar.
回答1:
Mac OS X is application-oriented, whereas Windows is window-oriented...
app.dock.hide () Is indeed tagged as macOS only.
In order to make the window not show in the taskbar, you can either call:
win.setSkipTaskbar (true);
Or add skipTaskbar
to the options passed to the new BrowserWindow:
{
// ...
skipTaskbar: true,
// ...
}
来源:https://stackoverflow.com/questions/46364167/what-is-the-equivalent-for-app-dock-hide