問(wèn)題描述
我目前正在開(kāi)發(fā)一個(gè)電子托盤應(yīng)用程序.對(duì)于 Mac,electron 框架具有將應(yīng)用程序隱藏在 Dock 中的功能.
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();
我嘗試在 Windows 機(jī)器上運(yùn)行它并得到一個(gè)錯(cuò)誤.
I try to run this on a Windows machine and get an error.
TypeError: Cannot read property 'hide' of undefined
現(xiàn)在我正在為 Windows 尋找一個(gè)等效的功能來(lái)隱藏任務(wù)欄中的應(yīng)用程序.
Now I am looking for an equivalent functionality for Windows to hide the app in the taskbar.
推薦答案
Mac OS X 是面向應(yīng)用程序的,而 Windows 是面向窗口的...
Mac OS X is application-oriented, whereas Windows is window-oriented...
app.dock.hide ()
確實(shí)只標(biāo)記為 macOS.
app.dock.hide ()
Is indeed tagged as macOS only.
為了使窗口不顯示在任務(wù)欄中,您可以調(diào)用:
In order to make the window not show in the taskbar, you can either call:
win.setSkipTaskbar (true);
或者將 skipTaskbar
添加到傳遞給新 BrowserWindow 的選項(xiàng)中:
Or add skipTaskbar
to the options passed to the new BrowserWindow:
{
// ...
skipTaskbar: true,
// ...
}
這篇關(guān)于app.dock.hide() 的等價(jià)物是什么?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!