Pommesloch
Pommesloch

Reputation: 502

What is the equivalent for app.dock.hide();

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.

electron app in dock

Upvotes: 6

Views: 7789

Answers (1)

user8022331
user8022331

Reputation:

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,
    // ...
}

Upvotes: 17

Related Questions